<div dir="ltr">How difficult is it to just make the gradients use dithering, so they produce 8-bit (or whatever) results directly but with the dithering pattern in them?<div><br></div><div>What other operations would need dithering (a large blur comes to mind, also zooming way in on an image in bilinear)?</div><div><br></div><div>I think the blue noise large pattern is a great idea. Could have used that years ago in Nuke (it uses error diffusion but people always complained that the pattern did not reproduce when tiny changes were made to the image).</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 3:01 PM Basile Clement <<a href="mailto:basile-pixman@clement.pm">basile-pixman@clement.pm</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I forgot to mention two things:<br>
<br>
- Enabling dithering makes processing much slower, since it forces the<br>
wide pipeline to be used (and some optimisations are disabled). This<br>
could be solved through the use of fast paths where needed (e.g. when<br>
blitting images from an equal or lower bits-per-pixels format, or with<br>
fused gradient+dithering paths). In any case, the design of the<br>
implementation allows setting the `dither` property of a destination<br>
image in between calls to `pixman_image_composite` where dithering is<br>
required, allowing users to pay the cost of the slower wide pipeline<br>
only for those calls where dithering is actually required.<br>
<br>
- The dithering is not gamma corrected, which doesn't matter much for<br>
8bpp formats -- but makes a noticeable difference for lower bpp formats,<br>
producing images which are way too luminous (this is particularily<br>
visible in the dithering demos when using 2bpp and 1bpp formats). Since<br>
the main use case for now is a8r8g8b8 gradient export in Inkscape (and<br>
since the series is starting to be a bit large), I did not include gamma<br>
correction in this series. If needed, it can be added in subsequent<br>
patches, and should probably be configurable since the proper curve to<br>
use depend on the characteristic of the target device, which pixman may<br>
not know about.<br>
<br>
- Basile<br>
<br>
On 4/9/19 11:29 PM, <a href="mailto:basile-pixman@clement.pm" target="_blank">basile-pixman@clement.pm</a> wrote:<br>
> I am resubmitting for review and inclusion my series of patches on<br>
> dithering from October, which I ended up not having the time to finish<br>
> then. There are only a couple changes to make the patches compatible<br>
> with the recently added floating point formats, and I have also added a<br>
> dithering matrix based on blue noise which provides more pleasant<br>
> results than the Bayer matrix from the first series.<br>
><br>
> Maarten, I would appreciate if you can take a second look (although as<br>
> noted above not much has changed since your first review -- I don't<br>
> think you had comments on the dithering part?).<br>
><br>
> - Basile<br>
><br>
><br>
> _______________________________________________<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/mailman/listinfo/pixman</a><br>
<br>
_______________________________________________<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/mailman/listinfo/pixman</a></blockquote></div>