Mobile app version of vmapp.org
Login or Join
Gail6891361

: Replicate curves adjustment in Photoshop I edited an image with a curves adjustment on all the channels (RGB, red, green and blue). Now I want to know how those curves looked like, so I can

@Gail6891361

Posted in: #PhotoEditing

I edited an image with a curves adjustment on all the channels (RGB, red, green and blue). Now I want to know how those curves looked like, so I can use them again/edit them. But I made this edit a long time ago so I dont remember.

I have tried simply copying the original edit and managed to get it pretty similar. But not similar enough. The curves were very complex and that together with that I used all 4 channels, makes it very hard to get right.

I thought I had cracked it when I tried to split up the image in its red, green and blue channels. My idea was that it would be easier to copy if I focused on doing one channel at a time in black and white. Then I could save them as preset in Photoshop, and apply them combined to the original. But Ive just spent more than 2 hours getting not close enough on the red channel.

Im not very knowledgeable with curves. Do anyone have an idea on how to pull this off in practice? Could it be possible to "reverse engineer" it somehow?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Gail6891361

2 Comments

Sorted by latest first Latest Oldest Best

 

@Kimberly620

Yes you can do this. However it really depends on many factors. First of you can just simply use some scientific plotting tool to plot each value in 2D where x is original value and y is new pictures value.

I am using mathematica for this, quick and dirty mathematica code looks as follows (but you could choose any other tool):

src = ColorSeparate[Import["c:temptest.png"]];
srcAdj = ColorSeparate[Import["c:temptestadj.png"]];
r = Flatten[ImageData [src[[1]]]];
r2 = Flatten[ImageData [srcAdj[[1]]]];
rtp = Transpose[{r, r2}];
g = Flatten[ImageData [src[[2]]]];
g2 = Flatten[ImageData [srcAdj[[2]]]];
gtp = Transpose[{g, g2}];
b = Flatten[ImageData [src[[3]]]];
b2 = Flatten[ImageData [srcAdj[[3]]]];
btp = Transpose[{b, b2}];
Show[ListPlot[rtp, AspectRatio -> 1, PlotStyle -> Red],
ListPlot[gtp, AspectRatio -> 1, PlotStyle -> Green],
ListPlot[btp, AspectRatio -> 1, PlotStyle -> Blue]]


So for test ive used following curves as the adjusted image (image used):



And mathematica gives me:



Which is pretty close, or possibly exactly the same value. Making a curves adjustment file out of this wouldn't be too hard*. However a word of warning! If your images are lossy, like jpeg compressed, then this will not work. Example with jpegs:



Now the plot points are all over the place and youd have to try to filter the data somehow. So the take here is that if the image has something other than just a curves adjustment then the thing just blows up.

* If the data was read in with the code above then the curves export is:

file = FileNameJoin[{ "C:temp", "out.amp"}];
BinaryWrite[
file, (SortBy[DeleteDuplicates[rtp], First] // Transpose //
Last) *255 // IntegerPart];
BinaryWrite[
file, (SortBy[DeleteDuplicates[gtp], First] // Transpose //
Last) *255 // IntegerPart];
BinaryWrite[
file, (SortBy[DeleteDuplicates[btp], First] // Transpose //
Last) *255 // IntegerPart];
Close[file];


the amp file can then be read to a photoshop curves layer for example. And it produces same image in my test case. The code is not really performace oriented but it works.

10% popularity Vote Up Vote Down


 

@Nimeshi706

If you'd have used a single curve per channel, and you have your input and output images, you could derive the curves back using some image processing.

But since you used both the RGB curve and the individual R, G and B curves, that is (I think) impossible (or exceedingly hard), since you won't be able to tell how much the RGB curve or the individual curves each contributed to the output.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme