Re: [Gimp-developer] Floyd-Steinberg/GIF color optimization



Thank you, Mukund, ...

On Tue, Oct 21, 2014 at 10:47 AM, Mukund Sivaraman <muks banu com> wrote:

Hi Robert

On Tue, Oct 21, 2014 at 10:04:14AM -0500, Robert Hanson wrote:
http://chemapps.stolaf.edu/jmol/test/dither.htm .  The solution was to

This page seems to use JavaScript and WebGL, and so I'm not able to view
it. It would have been better if you had sent a link to static images of
the source and result.


It's not WebGL -- just HTML5. But that is a fine idea:
http://chemapps.stolaf.edu/jmol/test/dither2.htm



partition red, green, and blue channels into a 6 x 6 x 6 color space,
allowing 216 colors in total. Not perfect, but amazingly good, I think.

So you are doing FS dithering with a fixed uniform palette?


That sounds right. I'm not familiar with the lingo here. Equal partitions
along R G B coordinates.



The problem comes when I have a small molecule with not too many colors.
If
I go just over 256, then the FS algorithm cuts this down to something
like
64 colors. I'm wondering if I could get some advise as to how to
optimize a
set of colors down to 255 colors without undershooting in such a dramatic
way while still using FS.

You are looking for color quantization methods. You can find description
of an octree method in Graphics Gems I. GIMP uses median cut.

See https://www.cs.cmu.edu/~ph/ciq_thesis for Heckbert's thesis on
median cut.


That's helpful. So we have n colors, each with p_i pixels. This median cut
idea just
considers the n colors, not p_i, correct? (Ignores frequency?)

How is this then also implemented with Floyd-Steinberg dithering? Is the
idea that
the averages of the median cut boxes form our fixed points for the
dithering? That
a nearest-point calculation is done to generate the error function?

Can you point me to the place in the GIMP code this is accomplished?


Bob


-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Department of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]