Mobile app version of vmapp.org
Login or Join
Sherry646

: Linear color modification in photo and video editing I have a specific, rather obvious method of modify colors in an image in my mind, but can't find the tools in common graphic programs such

@Sherry646

Posted in: #Color

I have a specific, rather obvious method of modify colors in an image in my mind, but can't find the tools in common graphic programs such as Gimp or Photoshop to do it with.

Color space can be thought of as a three-dimensional vector space, with one natural base being red, green and blue.

For each pair of color triplets there is exactly one linear map from the first triplet to the second triplet of colors. (If the color triplets consist of colors with distinct hues anyway.)

Now I'd like to have that linear transformation, defined by those six colors, applied to each pixel in my image.

Can Gimp, Photoshop or any other known tool do that?

Is there a common buzzword for that kind of operation?

PS: For the benefit of others, Joojaas answer can also be implemented in Gimp by doing:


Colors -> Components -> Decompose
Image -> Mode -> RGB
Then arrange add the multiplication layers like Joojaa described so that it looks like this:
Change the solid color layer type to multiply and the group ones to addition.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sherry646

1 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel278

You can do this, its just not commonly done and has no builtin function for this in Photoshop or after effects at least in the gui*. Though in general color is not like a vector space and color is not stored linear (doing linear transformation on nonlinear data is a bit problematic, so first turn data linear). Also note that image editors are not floating point calculators. But yes obviously you can treat any data as a liner vector space.

Edity:

You can build a matrix transform if you wish. What you need to work on is the raw channel data. Do this in Photoshop mostly this works in any other app as well.


Duplicate layer 3 times, name the layer RED, GREEN and BLUE.


For each layer copy the respective channel to all other channels

For each channel make a Color fill layer and multiply the channel by that has the new basis that you want as a color.





Change the multiply layers to match your matrix, so if you had matrix:

1 0 0

0 0.5 0.5

0 0.75 0.5

Then enter values 255 0 0 for the red mask and 0 128 128 for green mask and 0 191 128 for blue mask. Now before you do this if you want the transform to be sane make sure you use a linear working space. And thsi is what you get:




If you need to be able to use negative values then you need to use channel mixer 3 times. Or 6 layers...

A more exotic transom could be [0 0 1 1 0 0 0 1 0] or swapping of channels:



Oh and image is from Public Domain Pictures

* color profiles have this tool. But how to construct one that is a question for stack exchange or computer graphics.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme