Merge two pngs via command line tool in windows?

2019-05-10 02:11发布

问题:

I'm looking for a tool I can use via command line (windows 7) to merge two equally sized pngs. I'm not having much luck with search so far as most tools I've seen are pretty heavy applications which don't seem to target simple manipulations.

I want to overwrite the bits in the opaque base image with the non-transparent pixels in the overlay image. I have photoshop CS4 as well, but haven't had much luck in finding the relevant command line arguments.

回答1:

ImageMagick has a command line tool called composite which will do what you want. Distributions available for Windows, Mac, Linux etc. I've just tested it with two transparent PNGs and works as expected.

composite foreground.png background.png newimage.png