I have a photo of a paint tin and a list of images with reference colors for the color of the paint to be adjusted to.

How can this be done? Can it be automated to be done in batch?

paint can

  • \$\begingroup\$ It's unclear, at least to me, which way you are trying to match. Are you trying to change the other images to match the single image, or are you trying to produce multiple versions of the single image to match each of the multiple reference shots? Could you provide some examples? \$\endgroup\$
    – Michael C
    Commented Aug 28, 2018 at 16:33
  • \$\begingroup\$ I'm trying to produce multiple colored versions of the single image of the paint tin to match the reference colors! \$\endgroup\$
    – Konstantin
    Commented Aug 28, 2018 at 17:34
  • \$\begingroup\$ When you adjust the color, ALL pixels will get changed. What looks to you like a single color of paint is actually a continuum of colors “near” the paint color. What you are really looking to do, I believe, is mask an area, desaturate it to grayscale and then produce copies with the grayscale parts colorized in a variety of colors, while leaving the rest of the image alone. You might e able to do this with ImageMagick, but I don’t know for sure. It would help if you would post a sample image. \$\endgroup\$ Commented Aug 29, 2018 at 6:56
  • \$\begingroup\$ I added a sample picture of the colored paint in the tin to my post! So I basically need a round selection that is being colorized in the colors of the reference chart. I thought I might be able to do this with photoshop actions, but until now I haven't found a working solucion yet! \$\endgroup\$
    – Konstantin
    Commented Aug 29, 2018 at 13:35
  • \$\begingroup\$ What non working solutions have you found? Can you explain what you have tried? \$\endgroup\$ Commented Aug 29, 2018 at 17:01

1 Answer 1


What you want to do can be done with ImageMagick. You will need to use an image editor, such as Photoshop or GIMP, to create the following two images:

  • One to mask out the paint contained in the paint can.

  • Another to reproduce the shadows from the paint can onto the paint.

The image of the paint can, the paint mask, the shadows, and the color swatches can then be composed to produce a variation of the image with a different color. Use the image editor to figure out what order and blending modes to use for the layers.

Then you can call ImageMagick in a loop to reproduce the results for each of the desired color swatches. (See ImageMagick v6 Examples: Compositing Images.)


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.