<p>As it turned out, the premultiplied color data was <a href="https://en.wikipedia.org/wiki/SRGB#Specification_of_the_transformation" rel="nofollow noreferrer">transformed</a> to sRGB. Alpha stays linear. In that case, a component can be greater than the alpha. For example, with alpha 0.5 and color 1.0, the premultiplied value (0.5) is fed to the <code>forward transformation (CIE XYZ to sRGB)</code> formula that returns ~0.74.</p>

CC BY-SA 4.0
2021-06-08T17:07:40.360Z
2021-06-08T17:07:40.360Z
nikitablack
<p>Afaik, in alpha premultiplied color the components stored so:</p>
<pre><code>[r * a, g * a, b * a, a]
</code></pre>
<p>So the fully opaque white color is:</p>
<pre><code>[1 * 1, 1 * 1, 1 * 1, 1] = [1, 1, 1, 1]
</code></pre>
<p>Fully transparent white color is:</p>
<pre><code>[1 * 0, 1 * 0, 1 * 0, 0] = [0, 0, 0, 0]
</code></pre>
<p>Half transparent white color is:</p>
<pre><code>[1 * 0.5, 1 * 0.5, 1 * 0.5, 0.5] = [0.5, 0.5, 0.5, 0.5]
</code></pre>
<p>So I can't see a color channel that can be greater than the alpha. I'm asking because I have rendering artifacts and the library I'm using claims that textures stored as <code>textures as sRGBA premultiplied pixels</code> though I see values like</p>
<pre><code>[0.4784314, 0.4784314, 0.4784314, 0.19607845]
</code></pre>

CC BY-SA 4.0
2021-06-02T21:05:08.660Z
This is true only if you insist 1 is the biggest color value.
joojaa
CC BY-SA 4.0
2021-06-03T07:54:21.460Z
@joojaa But sRGB assumes that, right?
nikitablack
CC BY-SA 4.0
2021-06-03T07:58:56.330Z
yes because thst the device maximum, but then sRGB makes alot of assumptions that make no sense. In reality you really you should not do any computation in device space anyway. You should do this is some other space that is atleast computationally linear then convert than into sRGB. Why? Multiplication does not male any sense in a nonlinear space.
joojaa
CC BY-SA 4.0
2021-06-03T12:46:54.723Z
Agree with joojaa -- premultiplied sRGB is a *stupid* idea but unfortunately was included in a certain graphics standard: https://twitter.com/Simon_Fe1/status/1336357963821420544
Simon F
CC BY-SA 4.0
2021-06-08T14:23:57.407Z
It sounds like this post is referring specifically to pre-multiplied alpha, and there are times when pre-multiplied alpha does make sense. But I also agree with joojaa, check your assumptions as it is possible to get non-sense values when those assumptions are broken. Here is a link supporting the use of pre-multiplied alpha: https://blog.demofox.org/2015/06/19/what-is-pre-multiplied-alpha-and-why-does-it-matter/
pmw1234
<alpha>
In alpha premultiplied sRGB a color component can't be greater than the alpha, right?
nikitablack
# In alpha premultiplied sRGB a color component can't be greater than the alpha, right?

(Asked by: username_0 on 2021-06-02)

Afaik, in alpha premultiplied color the components stored so:

```
[r * a, g * a, b * a, a]

```

So the fully opaque white color is:

```
[1 * 1, 1 * 1, 1 * 1, 1] = [1, 1, 1, 1]

```

Fully transparent white color is:

```
[1 * 0, 1 * 0, 1 * 0, 0] = [0, 0, 0, 0]

```

Half transparent white color is:

```
[1 * 0.5, 1 * 0.5, 1 * 0.5, 0.5] = [0.5, 0.5, 0.5, 0.5]

```

So I can't see a color channel that can be greater than the alpha. I'm asking because I have rendering artifacts and the library I'm using claims that textures stored as `textures as sRGBA premultiplied pixels` though I see values like

```
[0.4784314, 0.4784314, 0.4784314, 0.19607845]

```

**Tags:** alpha

> **Comments:**
> **username_1**: This is true only if you insist 1 is the biggest color value.  
> **username_0**: @username_1 But sRGB assumes that, right?  
> **username_1**: yes because thst the device maximum, but then sRGB makes alot of assumptions that make no sense. In reality you really you should not do any computation in device space anyway. You should do this is some other space that is atleast computationally linear then convert than into sRGB. Why? Multiplication does not male any sense in a nonlinear space.  
> **username_2**: Agree with username_1 -- premultiplied sRGB is a *stupid* idea but unfortunately was included in a certain graphics standard: https://twitter.com/Simon_Fe1/status/1336357963821420544  
> **username_3**: It sounds like this post is referring specifically to pre-multiplied alpha, and there are times when pre-multiplied alpha does make sense. But I also agree with username_1, check your assumptions as it is possible to get non-sense values when those assumptions are broken. Here is a link supporting the use of pre-multiplied alpha: https://blog.demofox.org/2015/06/19/what-is-pre-multiplied-alpha-and-why-does-it-matter/  

---

## 1 answers

### Answer by username_0 on 2021-06-08. Score: 1 | Accepted answer

As it turned out, the premultiplied color data was [transformed](https://en.wikipedia.org/wiki/SRGB#Specification_of_the_transformation) to sRGB. Alpha stays linear. In that case, a component can be greater than the alpha. For example, with alpha 0.5 and color 1.0, the premultiplied value (0.5) is fed to the `forward transformation (CIE XYZ to sRGB)` formula that returns ~0.74.


---

