I have two photos ( 1.jpg and 2.jpg) I want to make photo 2.jpg as a background and photo 1.jpg red colored overlay and I want the output to be like photo 3.jpg as follow ( I want to put photo number 1 on top of photo number 2 and make it transparent 50%):

Photo 1.jpg ( overlay) enter image description here

Photo 2.jpg ( background) enter image description here

Photo 3.jpg ( final output) enter image description here

I tried the commands convert and composite ( part of ImageMagick but following multiple attempts I failed to figure out the correct flags that I should use)

1 Answer 1


composite -blend 30 1.jpg 2.jpg res.jpg will do the job. I used your pictures and here is the result:


If you want to make opacity of first image more or less, you shoud modify -blend param from 0 to 100 (with -blend 0 your 1.jpg will be transparent, so result will be same as original 2.jpg. with -blend 100 result will be same as 1.jpg. so with -blend 50 you will get average opacity of both images)

composite -blend {{OPACITY_OF_1.JPG}} 1.jpg 2.jpg result.jpg

  • 1
    Thanks a lot!! You are awesome! Kindly is it possible to change the overlay color?
    – user88036
    Nov 17, 2015 at 16:40
  • 2
    @goro, yes, you can do this. convert 2.jpg 1.jpg -compose blend -define compose:args=30 -composite -set option:modulate:colorspace hsb -modulate 100,100,{{HUE_ROTATION_ANGLE}} result.jpg. "The hue argument causes a "rotation" of the colors within the image by the amount specified. For example, 50 results in a counter-clockwise rotation of 90, mapping red shades to purple, and so on..." Learn more here: imagemagick.org/script/command-line-options.php#modulate Nov 18, 2015 at 10:43
  • 1
    I wanted to overlap two png images, composite without -blend option worked.
    – Shayan
    Sep 23, 2019 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy