[Bf-committers] Preview Icon alpha

Sergey Sharybin sergey.vfx at gmail.com
Sun Apr 27 14:43:30 CEST 2014

We don't assume premultiplied images, we assume float buffers to be
premultiplied and byte buffers to be straight. For as long original PNG
wile is 8bit it should be stored with straight alpha.

Now, if the icon display happens wrong, it's most likely a misconfigured

Anyway, if display happens wrong, it's not up to data_to_c conversion(),
but up to how icons are handled. data_to_c conversion should preserve file
as-is in the memory.

On Sat, Apr 26, 2014 at 8:33 PM, Antony Riakiotakis <kalast at gmail.com>wrote:

> Hi,
> I am in the process of updating the paint brush icons [1] and I have been
> looking at the icon preview code, file interface_icons.c, function
> icon_draw_size.
> There are some caveats in the code:
> First, we assume premultiplied images, while the pngs used from our
> data_to_c conversions use straight alpha.
> The second thing is that it looks as if we do not enable blending for icon
> previews, which would be cool (new set of icons would work nice if used
> with transparency, for instance, as would custom brush icons, I
> understand).
> For the first issue I can convert the images to premultiplied space
> externally but then other png's might bite us similarly. Maybe the best
> would be to premultiply during data_to_c conversion? For the second issue,
> I'm not sure if enabling blending could bite us in other icon rendering
> cases.
> Thoughts?
> [1] https://developer.blender.org/T37960
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

With best regards, Sergey Sharybin

More information about the Bf-committers mailing list