Closed vntrungld closed 1 year ago
Can you show me what you tried? Although I have not tried this, you should be able to compose multiple images using something like sharp composite <image1> -- composite <image2>
.
Hi @vseventer, sorry for the late response The command I've tried is:
sharp -i background-min.png -o result-min.png -f png -- composite face-min.png --gravity southeast -- composite flower-min.png --gravity southeast
I tried to put face and flower on the background but the result only have flower and background. Look like the command only takes the latest composite image
Thanks for providing this - while Sharp allows compositing multiple images, the CLI is not passing the images in the right format.
Since this likely affects other operations too, I got to dig a bit deeper and figure out a pattern that works for all affected areas.
Fixed in #75 - hoping to complete that PR soon and release a new major version.
In your case, usage will be:
sharp -i background-min.png -o result-min.png -f png composite face-min.png flower-min.png --gravity southeast
Fixed in v4.0.0, now available.
How to composite multiple images by a single command? I'm making a PHP SDK for Sharp using this project so maybe we need a solution for composite multiple images like Imagick.