Counting colours
Posted: Fri Mar 26, 2004 3:20 pm
Hi,
Anyone know a really fast way to count the colours in an image? The only way I know is to check each pixel, then look for a matching pixel in the palette, adding the colour to the palette if it isn't already there. This method is really slow, though, especially with pictures over 100x100 pixels.
Paint Shop Pro (7) can count the colours in just about any size of picture in under 0.3 sec. How on Earth does it do it?
Thanks,
Kris
Anyone know a really fast way to count the colours in an image? The only way I know is to check each pixel, then look for a matching pixel in the palette, adding the colour to the palette if it isn't already there. This method is really slow, though, especially with pictures over 100x100 pixels.
Paint Shop Pro (7) can count the colours in just about any size of picture in under 0.3 sec. How on Earth does it do it?
Thanks,
Kris