Reputation: 199
Is there a way to add 5 or any number of white/transparent pixels at the top and left borders of an image with the magick command in Linux?
Upvotes: 2
Views: 750
Reputation: 208077
Use the -splice operator. First make a solid magenta rectangle:
magick -size 100x50 xc:magenta image.png
Now splice on a yellow chunk (so you can see it) 10 wide and 20 tall:
magick image.png -background yellow -gravity northwest -splice 10x20 result.png
Change yellow
to none
for transparent pixels.
Change magick
to convert
for v6 ImageMagick.
If you just want to splice to the East side:
magick image.png -background yellow -gravity east -splice 10x east.png
If you just want to splice to the South side:
magick image.png -background yellow -gravity south -splice x10 south.png
Upvotes: 4