<div dir="ltr"><div>Hi,<br><br></div>A long time ago I wrote this:<br><div><div><br> <a href="https://lists.freedesktop.org/archives/pixman/2012-July/002175.html">https://lists.freedesktop.org/archives/pixman/2012-July/002175.html</a><br><br></div><div>about how dithering could be added to pixman. The basic idea is that "dithering" is a property of the destination image, not of the gradient. I still think this is the right way to do it.<br><br><br></div><div>Søren<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 26, 2018 at 6:37 PM, Marc Jeanmougin <span dir="ltr"><<a href="mailto:marc@jeanmougin.fr" target="_blank">marc@jeanmougin.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm Marc, I'm an Inkscape contributor, and I would like to improve<br>
pixman by providing a patch to allow gradient dithering, to eliminate<br>
all gradient banding. This "banding" problem is hugely visible in many<br>
Inkscape files, and I hope you could help me putting it into pixman,<br>
then in exposing the functionality into cairo.<br>
<br>
I tried to very closely follow the existing code style, and I came up<br>
with the proof of concept (attached Proof_of_concept.patch ), which<br>
applies to pixman/master to enable the feature directly.<br>
<br>
Since Inkscape also uses pixman to render files when exporting to png,<br>
and that kind of dithering affects very significantly the file size (PNG<br>
compression algorithm and randomness don't mix well) we also need a<br>
switch to enable/disable it "at will".<br>
<br>
I tried to understand how it could be done by looking at<br>
pixman_image_set_* functions and finally came up with the other patch<br>
attached 0001-Adds-a-gradient-<wbr>dithering-function-to-pixman.<wbr>patch (which<br>
cannot directly be tested, since it would require changes in cairo to<br>
call pixman_image_set_dithering, but changing "gradient->dithering =<br>
PIXMAN_DITHERING_NONE;" to _BEST in pixman-image.c works)<br>
<br>
Thanks for any help in merging this, or any pointer to how to improve it,<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Marc<br>
</font></span><br>______________________________<wbr>_________________<br>
Pixman mailing list<br>
<a href="mailto:Pixman@lists.freedesktop.org">Pixman@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/pixman" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/pixman</a><br>
<br></blockquote></div><br></div>