GNOME Bugzilla – Bug 162119
Saving black/white TIFF with 'CCITT Group 4' encoding
Last modified: 2007-02-14 08:12:25 UTC
It would be nice to be able to use the Group 4 FAX encoding for saving black and white images. Black and white means a bit depth of 1 in this case. The compression algorithm is taylored for that kind of data and yields a better compression ratio than PNG or GIF.
I am dealing with TIFF reading and writing right now, and I think I can handle this in short term.
This feature request shares some technical issues with bug #150865 I think.
Isn't it even a duplicate of bug #150865 ?
No, since CCITT FAX4 isn't a save compression option. It would be easy to add the option, but perhaps it'd be worth hiding/disabling invalid compression options for a given file type instead of erroring later.
*** Bug 307010 has been marked as a duplicate of this bug. ***
Created attachment 81195 [details] [review] Allows the user to save tiff images as CCITT Group 4. I think that I fixed bug 162119. My patch allows the user to save TIFF images with CCITT Group 4. The advantage of this file format is that a scanned text page (600 dpi) takes only 100 KByte. The patch is based on version 2.3.14. I only added the option to the dialog and an error message which informs the user that only black / white images can be saved as CCITT Group 4. The tiff library already contains the necessary code.
The error message needs to be marked as translatable. It should perhaps also give the user a hint on how to make an image b/w (convert to indexed colormap with b/w palette).
Created attachment 81384 [details] [review] largely reworked patch The attached patch attempts to fully implement this feature. This includes saving the new compression type in the tiff-options parasite. It also only allows the new compression type to be selected if the image is monochrome. Please try this patch and give it some testing.
Created attachment 81387 [details] [review] fixed patch The former patch had a g_free() in the wrong spot. This patch fixes this.
2007-02-14 Sven Neumann <sven@gimp.org> * plug-ins/common/tiff.c: added CCITT Group 3 and 4 compression schemes to TIFF save plug-in. These modes are selectable for indexed image with a b/w colormap only. Fixes bug #162119 with the help of Manfred Joerg.