|
Author |
Message |
AmazingFactory
Joined: 30 Mar 2013
Posts: 5
|
Posted: Mon Apr 01, 2013 3:12 am Post subject: How to create gamma correct linear gradient |
|
|
If I create an sRGB 8 bpp image 256 pixels wide
and create a gradient from X = 0 (Black) to X = 255 (White)
The RGB value for the midpoint is shown as (128, 128, 128)
But for the gradient to be linear in reality (radiance) the midpoint should be (187, 187, 187)
If instead I create a linear gradient in 32 bpp mode (gamma 1.0)
and then convert to 8 bpp
It correctly sets the midpoint to (187, 187, 187)
Is there anyway to work in 8 bpp mode and have gamma corrected gradients? |
|
|
|
|
Auieos
Joined: 29 Jan 2010
Posts: 2019
|
Posted: Mon Apr 08, 2013 11:10 pm Post subject: |
|
|
The gradient is the same in 8 bit and 32 bit but 8 bit is gamma encoded, while 32 bit is always gamma 1.0 (linear light).
In 8bit mode go to Edit > Convert to profile > Custom RGB > Gamma (1.0) |
|
|
|
|
AmazingFactory
Joined: 30 Mar 2013
Posts: 5
|
Posted: Tue Apr 09, 2013 12:48 am Post subject: |
|
|
What I want is to work, as normal, with an 8 bit texture
but when I draw a gradient ... I can choose the gamma
Gradient with gamma has a midpoint at 187
Gradient without gamma has a midpoint at 128
In other words the code that draws the gradient should have a gamma correction option ...
Changing to Gamma (1.0 is destructive - it will damage my image.
Even in 32 bit mode it will slightly change things ... |
|
|
|
|
Auieos
Joined: 29 Jan 2010
Posts: 2019
|
Posted: Thu Apr 11, 2013 12:36 am Post subject: |
|
|
There is no option to choose the gamma of a gradient.
Maybe try a workaround such as opening 2 instances of your image, one in 8 bit, one in 32, and then duplicate your 32bit gradient layers back to your 8 bit canvas. It will convert them when they transfer over and leave your 8bit image unchanged. |
|
|
|
|
|