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?
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.)