RSS/Atom feed Twitter
Site is read-only, email is disabled

Saving black/white TIFF with 'CCITT Group 4' encoding

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

8 of 8 messages available
Toggle history

Please log in to manage your subscriptions.

Saving black/white TIFF with 'CCITT Group 4' encoding Manfred Joerg 25 Jan 16:16
  Saving black/white TIFF with 'CCITT Group 4' encoding Sven Neumann 01 Feb 09:34
   Saving black/white TIFF with 'CCITT Group 4' encoding Manfred Joerg 01 Feb 22:47
   Saving black/white TIFF with 'CCITT Group 4' encoding Manfred Joerg 11 Feb 19:44
    Saving black/white TIFF with 'CCITT Group 4' encoding Sven Neumann 12 Feb 08:38
     Saving black/white TIFF with 'CCITT Group 4' encoding Manfred Joerg 12 Feb 20:09
      Saving black/white TIFF with 'CCITT Group 4' encoding Sven Neumann 13 Feb 09:57
       Saving black/white TIFF with 'CCITT Group 4' encoding jernej@ena.si 13 Feb 12:00
Manfred Joerg
2007-01-25 16:16:38 UTC (almost 18 years ago)

Saving black/white TIFF with 'CCITT Group 4' encoding

Hello,

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.

I attached my patch to the bug report.

Regards Manfred

Sven Neumann
2007-02-01 09:34:44 UTC (almost 18 years ago)

Saving black/white TIFF with 'CCITT Group 4' encoding

Hi,

On Thu, 2007-01-25 at 16:16 +0100, Manfred Joerg wrote:

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.

I attached my patch to the bug report.

I've attached a revised patch some days ago. Did you (or anyone else) get a chance to try it? I would like to commit this as soon as possible but the patch needs some more testing before it can go in.

Sven

Manfred Joerg
2007-02-01 22:47:51 UTC (almost 18 years ago)

Saving black/white TIFF with 'CCITT Group 4' encoding

Hi Sven,

I'll check it as soon as possible. I won't be able to do that before Monday. I didn't get a notification about your revised patch because I forgot to add my e-mail-address to the distribution list.

Manfred

On Thursday 01 February 2007 09:34, you wrote:

I've attached a revised patch some days ago. Did you (or anyone else) get a chance to try it? I would like to commit this as soon as possible but the patch needs some more testing before it can go in.

Sven

Manfred Joerg
2007-02-11 19:44:43 UTC (almost 18 years ago)

Saving black/white TIFF with 'CCITT Group 4' encoding

Hello Sven,

I just checked your revised tiff patch.

1. It doesn't allow the user to save a rgb image as CCITT Datagroup 3/4 even if it contains only black and white pixels. Instead the user has to convert the image to indexed mode black/white first. For my sample image (4048 x 6648 pixels) that takes 50 seconds on a Pentium IV 3 GHz machine (no colour dithering).

There are three ways to improve this: - Allow the user to save images of all modes as CCITT. The tiff library can handle this if the image contains only black and white pixels. Otherwise the tiff library returns an error code.
- Improve the speed of the conversion to indexed mode. - Add an option to the threshold tool which automatically creates an indexed black white image

2. The tiff files created by the Gimp are 4% greater than the ones created by Irfanview. Are you using the latest version of the tiff library? However it's not so bad. The tiff files generated by XnView are 13% greater.

Apart from that the patch works fine. I checked it under Windows. I saved some files and opened them with Irfanview and XnView.

Regards Manfred

On Thursday 01 February 2007 09:34, Sven Neumann wrote:

Hi,
I've attached a revised patch some days ago. Did you (or anyone else) get a chance to try it? I would like to commit this as soon as possible but the patch needs some more testing before it can go in.

Sven

Sven Neumann
2007-02-12 08:38:56 UTC (almost 18 years ago)

Saving black/white TIFF with 'CCITT Group 4' encoding

Hi,

On Sun, 2007-02-11 at 19:44 +0100, Manfred Joerg wrote:

I just checked your revised tiff patch.

1. It doesn't allow the user to save a rgb image as CCITT Datagroup 3/4 even if it contains only black and white pixels. Instead the user has to convert the image to indexed mode black/white first.

That is the intended behavior. The user should only be allowed to select the new compression schemes if the image is indexed with a b/w colormap. The radio buttons should be insensitive otherwise and an allowed compression scheme should be preselected.

As long as images saved that way are also loaded in Indexed mode with a b/w colormap, this should be fine.

Sven

Manfred Joerg
2007-02-12 20:09:05 UTC (almost 18 years ago)

Saving black/white TIFF with 'CCITT Group 4' encoding

Hi Sven,

On Monday 12 February 2007 08:38, Sven Neumann wrote:

1. It doesn't allow the user to save a rgb image as CCITT Datagroup 3/4 even if it contains only black and white pixels. Instead the user has to convert the image to indexed mode black/white first.

That is the intended behavior. The user should only be allowed to select the new compression schemes if the image is indexed with a b/w colormap. The radio buttons should be insensitive otherwise and an allowed compression scheme should be preselected. Sven

So far so good. What do you think about my idea to add an option to the threshold tool which allows the user to create an indexed black/white image instead of a rgb image which only contains black and white pixels?

The conversion to indexed takes a lot of time for big images..

Manfred

Sven Neumann
2007-02-13 09:57:17 UTC (almost 18 years ago)

Saving black/white TIFF with 'CCITT Group 4' encoding

Hi,

On Mon, 2007-02-12 at 20:09 +0100, Manfred Joerg wrote:

So far so good. What do you think about my idea to add an option to the threshold tool which allows the user to create an indexed black/white image instead of a rgb image which only contains black and white pixels?

I don't like it because none of our tools change the image mode.

The conversion to indexed takes a lot of time for big images..

It doesn't take very long if you turn off dithering. Anyway, if there's a performance problem, then we (or you) should look into fixing it instead of adding ways to work around it. Perhaps it would be a good idea to gather some profiling data on the RGB->Indexed conversion code.

Sven

jernej@ena.si
2007-02-13 12:00:38 UTC (almost 18 years ago)

Saving black/white TIFF with 'CCITT Group 4' encoding

On Tuesday, February 13, 2007, 9:57:17, Sven Neumann wrote:

It doesn't take very long if you turn off dithering. Anyway, if there's a performance problem, then we (or you) should look into fixing it instead of adding ways to work around it. Perhaps it would be a good idea to gather some profiling data on the RGB->Indexed conversion code.

Compared to GIMP 1.2.5, converting image to indexed palette is much slower (for pictures that I often convert to indexed, GIMP 1.2.5 usually does the conversion instantly, while GIMP 2.x takes several seconds [and fills the progress bar 3 times while doing it]). I also prefer the result given by GIMP 1.2.5.