<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>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:
<a class="moz-txt-link-freetext" href="https://pixls.us/articles/users-guide-to-high-bit-depth-gimp-2-9-2-part-2/">https://pixls.us/articles/users-guide-to-high-bit-depth-gimp-2-9-2-part-2/</a></p>
<p>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).</p>
<p>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.<br>
</p>
<div class="moz-cite-prefix">2024. 04. 20. 18:38 keltezéssel,
Richard Rosenman írta:<br>
</div>
<blockquote type="cite"
cite="mid:8FC032D5-5DCA-4D2B-824B-88774DC85183@richardrosenman.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi there;
<div dir="ltr">
<div class="default-style"> </div>
<div class="default-style"> I am using Cairo within After
Effects for development using the After Effects SDK. </div>
<div class="default-style"> </div>
<div class="default-style"> However, I am getting a strange
faint halo around my fill / stroke antialiasing. Can you see
the faint greenish outline within the yellow: </div>
<div class="default-style"> </div>
<div class="default-style"> <img class="aspect-ratio"
style="max-width: 100%;" alt="image.png"
src="cid:part1.Va0MPPkI.LVfnJPE7@surfnonstop.com"> </div>
<div class="default-style"> </div>
<div class="default-style"> If I disable antialiasing, it
disappears but of course we need antialiasing. </div>
<div class="default-style"> </div>
<div class="default-style"> Do you have any ideas why this is
happening and how I could fix it? </div>
<div class="default-style"> </div>
<div class="default-style"> Thanks, </div>
<div class="default-style"> -Richard </div>
<div class="default-style"> </div>
<div class="io-ox-signature">
<div class="default-style"> <span style="font-size: 10pt;"><em><strong>Richard
Rosenman <span style="color: #808080;">//</span> </strong></em></span><span
style="font-size: 9pt; color: #808080;"><em>Creative
Director</em></span> </div>
<div class="default-style"> <span style="font-size: 9pt;"><em><span
style="color: #808080;">Hatch Studios Ltd. // </span></em></span><span
style="font-size: 9pt;"><em><span
style="color: #808080;">1.416.565.6609</span></em></span>
</div>
<div class="default-style"> <em><a
href="mailto:richard@hatchstudios.com"
moz-do-not-send="true"><span style="font-size: 9pt;"><span
style="color: #0099ff;">richard@hatchstudios.com</span></span></a></em>
</div>
<div class="default-style"> <em><a
href="http://hatchstudios.com" moz-do-not-send="true"><span
style="font-size: 9pt;"><span
style="color: #0099ff;">http://hatchstudios.com</span></span></a></em>
</div>
</div>
</div>
</div>
</blockquote>
</body>
</html>