freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coverage to alpha


From: Eric Muller
Subject: Re: coverage to alpha
Date: Wed, 9 Jun 2021 09:26:48 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Coverage == opacity (aka alpha). It is more than plausible, it
is justifiable.

And the justification is?

---

Consider a vertical stem, 3px wide. When the edges are aligned to the pixel grid, we have coverages [... 0 1 1 1 0 0...] along the x axis and that creates a certain perception of thickness. If we shift that stem progressively in x, we get coverages [... 0 c 1 1 (1-c) 0 ...]. Our goal is certainly to create the same perception of a stem, with the same 3px thickness. That is going to involve some kind of processing/interpretation by the visual system since the stimulus is different.

So 1: we cannot ignore our visual system when we implement text display systems.

Looking at White's illusion, it is clear that the same gray, depending on its context, is creating different color perceptions. (There are many other illusions, I just picked that one because its manifestation seems to be universal, it is rather brutal, and is a scale that does not involve pixels).

The Westheimer quote is also pointing out that our visual system is not trivial, and that time (learning) may also come into play.

It is also well known that using the same alpha map, white text on black background does not create the same perception as black text on white background.

So 2: our visual system works in counter intuitive ways.

I do not know why you are concerned, or how, or why you want to
compensate for this using coverage or alpha.

If we consider the typical rendering process as a whole:

- from outlines positioned and scaled on the pixel grid to a coverage map
- from a coverage map to a linear alpha map
- from a linear alpha map to pixels

it seems to me that by construction, i.e. by the definitions of coverage and linear alpha, the first and last steps are entirely mechanical.

So 3: in that process, the only place we can inject something to account for our visual system is when going from coverage to alpha.

FreeType prefers to stay out of it. We sell *coverage*. Take it or
leave it. Once bought, you can do whatever you want with it in the
context of your perception experiments :)

Sorry I engaged the wrong discussion list.

Eric.


On 6/8/21 1:27 PM, Alexei Podtelezhnikov wrote:
CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you can confirm the sender and know the 
content is safe.



On Tue, Jun 8, 2021 at 11:14 AM Eric Muller <emuller@amazon.com> wrote:
On the one hand, we have a coverage map, i.e. for each pixel how much of it is 
covered by the outline.

On the other hand, we are blending a foreground (text) color with a background 
color. So we need some alpha, and use it for a linear blending, in a linear 
colorspace.

What is not clear to me is how to go from coverage to alpha. Identity is 
plausible, but there are also reasons to believe it is not:

Coverage is a pixel proportion that draws the outline foreground
color: Coverage == opacity (aka alpha). It is more than plausible, it
is justifiable. It certainly helps to use gamma correction too so that
blending is linear.


- things like White's illusion show that the perception works in strange ways

I do not know why you are concerned, or how, or why you want to
compensate for this using coverage or alpha.


- "One usually begins by assuming that nothing is known about the object world and 
then the diffraction limit outlines the range of object details that an image transfer 
allows to be gained and, by exclusion, those that it leaves undetermined. On the other 
hand, it might be known ahead of time that the ensemble of possible objects is 
restricted. Then distinctions can be made by concentrating on the expected differences 
and disregarding image aspects that might have arisen from sources known beforehand to be 
absent." (Optical superresolution and visual hyperacuity, Westheimer), which can 
explain how readers can perceive gray pixels differently (i.e. expecting black and white, 
and therefore perceiving gray as width)

- may be the alpha should also depend on the foreground/background color

FreeType prefers to stay out of it. We sell *coverage*. Take it or
leave it. Once bought, you can do whatever you want with it in the
context of your perception experiments :)


- may be the alpha should also depend on the ppem.

Again, we sell coverage. It looks great as alpha with gamma correction.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]