colorsphotoshoptransparentpsdcolor-blending

Does Photoshop always blends transparen images with white color?


It looks like merged-image-data in PSD files contains RGB data which is blended with white color (based on transparency). Is that correct for all versions of Photoshop/PSD? Can I disable it or control that color?

The context: I'm reading PSD file using C++ code (although no coding knowledge is necessary to answer the question I believe). PSD files contain merged data of all layers in "Image Data Section" (RGB, transparency (if any) and then alpha masks). From my experience it looks like that RGB data is premultiplied with White color based on transparency. This causes problems when you want to blend that RGB with something based on transparency (think: I used that data as a texture in game engine). I attached image illustrating the problem. The top image is source in PhotoShop. The bottom left shows RGB in merged data - see transparent image parts are blended with white. My goal is to get RGB data from all layers without that white-blend, i.e. image on the bottom-right (only fully transparent parts are filled with white color).

enter image description here

Simply open transparent PSD file in any tool that ignores layers (IrfanView for example) and you will see that image is premultiplied with white.

Formats like PNG support color in transparent image parts - no blending with white (or other color) is done.

So my question: do I have any control over that blend-with-white? Do all PhotoShop version do that?


Solution

  • You have no control over this. Photoshop always merges layers with white color.

    What we ended up doing is subtracting that while color based on alpha value during import of PSD file into our engine.