[Pixman] [patch] Gradient dithering into pixman
Marc Jeanmougin
marc at jeanmougin.fr
Mon Mar 26 22:37:49 UTC 2018
Hi,
I'm Marc, I'm an Inkscape contributor, and I would like to improve
pixman by providing a patch to allow gradient dithering, to eliminate
all gradient banding. This "banding" problem is hugely visible in many
Inkscape files, and I hope you could help me putting it into pixman,
then in exposing the functionality into cairo.
I tried to very closely follow the existing code style, and I came up
with the proof of concept (attached Proof_of_concept.patch ), which
applies to pixman/master to enable the feature directly.
Since Inkscape also uses pixman to render files when exporting to png,
and that kind of dithering affects very significantly the file size (PNG
compression algorithm and randomness don't mix well) we also need a
switch to enable/disable it "at will".
I tried to understand how it could be done by looking at
pixman_image_set_* functions and finally came up with the other patch
attached 0001-Adds-a-gradient-dithering-function-to-pixman.patch (which
cannot directly be tested, since it would require changes in cairo to
call pixman_image_set_dithering, but changing "gradient->dithering =
PIXMAN_DITHERING_NONE;" to _BEST in pixman-image.c works)
Thanks for any help in merging this, or any pointer to how to improve it,
--
Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Proof_of_concept.patch
Type: text/x-patch
Size: 5294 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20180327/f1aa3ec0/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Adds-a-gradient-dithering-function-to-pixman.patch
Type: text/x-patch
Size: 7469 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20180327/f1aa3ec0/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0xF882B07A.asc
Type: application/pgp-keys
Size: 19482 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20180327/f1aa3ec0/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20180327/f1aa3ec0/attachment-0001.sig>
More information about the Pixman
mailing list