Interesting that you find that since CCITT G3/G4 should almost always compress 1bit images better than Flate does, since it's designed for that type of data.
Leonard -----Original Message----- From: Giles Alexander [mailto:[email protected]] Sent: Wednesday, April 08, 2009 4:08 AM To: [email protected] Subject: [iText-questions] Compressing monochrome bitmaps using deflate Hi, I'm attempting to use iText to create a PDF containing a bitmap image. The bitmap image is large, but a simple monochrome image with one bit per-pixel. When creating a PDF containing an image like this, the image stream is always encoded as a CCITT stream. This gives fairly poor compression, and I would like to compress using Deflate as that compresses this particular image very well. But, I can't figure out how to get this to work. I've modelled my code on the compression levels image example, found here: http://1t3xt.info/examples/browse/?page=example&id=404 The only major change I've made to that code is to load the bitmap from a file using a FileInputStream, and then use the Image.getInstance() overload that produces an ImgRaw from a width, height, components, bits per component and a byte array. And all of the different levels compress the image identically, in fact the final PDF files are indistinguishable. How do I get monochrome raw images to be compressed using deflate? Thanks, Giles ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php
