How to compress tiff image
I am currently storing the tiff image in BufferredImage during runtime and
displaying the same in image src tag of hmtl.
My tiff image size is about 60kb and currently it takes approx 1 sec time
to load in web browser.
Is there any way to compress the tiff image or BufferedImage so that the
time to load the image in browser can be faster.
Below is my code for saving tiff image in BufferredImage.
public BufferedImage savetiff(File srcFilePath) throws IOException {
FileSeekableStream stream = new FileSeekableStream(srcFilePath);
TIFFDecodeParam decodeParam = new TIFFDecodeParam();
decodeParam.setDecodePaletteAsShorts(true);
ParameterBlock params = new ParameterBlock();
params.add(stream);
RenderedOp image1 = JAI.create("tiff", params);
BufferedImage img = image1.getAsBufferedImage();
return img;
}
Please advice.
Regards,
Dinesh Pise
No comments:
Post a Comment