Hi all, I'm really struggling with this one... essentially I need to know the best (most efficient) command line way of doing this:
1) Increase the canvas size by a set amount or percentage
2) Vertically flip both the top and bottom sections of the original image to fill the top/bottom canvas area.
3) Horizontally flip left and right sections to fill the canvas.
Rather than trying to explain it in detail, I'm including some before and after pics (which I did in Gimp) to show what I'm trying to achieve:
BEFORE:
AFTER:
Incidentally, I'm on Linux (or OS X) using IM version 6.2.2-6
Any pointers or help with this would be greatly appreciated as I have a ton of images to process.
Thanks!!
Nick
Increase canvas size and montage/tile mirror images
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Increase canvas size and montage/tile mirror images
Use -distort SRT 0 with a viewport set to expand and mirror the image.
The following makes the image bigger by 10% by mirroring the borders on each side by 5%:
convert 60510291.jpg -virtual-pixel mirror -set option:distort:viewport '%[fx:1.1*w]'x'%[fx:1.1*h]'-'%[fx:.05*w]'-'%[fx:.05*h]' -distort SRT 0 +repage 60510291_tmp.jpg
see
http://www.imagemagick.org/Usage/distor ... t_viewport
http://www.imagemagick.org/Usage/distor ... red_square
or see my script, imageborder, at the link below
The following makes the image bigger by 10% by mirroring the borders on each side by 5%:
convert 60510291.jpg -virtual-pixel mirror -set option:distort:viewport '%[fx:1.1*w]'x'%[fx:1.1*h]'-'%[fx:.05*w]'-'%[fx:.05*h]' -distort SRT 0 +repage 60510291_tmp.jpg
see
http://www.imagemagick.org/Usage/distor ... t_viewport
http://www.imagemagick.org/Usage/distor ... red_square
or see my script, imageborder, at the link below
Re: Increase canvas size and montage/tile mirror images
Wow! Thank you so much for helping me out with this! I've really been struggling to find the best/correct combination to get the results I needed.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Increase canvas size and montage/tile mirror images
You may also like to look at
Thumbnails and Framing, self framing (external) images
http://www.imagemagick.org/Usage/thumbnails/#self_frame
The third example is basically identical but it uses 'edge' instead of mirror, and adds a thin border to separate the frame.
Thumbnails and Framing, self framing (external) images
http://www.imagemagick.org/Usage/thumbnails/#self_frame
The third example is basically identical but it uses 'edge' instead of mirror, and adds a thin border to separate the frame.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/