I would like to extent an image using (for example) a red border using this command line:
convert input.png -gravity center -background red -extent 1000x1000 output.png
This works as long as the input.png does not contain any transparent regions. If it does these will also be replaced by the background color. I've read in the documentation that this is expected behaviour and the solution would be to remove the background color (which i cannot as i would like to have a colored border) or to use an alpha compositor (which i am not able to figure out the correct one).
How can i extend an image using an color but applying the color only to the extended area and not the original image itself?
Edit: According to the description of the compose parameter i think it should work with
-compose src-in
but it doesn't.
Aucun commentaire:
Enregistrer un commentaire