Jump to content

Talk:Alpha compositing

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Premultiplication and Gamma

[edit]

In their edit of 19:23, 3 March 2021, Ybungalobill added this statement:

"When combined with premultiplied alpha, premultiplication is done in linear space, prior to gamma compression."

with a reference to "Gamma Correction vs. Premultiplied Pixels" at https://ssp.impulsetrain.com/gamma-premult.html .

This does not agree with my experience, and I don't believe that the cited web page supports it. In fact the second paragraph of the web page says that "It is common for graphics software to ... store pixels in this format:" and then shows premultiplication done on the exponential value. Towards the bottom of the page the scheme where premultiplication is done on the linear value is described, and I think the author is telling us that this is what we should do. With the possible exception of GPU sRGB textures, however, I do not believe that it is what is actually done in practice. For example, I have today been looking at both libtiff and libjxl and both of those seem to do (un-)premultiplication on the sRGB values, not the linear values.

I am tempted to edit this. I think retaining the link is a good idea because the page does accurately describe the problem, but unless I'm mistaken I think Ybungalobill was wrong to infer from the linked page that that is what is "done" in practice. Maybe it should simply say "should be done"? — Preceding unsigned comment added by 86.179.89.233 (talk) 16:01, 13 October 2024 (UTC)[reply]

GIF, BMP

[edit]

"GIF supports alpha channels". This claim should have a reference. No software I know of allows to save an alpha channel into GIF. This format only has a single color transparency where a palette color can completely transparent. It is possible to overlay another layer on a GIF to extend the palette, but the top layer again can only be completely opaque or transparent. This mode is almost never referred to as alpha. I think the remark about effiency needs to go. Especially in a list next to TIFF.

"The file format BMP generally does not support this channel". Perhaps it more correct to say that some or most [quantify?] software doesn't support this. The primary use for the BMP format is within Microsoft Windows GUI. It supports transparent bitmaps in dialogs like an About box since Windows 2000 or XP (unsure which). You can have a 32-bit bitmap fade to any window color (with the side effect of a memory leak).

TARGA is one of the oldest commonly used formats with true alpha (not just 1-bit), predating PNG and BMP. -- J7n (talk) 16:53, 6 May 2024 (UTC)[reply]