Currently if you use the PdfGraphics2D.drawImage() obtained from the PdfContentByte any image 'drawn' is converted to RGB. The supplied simple patch optimizes this so that binary images will be stored as G4 compressed images. This is important not so much in file size, but many readers can optimize the display of binary images. If they converted/stored as RGB color the display consumes much more memory and can be slower in some instances. The supplied patch is inefficient but simple. It just sets the forceBW appropriately. It is inefficient because the binary image is read as RGB only to be converted back to binary. A better implementation would get the raster from the BufferedImage directly rather than use a PixelGrabber. Similar techniques could (should?) be used for BYTE_GRAY images, as these would benefit greatly as well, but there isn't any grayscale image support in iText that I could easily find. Robert Engels |
bwimage.patch
Description: Binary data
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/