Skip to main content

JPEG to TIFF 6

4 replies [Last post]
mzmokus
Offline
Joined: 2006-09-27
Points: 0

I'm needing a way to convert a JPEG into a TIFF 6 with a compression of CCITT G4 (200 DPI minimum resolution - Black/White). I was able to create a TIFF this way but wasn't able to set the compression properly and was redirected to use the JAI Image I/O Tools. Any help would be greatly appreciated.

String tiffFile = "myTiff.tiff";
String jpegFile = "myJPEG.jpeg";

FileOutputStream out = new FileOutputStream(tiffFile);
RenderedImage src = JAI.create("fileload", jpegFile);
TIFFImageEncoder encoder = new TIFFImageEncoder(out, null);
encoder.encode(src);

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mzmokus
Offline
Joined: 2006-09-27
Points: 0

Would this set my compression properly? Will I have to modify my JPEG before this in order to be a bilevel image?

TIFFImageWriteParam writeParam = new
TIFFImageWriteParam(Locale.US);
writeParam.setCompressionMode(TIFFImageWriteParam.MODE_EXPLICIT);
writeParam.setCompressionType("CCITT T.6");

Message was edited by: mzmokus

Message was edited by: mzmokus

Brian Burkhalter

On Thu, 28 Sep 2006, jai-imageio@javadesktop.org wrote:

> Would this set my compression properly?

It should do.

> Will I have to modify my JPEG before this in order to be a bilevel image?

If it's not bilevel already which I don't believe it can be then yes. There
are lots of ways to do this all of which have been discussed before.

> TIFFImageWriteParam writeParam = new
> TIFFImageWriteParam(Locale.US);
> writeParam.setCompressionMode(TIFFImageWriteParam.MODE_EXPLICIT);
> writeParam.setCompressionType("CCITT T.6");
>
>
> Message was edited by: mzmokus
>
> [Message sent by forum member 'mzmokus' (mzmokus)]
>
> http://forums.java.net/jive/thread.jspa?messageID=157922
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

mzmokus
Offline
Joined: 2006-09-27
Points: 0

Yes. This would be what I need.

Thank you

Brian Burkhalter

CCITT group 3 and 4 fax compression (a.k.a. ITU T.4 and T.6 bilevel encodings,
respectively), apply only to bilevel imagery, i.e., each pixel has a single
1-bit component. Is this the case for you?

Brian

On Thu, 28 Sep 2006, jai-imageio@javadesktop.org wrote:

> I'm needing a way to convert a JPEG into a TIFF 6 with a compression of CCITT G4 (200 DPI minimum resolution - Black/White). I was able to create a TIFF this way but wasn't able to set the compression properly and was redirected to use the JAI Image I/O Tools. Any help would be greatly appreciated.
>
> String tiffFile = "myTiff.tiff";
> String jpegFile = "myJPEG.jpeg";
>
> FileOutputStream out = new FileOutputStream(tiffFile);
> RenderedImage src = JAI.create("fileload", jpegFile);
> TIFFImageEncoder encoder = new TIFFImageEncoder(out, null);
> encoder.encode(src);
> [Message sent by forum member 'mzmokus' (mzmokus)]
>
> http://forums.java.net/jive/thread.jspa?messageID=157659
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-imageio.dev.java.net
>
>

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net