<div dir="ltr">I don't understand why you would want to disable it when writing .png files. There will be banding in the .png file, which I would think is worse than the increased size. Also kind of fools the user if they did not look at the .png file and only at InkScape's display.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 26, 2018 at 5:04 PM, Søren Sandmann <span dir="ltr"><<a href="mailto:soren.sandmann@gmail.com" target="_blank">soren.sandmann@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">https://lists.freedesktop.org/<wbr>archives/pixman/2012-July/<wbr>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"><div><div class="h5">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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">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-dithering<wbr>-function-to-pixman.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="m_8222569394233684056HOEnZb"><font color="#888888"><br>
--<br>
Marc<br>
</font></span><br></div></div>______________________________<wbr>_________________<br>
Pixman mailing list<br>
<a href="mailto:Pixman@lists.freedesktop.org" target="_blank">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>
<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>