12

I am looking at java APIs to convert JPEG file streams to TIFF files. I looked at the JAI but did not find something similar to what i am looking at.

Can someone point me to a good API which does this ?

OscarRyz
  • 196,001
  • 113
  • 385
  • 569
EclipseGuru
  • 1,047
  • 3
  • 14
  • 16

6 Answers6

5

There's an example here

http://log.robmeek.com/2005/08/write-tiff-in-java.html

and another here

Tiff compression using Java ImageIO

Community
  • 1
  • 1
objects
  • 8,637
  • 4
  • 30
  • 38
  • I tried this example and successfully converted the JPEG2TIFF. I am able to open it with IrfanView but not with Microsoft picture Viewer. Also the Microsoft Image Document says that this TIFF image is corrupted. Do you have any idea why this happens ? – EclipseGuru Jun 10 '09 at 17:04
  • no idea sorry. have you tried different compression options to see if that makes a difference – objects Jun 11 '09 at 00:03
  • hey, i try the code and I cant seem to get it to compile. It does not reconigze `TIFFImageWriteParam`. Any idea? – Thang Pham Mar 02 '11 at 23:00
1

JAVA JAI does support encoding/decoding TIFF. You need to get the image codecs (<--link) and call them like ImageDecoder decoder = ImageCodec.createImageDecoder("tiff", seekableStream, null);

Jake
  • 462
  • 1
  • 9
  • 19
1

ImageMagick has a Java api available

Jherico
  • 28,584
  • 8
  • 61
  • 87
1

The javax.imageio package has built-in writers for most of the popular image types, including jpg and tiff. Here's Sun's page on imageio.

http://java.sun.com/javase/6/docs/technotes/guides/imageio/index.html

Hardwareguy
  • 2,941
  • 1
  • 17
  • 13
1

JIMI is quite easy to use. http://java.sun.com/products/jimi/

Unfortunately Sun transmogriffed it into Java2D (afair) and THAT is not quite that easy to use.

For a quick solution, use JIMI.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
0

JAI (Java Advanced Imaging) is the best solution. It has a decoder and encoder for TIFF files.

BoDiE2003
  • 1,349
  • 6
  • 28
  • 41