# What's the best palette reduction program/source code?

**URL:** <https://boards.straightdope.com/t/whats-the-best-palette-reduction-program-source-code/122171>\
**Category:** Factual Questions\
**Created:** [August 3, 2002, 1:55pm UTC](https://boards.straightdope.com/t/whats-the-best-palette-reduction-program-source-code/122171 "2002-08-03T13:55:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnClay](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@JohnClay](https://boards.straightdope.com/u/JohnClay)\
**Post date:** [August 3, 2002, 1:55pm UTC](https://boards.straightdope.com/t/whats-the-best-palette-reduction-program-source-code/122171/1 "2002-08-03T13:55:29Z")

</div>

Hi,  
I was looking for something that can reduce the colours in an image to the desired amount (e.g. 24 colours) so that the image looks as good as possible.  
I think the ideal algorithm might place more of a weighting on colour ranges that take up more area of the picture… e.g. if there is an image with text and a gradient, it would give the gradient a lot of colours - to minimize colour banding (if dithering isn’t used) or speckling(?) (if error-diffusion is used).  
So ideally it should be able to have error diffusion differing (or a superior dithering algorithm if it is available) as well as being able to have no dithering.  
Ideally it should be free and also include source code but that isn’t a major priority.  
It should also choose colours based on our visual limitations… e.g. it should have a higher weighting for brightness than it does for hue. And it could place a lower weighting on colours we can’t distinguish between very well - e.g. blackish colours.  
Basically I am just concerned with optimizing the file-size… the speed of the program is completely irrelevant.  
Thanks.

---

<div class="post-metadata">

**Author:** ![tcburnett](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@tcburnett](https://boards.straightdope.com/u/tcburnett)\
**Post date:** [August 3, 2002, 6:56pm UTC](https://boards.straightdope.com/t/whats-the-best-palette-reduction-program-source-code/122171/2 "2002-08-03T18:56:10Z")

</div>

Frame differencing provides absolute minimum data rates; HVS (human visual system) fixed palette reduction algorithm provides excellent quality.

[www.simtel.net/pub/pd/3543.html](http://www.simtel.net/pub/pd/3543.html)

[www.digfrontiers.com/animDocs/Reduce.html](http://www.digfrontiers.com/animDocs/Reduce.html)

hyperarchive.lcs.mit.edu/HyperArchive/Abstracts/gst/grf/hvs-animator-lite.hqx.txt
