Cairo Antialiasing Outline Issue?

Bandi-T bandit at surfnonstop.com
Sun Apr 21 03:38:52 UTC 2024


As far as I know Cairo (and/or the underlying pixman library) does not 
currently work (antialias) in linear light, but instead works directly 
with (blends) the gamma-companded RGB values; this is know to cause such 
color artifacts, very clearly demonstrated here: 
https://pixls.us/articles/users-guide-to-high-bit-depth-gimp-2-9-2-part-2/

Two workarounds I can suggest is either have your colors and shapes 
rendered by a GPU (most GPUs today work in liear light and can do such 
compositions correctly), or have cairo render things at a multiple of 
the size you need (e.g. 64×64 size) and then develop a downsampling 
routine that computes in linear light (and only gamma-compands the final 
values upon output).

A third "workaround" (it is not a real workaround, because it is the 
solution itself) is: enhance pixman/cairo itself to do blending in 
linear light.

2024. 04. 20. 18:38 keltezéssel, Richard Rosenman írta:
> Hi there;
> I am using Cairo within After Effects for development using the After 
> Effects SDK.
> However, I am getting a strange faint halo around my fill / stroke 
> antialiasing. Can you see the faint greenish outline within the yellow:
> image.png
> If I disable antialiasing, it disappears but of course we need 
> antialiasing.
> Do you have any ideas why this is happening and how I could fix it?
> Thanks,
> -Richard
> /*Richard Rosenman // *//Creative Director/
> /Hatch Studios Ltd. // //1.416.565.6609/
> /richard at hatchstudios.com <mailto:richard at hatchstudios.com>/
> /http://hatchstudios.com <http://hatchstudios.com>/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20240421/a45c8fe2/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 9497 bytes
Desc: not available
URL: <https://lists.cairographics.org/archives/cairo/attachments/20240421/a45c8fe2/attachment-0001.png>


More information about the cairo mailing list