Skip to main content

[JAI-IMAGEIO] Writing a BufferedImage to TIFF file

2 replies [Last post]
amnesia
Offline
Joined: 2008-01-02

Hi.

I need to save either a BufferedImage as a TIFF. I can't figure out how to accomplish this by reading the documentation. It looks like this is possible from some of the questions posted to this forum. I think that I may need a push(or shove) in the right direction. Anyone feel like lending a hand?

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
amnesia
Offline
Joined: 2008-01-02

Thank you for your response. I did not know that a BufferedImage was a RenderedImage, until I checked after reading your response. I got it to work, besides the compression part, which I don't think I care about.

I could write to a JPEG like:

ImageIO.write(dbImage, "JPEG", file);

and was hoping to get away with writting a TIFF by swapping out "JPEG" with "TIFF". However, that only resulted in 0 byte TIFFs.

Thanks again.

--Spencer

jxc
Offline
Joined: 2005-02-24