AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
November 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.11.21 16:50 "24 bit Color to 8 bit Palettized Conversion Utility (tiffcp enhancement/variation?)", by Kevin Myers
2008.11.21 17:29 "Re: 24 bit Color to 8 bit Palettized Conversion Utility (tiffcp enhancement/variation?)", by Frank Warmerdam
2008.11.21 18:49 "Re: 24 bit Color to 8 bit Palettized Conversion Utility (tiffcp enhancement/variation?)", by Bob Friesenhahn
2008.11.21 19:11 "Re: 24 bit Color to 8 bit Palettized Conversion Utility (tiffcp enhancement/variation?)", by Bob Friesenhahn
2008.11.21 19:37 "Re: 24 bit Color to 8 bit Palettized Conversion Utility (tiffcp enhancement/variation?)", by Kevin Myers

2008.11.21 19:11 "Re: 24 bit Color to 8 bit Palettized Conversion Utility (tiffcp enhancement/variation?)", by Bob Friesenhahn

On Fri, 21 Nov 2008, Bob Friesenhahn wrote:
>
> Did you try VIPS?  VIPS is able to accomplish many things without loading the 
> whole image into memory and it is usually quite fast.  I don't know if its 
> color reduction works without loading the whole image though since that would 
> require a several-pass algorithm.

Actually, from looking at the VIPS documentation, I am not finding an 
algorithm for color reduction at all.  Maybe it does not exist. :-(
Still, a programmer could use the VIPS API to develop a muti-pass 
color reduction algorithm.

In order to color reduce you need to

  1) Build a color tree / histogram of the existing colors in the
     image. This requires reading all the image pixels.

  2) Evaluate the color tree and build a colormap which best
     approximates it.

  3) Re-read the image pixels and generate colormap indexes which best
     approximate the image given the colormap which was selected.  This
     may include dithering.

So it can be seen that to color reduce an image using the color tree / 
histogram method requires reading the pixels at least twice.  RAM is 
now about 10,000 times faster than disk so reading from disk multiple 
times is prohibitive unless the decoded image can not fit in RAM.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/