Post Reply 

Indexed color tif - can gimp handle less than 256 colors?

Dec 1, 2011, 04:28
Post: #1
Indexed color tif - can gimp handle less than 256 colors?
To save space on large images, color indexed images should be able to reduce the file size. I'm not sure gimp is handling this correctly.

I have some high resolution drawings which I need to markup some redlines on. They are 1bit (black and white) tif files. If I convert them to full color rgb the file size is nearly 1Gb, so I need to be able to use color indexing to limit the size.
I extracted a small area to quickly test the problem.

What I found is that gimp claims to create a 3 color index file, but when I reopen the file, gimp then reports it as 256 color!

If you want to try this, I've attached the file and the steps are detailed below.

Is this a problem that has been fixed in later versions (I am using gimp2.6), or is this a known problem/limitation? I've tried this in Ubuntu 10.04LTS and Windows XP with the same result.

If anyone has any ideas what is going on I would be gratefull for any info.

------------------------------------------
The original image is original.tif - a (1 bit grayscale) image.
(15.1kb)

With Gimp, this was converted to rgb 'mode' (Image-Mode-RGB)
Saved this as rgb.tif

I then Drew a red line on it (to add a 3rd color), then converted the image to indexed, with max 4 colors. (Image->Mode->Indexed->Generate optimum palette, Max numb of colors:4)

The colormap (Dialog-Colormap) showed just 3 colors. Image properties (Alt-Enter) also shows the colorspace as expected as 3 colors (black, white and red).
Saved the file as 4col.tif

However, when I close and reopen the same file, the colormap and image properties now show 256 colors!

(Lzw compression was used each time the tif was saved)


Attached File(s)
.tif  original.tif (Size: 15.14 KB / Downloads: 54)
.tif  4col.tif (Size: 25.86 KB / Downloads: 52)
Find all posts by this user
Quote this message in a reply
Dec 1, 2011, 08:49
Post: #2
RE: Indexed color tif - can gimp handle less than 256 colors?
Yes, obviously (I checked with "synthetic" images), GIMP goes from one bit/pixel to eight, and doesn't try to use th intermediate 2BPP and 4BPP format. When it reloads the indexed image it shows a mostly dummy color map. I get the same results with indexed PNG (which, by the way, always produces images a tad smaller (20%) than the indexed TIFF ones.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Dec 1, 2011, 17:14
Post: #3
RE: Indexed color tif - can gimp handle less than 256 colors?
Thanks ofnuts. That explains what's happening. Based on that, I'll swith to using png for the modified files. Thanks for the quick response.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Issue viewing GIMP-modified picture JuniorPear 1 194 Jul 6, 2017 05:03
Last Post: ythgilb
  GIMP Taking Too Long to Start (Fonts) Seta 2 207 Jun 20, 2017 16:10
Last Post: Seta
  Problem with pressure on gimp (huion h610) protosd3 18 5,048 Jun 8, 2017 19:20
Last Post: John Penfold
Question Gimp 2.8 Startup Keeps Not Responding lolly325 38 22,373 Jun 5, 2017 15:46
Last Post: blighty
  Color alpha function and its current errors Fuse809 0 173 Oct 11, 2014 03:53
Last Post: Fuse809

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS