Appending Image with a 10px width in between.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
vijayamaladoss

Appending Image with a 10px width in between.

Post by vijayamaladoss »

I have a requirement where I want to stitch images of same height and width (100x100). I want add a space or whitebackground of 10px width (preferably white) between each and every images.

I understand that I can manually create a image of 10x100 of whitebanner and stiching it with each every image at the end using convert +append option.

But is there is any option to do this automatically.

Thanks a lot.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Appending Image with a 10px width in between.

Post by fmw42 »

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Appending Image with a 10px width in between.

Post by anthony »

No problemo!!! use -splice

Splice a 10 pixel edge to each image, then remove the first edge after appending..

Code: Select all

   convert ...read_images... \
                -background white -splice 10x0+0+0  +append -chop 10x0+0+0 \
               result.png
Actually if you us 10x10+0+0 for -splice or -chop the direction of the append does not matter!
NOTE watch out for the effects of a -gravity setting on all THREE operators.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
vijayamaladoss

Re: Appending Image with a 10px width in between.

Post by vijayamaladoss »

Thanks a lot :D :D . Splice and Chop worked like a Charm, though I didn't try montage.

Once again thanks a lot :)
Post Reply