<div dir="ltr">I get it, the dithering is turned on/off with a Cairo control. I thought you were suggesting that it is turned off if the destination is an image.<div><br></div><div>Quick look at the patch and it seems like this will work, though it is a random dither. You might get much better compression of .png with a patterned dither. I've also had good luck with pseudo-error-diffusion. You keep in static memory an accumulated error (per color, but not really depending on the location of the pixel) and that is the threshold for the random number. This produces a bit more patterning than a straight random generator. You might also try it with no random number generator at all, but you have to preserve the accumulated error so that solid areas that are an integer don't reset it so each adjacent line gets the same pattern.</div><div><br></div><div>May want to call the "on" setting PIXMAN_DITHERING_GOOD. On the assumption that anybody who wants it on is happy with "good" dithering, and that they may not want to pay for the slowness of "best" dithering.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 27, 2018 at 2:20 AM, 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>
<span class=""><br>
Le 27/03/2018 à 02:04, Søren Sandmann a écrit :<br>
> A long time ago I wrote this:<br>
><br>
>     <a href="https://lists.freedesktop.org/archives/pixman/2012-July/002175.html" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>archives/pixman/2012-July/<wbr>002175.html</a><br>
><br>
> about how dithering could be added to pixman. The basic idea is that<br>
> "dithering" is a property of the destination image, not of the<br>
> gradient.  I still think this is the right way to do it.<br>
<br>
</span>Thank you for your input. Would it be possible to use your preferred way<br>
of doing it to my patch ?<br>
<span class=""><br>
Le 27/03/2018 à 03:47, Bill Spitzak a écrit :<br>
> I don't understand why you would want to disable it when writing .png<br>
> files. There will be banding in the .png file, which I would think is<br>
> worse than the increased size.<br>
</span>Depends. In many cases there is no visible banding, and some people may<br>
not want a x100 filesize increase for it (for files that are entirely<br>
made of gradients).<br>
<span class=""><br>
> Also kind of fools the user if they did not look at the .png file and<br>
> only at InkScape's display.<br>
</span>We already have such differences for filter quality, and of course it<br>
would be possible to switch it in the display windows for previewing.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Marc<br>
<br>
</font></span></blockquote></div><br></div>