freetype
[Top][All Lists]
Advanced

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

Re: [ft] How to draw FT_Bitmap to the ARGB image?


From: Wojciech Mamrak
Subject: Re: [ft] How to draw FT_Bitmap to the ARGB image?
Date: Thu, 5 Nov 2015 02:22:11 +0100

> Then why to compute Da from your equations? If the background, is opaque,
> then Da will always be 1.0 (255).

If I had not provided the equation, then you would have asked me why I
have not done this.

> What you mean here? I am using "normal alpha blending" in the images.

By this I mean SrcOver compositing operation, as described by e.g. SVG
specification [1].
And you are using here dual source blending [2], which is something
different than what is described in [1].

> Or you mean to use non-pre-multiplied alpha? I can, if it will help.

It does not matter.

> BTW, I tried to create some image with black text on transparent background
> with sub-pixel antialiasing and I was able to make it with LibreOffice Draw.
> See the attachment: BlackOnTransparent.png
>
> It is not the best quality, but at least does not appears as a black 
> rectangles.

That is interesting. It looks like it uses the sum of the three alpha
channels (times Ca of course) as Ca in the equation for Da. This
explains the distortions (glyphs are too thin). For this to work,
initial Da must be 1,1,1,0. Still, these imperfections are quite
substantial.


[1] http://www.w3.org/TR/SVGCompositing/
[2] https://www.opengl.org/wiki/Blending


2015-11-04 16:16 GMT+01:00 John Found <address@hidden>:
> On Wed, 4 Nov 2015 02:59:00 +0100
> Wojciech Mamrak <address@hidden> wrote:
>
>> I am afraid this is the property of dual source blending - your
>> background must be opaque. If you can't satisfy this condition your
>> only option is to store the three alpha channels obtained from FT and
>> blend them with background later, when it is opaque (and eventually it
>> will be),
>
> Then why to compute Da from your equations? If the background, is opaque,
> then Da will always be 1.0 (255).
>
>> or use normal alpha blending (one alpha channel).
>
> What you mean here? I am using "normal alpha blending" in the images.
> Or you mean to use non-pre-multiplied alpha? I can, if it will help.
>
> BTW, I tried to create some image with black text on transparent background
> with sub-pixel antialiasing and I was able to make it with LibreOffice Draw.
> See the attachment: BlackOnTransparent.png
>
> It is not the best quality, but at least does not appears as a black 
> rectangles.
>
>
> --
> http://fresh.flatassembler.net
> http://asm32.info
> John Found <address@hidden>



reply via email to

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