<p>Offset.</p>

<p>While any transform between two RGB colour spaces can be accomplished with a pure 3x3 matrix, some alternate transforms, such as to YCbCr with given weights, requires an offset.</p>

CC BY-SA 3.0
2016-12-27T17:04:22.813Z
2016-12-27T17:54:32.507Z
2016-12-27T17:54:32.507Z
troy_s
<p>I think your quote refers to conversion between color spaces, rather than color grading. 4d textures could be used as lookup tables to convert color spaces like CMYK to some other space. Since CMYK has 4 components, a 3d texture wouldn't be enough.</p>

CC BY-SA 3.0
2016-12-06T19:46:50.763Z
2016-12-06T19:46:50.763Z
wolle
<p>You can perform color conversion as a post process step to convert a rendered frame's colors to a different set of colors.</p>

<p>You might make darker colors more blue for instance, to give it a night time feel, or just modify colors to give it a different mood.</p>

<p>One way of doing this is using a volume texture.  You use the RGB value of a source pixel as texture coordinates into a volume texture, where you read out the RGB value that you should replace that pixel with.</p>

<p><a href="https://www.opengl.org/registry/specs/SGIS/texture4D.txt" rel="nofollow noreferrer">This</a> page on the 4d texture GL extension says this though:</p>

<blockquote>
  <p>Four-dimensional textures are used primarily as color lookup tables
  for color conversion.</p>
</blockquote>

<p>Can anyone explain why you would use a 4d texture lookup for color grading?</p>

<p>Alpha (transparency) lookup doesn't seem like a plausible explanation, but perhaps something like normalizing an HDR color and using the intensity as the fourth component could be?  Or perhaps time, to be able to interpolate between two different color gradings, when moving from inside to outside and exposure is changing or something?</p>

CC BY-SA 3.0
2016-12-07T17:08:09.090Z
You're idea of using one dimension at time is a pretty good one! I like it!
user1118321
<color>
Why would a 4d texture be used for color conversion?
Alan Wolfe
# Why would a 4d texture be used for color conversion?

(Asked by: username_0 on 2016-12-06)

You can perform color conversion as a post process step to convert a rendered frame's colors to a different set of colors.

You might make darker colors more blue for instance, to give it a night time feel, or just modify colors to give it a different mood.

One way of doing this is using a volume texture. You use the RGB value of a source pixel as texture coordinates into a volume texture, where you read out the RGB value that you should replace that pixel with.

[This](https://www.opengl.org/registry/specs/SGIS/texture4D.txt) page on the 4d texture GL extension says this though:

> Four-dimensional textures are used primarily as color lookup tables
> for color conversion.

Can anyone explain why you would use a 4d texture lookup for color grading?

Alpha (transparency) lookup doesn't seem like a plausible explanation, but perhaps something like normalizing an HDR color and using the intensity as the fourth component could be? Or perhaps time, to be able to interpolate between two different color gradings, when moving from inside to outside and exposure is changing or something?

**Tags:** color

> **Comments:**
> **username_1**: You're idea of using one dimension at time is a pretty good one! I like it!  

---

## 2 answers

### Answer by username_2 on 2016-12-27. Score: 3 | Accepted answer

Offset.

While any transform between two RGB colour spaces can be accomplished with a pure 3x3 matrix, some alternate transforms, such as to YCbCr with given weights, requires an offset.


---

### Answer by username_3 on 2016-12-06. Score: 5

I think your quote refers to conversion between color spaces, rather than color grading. 4d textures could be used as lookup tables to convert color spaces like CMYK to some other space. Since CMYK has 4 components, a 3d texture wouldn't be enough.


---

