[magick-developers] about ImageMagick's dithering on a Hilbert-Peano curve
Sam Hocevar
sam at zoy.org
Thu Aug 7 08:50:32 PDT 2008
On Thu, Aug 07, 2008, duc.sequere.aut.de.via.decede at imagemagick.org wrote:
> > Is there a way to convince the team to use something else as the default
> > dithering method?
>
> The most effective way to convince us is to contribute a better method as
> a patch against the existing source base. We are standing by awaiting your
> contributions.
Fair enough. But I would be more interested in discussing the
respective qualities of different methods first, and coding stuff
afterwards. Your "show the code first" attitude sucks, scares people
away, and only favours average solutions provided by the fastest coder
(which might in fact be what you are looking for).
Anyway, attached is a serpentine Floyd-Steinberg implementation. I'll
leave it up to you to decide about the quality, but at least it's 200
lines shorter.
I believe there are many other problems with the quantisation
method used in quantize.c. For instance, it does the clamping before
propagating the error, which helps stabilising the feedback loop but at
the expense of visual quality (which explains the large black or white
areas in dithered images). And there are stability issues anyway when
the quantiser is fed with colours that are not exactly within the convex
hull of the generated (or provided) palette. I can provide examples for
these issues, but I don't intend to touch quantize.c much more.
Cheers,
--
Sam.
More information about the Magick-developers
mailing list