Photoshop offers a feature called same color. It adjusts the colors of an image based on another.

Here is an example, these 2 pictures share different colors (one of them has an orange shade over it).

Image 1

Image 1

Image 2

Image 2

After using Photoshop‘s same color function the first image’s colors are adjusted like this: enter image description here

I wonder how you can achieve a similar effect using imagemagick/code or how this effect works in general. Photoshop is able to tell exactly which colors should be changed.

1 Answer 1


You could try to use histmatch script to accomplish this. Unfortunately the script is hard to get working on a windows machine without cygwin. I am not aware of any other example that would do the same thing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.