Page 1 of 1

Need to find RGB differences of 2 images

Posted: 2013-11-19T19:59:53-07:00
by holden
I don't think that title makes sense, but this is best explained visually. I have 2 images, an original and one that I made in Gimp using HSL and multiply. The problem is that the program that I am outputting in only has RGB sliders. Can IM tell me the difference in RGB values between two images?
Original
http://www.pasteall.org/pic/show.php?id=62852

Target
http://www.pasteall.org/pic/show.php?id=62853

Since this is a layered gimp file I can change the original to something easier to read for IM if that helps.

Thanks

Re: Need to find RGB differences of 2 images

Posted: 2013-11-19T20:52:45-07:00
by fmw42
You can separate channels and use IM compare to get a metric of the differences for each channel, such as rms. From that you can probably compute a channel multiply factor. But the real difference may not be linear.

Or you can separate channels and use -compose difference to get a visual difference between the two images. But I suspect you really want the slider values and IM has no way to tell what those sliders actually do.

By the way, the images that download are jpg.

If you want some way to convert from one to the other, you can use the HALD clut technique. You create in IM a hald image. Then take that to the system that modified the image and process it with the same settings used to modify the original image. Save as png. Then bring that back to IM and use -hald-clut to map the original into the processed version.

see
http://www.imagemagick.org/Usage/color_mods/#hald-clut

Re: Need to find RGB differences of 2 images

Posted: 2013-11-19T21:04:43-07:00
by snibgo
I'm not sure what you want. If you ...

Code: Select all

identify -verbose image.jpg
... you'll get loads of information, including the mean values for each of the Red, Green and Blue channels.
However, a simple transformation in HSL may not be a simple transformation in RGB. Did you modify all three of Hue, Saturaion and Lightness? Or just two?

I have a script somewhere that can calculate a HSL transformation from one colour to another, but I'm not sure if that will help.

Re: Need to find RGB differences of 2 images

Posted: 2013-11-20T06:03:48-07:00
by holden
What I did was to create a layer in Gimp above the original, tweaked the HSL of it, set it to multiply, and reduced the transparency. I've tried just manually tweaking rgb for quite some time, but I'm starting to think it isn't possible without the multiply effect. I will check the identify output when I get back to it and see if that will point me in the right direction.
By the way, the images that download are jpg.
I just meant that I could make a simpler test pattern, as opposed to the sprite graphics, if it would make any IM functions more accurate.

Re: Need to find RGB differences of 2 images

Posted: 2013-11-20T11:02:25-07:00
by fmw42
Are you asking for the IM equivalent to making a new layer, adjusting the HSL values and using -compose multiply? Or are you just trying to get the same HSL values? The latter would be very difficult if not impossible, in my estimation with such limited information.

Re: Need to find RGB differences of 2 images

Posted: 2013-11-20T11:15:39-07:00
by holden
Basically I'm trying to achieve the same color shift using only RGB adjustments, but I don't think it will happen, there simply is not enough control.

Re: Need to find RGB differences of 2 images

Posted: 2013-11-20T11:40:07-07:00
by snibgo
With Gimp you have converted to HSL, made some adjustments, and converted back to RGB. (I'll ignore the multiply.)

No simple adjustment in RGB can be made equivalent to this. You may be able to find an RGB adjustment that gives a similar result, but you need to know exactly what the sliders do. The obvious technique is to play with the sliders on the input file until the result looks like the output created by Gimp.