~eliasnaur/gio

1

artifact due to alpha blending

Christophe Meessen
Details
Message ID
<f86ca1c5-16e6-90f6-9a37-fc3fe0a7ac81@cppm.in2p3.fr>
DKIM signature
missing
Download raw message
Hello,

My testGioGamma program displayed vertical white line artifacts when the 
window was resized. The artifact appeared at the right and left side of 
filled rectangles when the boundary didn’t exactly match the pixel 
boundary. I mistakenly assumed that is was due to incorrect 
anti-aliasing gamma correction. It is due to blending with the alpha 
channel. When a pixel is covered by multiple shapes, the color can vary 
a lot by the way the shapes are covering the pixel. The simple alpha 
channel value of each shape for the pixel can’t help with that. I hope 
I’m correct this time.

It seam that to compute the correct color of a pixel, a more extensive 
analytical computation is needed. Is this done by the piet-gpu library ? 
It would be very impressive if it does and a significant improvement. I 
hope Gio can benefit from it and that Gio remains usable for low end 
graphical cards. To me, solving that kind of problem is enough to 
justify the use of GPU for 2D image rendering.

-- 
Bien cordialement,
Ch.Meessen
Details
Message ID
<CB1QZ1OAZUC8.1ONVMHFLU98EK@testmac>
In-Reply-To
<f86ca1c5-16e6-90f6-9a37-fc3fe0a7ac81@cppm.in2p3.fr> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On Fri Apr 30, 2021 at 15:53 CEST, Christophe Meessen wrote:
> Hello,
>
> My testGioGamma program displayed vertical white line artifacts when the 
> window was resized. The artifact appeared at the right and left side of 
> filled rectangles when the boundary didn’t exactly match the pixel 
> boundary. I mistakenly assumed that is was due to incorrect 
> anti-aliasing gamma correction. It is due to blending with the alpha 
> channel. When a pixel is covered by multiple shapes, the color can vary 
> a lot by the way the shapes are covering the pixel. The simple alpha 
> channel value of each shape for the pixel can’t help with that. I hope 
> I’m correct this time.
>
> It seam that to compute the correct color of a pixel, a more extensive 
> analytical computation is needed. Is this done by the piet-gpu library ? 
> It would be very impressive if it does and a significant improvement. I 
> hope Gio can benefit from it and that Gio remains usable for low end 
> graphical cards. To me, solving that kind of problem is enough to 
> justify the use of GPU for 2D image rendering.
>

I believe you're referring to conflation artifacts, which appear when
multiple shapes overlap in a single pixel. You're correct that simple
alpha blending does not arrive at correct pixel values in that case.

It is a goal of piet-gpu to fix conflation artifacts, at least the
artifacts that occur within the same path. See [0]. I believe [1] is an
attempt to solve the artifacts by supersampling.

Elias

[0] https://github.com/linebender/piet-gpu/issues/49
[1] https://github.com/linebender/piet-gpu/pull/64
Reply to thread Export thread (mbox)