I have a png (items.png) which consists of mostly black pixels.

I want to replace all the black pixels with another image. (background.png)

The images are not the same size, items.png is smaller than background.png.

Is there an ImageMagick command that does something like this?


1 Answer 1


Wow I should have read the man page for convert more thoroughly.

The answer is

convert -flatten background.png items.png out.png

Your Answer

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

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