Rendering transparent UI in Linear Color Space

Hey everyone,

as you may know, Unity can have issues correctly rendering transparent 2D Sprites/Textures exported from Photoshop or Figma. Reason being that most of these tools operate in Gamma color space while Unity uses Linear color space.

I know that it’s possible to switch to Gamma but for our project at least, that’s not option.
Photoshop can be set up to display in linear color space as well but as we’re using Figma to create our UIs, working around that issue on the Artist side is therefore not possible either.

In Unity there are a few workarounds, the one I find the most elegant is this one by Ming Wai Chan. She adds an extra UI camera and translates the UI to Gamma space.

The problem is, she did that almost 5 years ago in Unity 2019 and URP version 7.2.0+ :sweat_smile:
We’re using URP 14.0.11 in Unity 2022.3.34 and no matter what I try, I can’t get it to work. Last try my PC crashed because of memory issues…

Maybe you guys have some Feedback or another, maybe better, approach for the Linera Color Space Texture issue. Appreciate y’all.

UPDATE: Still not solved. Tried the second camera approach in a new, empty project but to no avail. Could be a user error though because I had to adjust some parts of the Render Feature script because it was deprecated. Here’s the current state (no worries, your PC won’t crash anymore hehe): https://pastebin.com/qYkBCFkB

Changed Color Profiles in Figma to Display P3, no change.

Found a setting on the Unity Canvas component called “VertexColorAlwaysInGamma”. Sound promising, right? No change.

And tried all import settings of the texture, even tried setting all pixels to linear in a PostProcessor script.

The only thing I can say for sure is that Unity renders the Texture differently than Figma and Photoshop. Loading the file into Photoshop looks right. Here’s a comparions between Unity and Figma:

And a link to the above source file if somebody wants to try it first-hand: EvilGammaFile.png - Google Drive

Hey there. Did you eventually find out a way out of this? It’s also driving us nuts, we built a whole project in Linear which was recommended, lighting, materials etc, then some colored transparent UI elements came along and we had the same issue as you. There was no time to redo all the lighting and materials that switching to Gamma would require, we created a custom sprite shader which kind of offset the gamma but it was barely a band-aid. There has to be a better way… Maybe an image converter to change things from the image file side? :cry:

edit: Oh it seems our friend Ming Wai Chan has updated their solution in 2025. We will check it out…

Hey, I got help on the Game Dev Stack Exchange.

That solution worked well for us :slight_smile: