Tom94 / tev

High dynamic range (HDR) image viewer for graphics people
BSD 3-Clause "New" or "Revised" License
1.03k stars 87 forks source link

Pixels with RGB>0 and A=0 are still displayed #101

Closed bathal1 closed 4 years ago

bathal1 commented 4 years ago

Hi Thomas, Opening the attached EXR file leads to an odd behavior in tev. The file contains pixels with non-zero RGB components and a zero alpha. Opening them in Photoshop or Gimp displays these pixels as fully transparent, while in tev these are partially visible. This behavior was observed using tev 1.16dev on a Ubuntu 18.04 machine.

EXR file: test.zip

Tom94 commented 4 years ago

Hi Baptise,

this behavior is intentional, as the RGB values of EXR images should be interpreted as having pre-multiplied alpha. Photoshop and Gimp are wrong.

For a practical use case, consider composing the image of a flame onto some background. The alpha channel of the flame corresponds to its opacity, whereas the RGB channels correspond to its emitted light. Since flames don't really absorb light, their opacity---i.e. alpha channel---should be (roughly) zero, while the RGB values should still be very bright. In this case, the flame should be displayed, despite its zero alpha value.

Check this example image of exactly the scenario I describe. The candle flame is meant to be visible despite its alpha value of zero.

See also the comment by Sami in issue #87 .

bathal1 commented 4 years ago

Alright, thanks for clarifying!