I have a number of images that are 536x536 pixels. I want to insert 10 pixels of blank space every 67 pixels while shifting the rest of the image down. The result should be images that are 536x606 pixels as below. Can someone help me do this?
Original
67 pixels image
67 pixels image
67 pixels image
67 pixels image
67 pixels image
67 pixels image
67 pixels image
67 pixels image
New
67 pixels image
10 pixels blank
67 pixels image
10 pixels blank
67 pixels image
10 pixels blank
67 pixels image
10 pixels blank
67 pixels image
10 pixels blank
67 pixels image
10 pixels blank
67 pixels image
10 pixels blank
67 pixels image
Inserting blank lines between parts of an image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Inserting blank lines between parts of an image
What is your IM version and Platform? Please alway provide that when asking question since syntax may vary, especially if scripting. Once we know that, we can probably help.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620
For novices, see
viewtopic.php?f=1&t=9620
http://http://www.imagemagick.org/scrip ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620
For novices, see
viewtopic.php?f=1&t=9620
http://http://www.imagemagick.org/scrip ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Inserting blank lines between parts of an image
What version of IM? I'll assume v6. For v7, use "magick" instead of "convert".
What platform? But that makes no difference to my suggestion.
"-size 536x536 gradient:" makes a sample input image. You would use your own file.
Then I crop into multiple images, each 67 pixels high. I extend each downwards to 77 pixels height, with the extra rows colour "none", which is transparent black. Then I append these vertically. The result has an extra 10 rows at the bottom, so the final "-crop" removes them.
What platform? But that makes no difference to my suggestion.
Code: Select all
convert -size 536x536 gradient: -crop 0x67 -background None -gravity North -extent 0x77 -append -crop 0x606+0+0 +repage out.png
Then I crop into multiple images, each 67 pixels high. I extend each downwards to 77 pixels height, with the extra rows colour "none", which is transparent black. Then I append these vertically. The result has an extra 10 rows at the bottom, so the final "-crop" removes them.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Inserting blank lines between parts of an image
input image (dimensions 640x480)
see
http://www.imagemagick.org/Usage/crop/#crop_tile
http://www.imagemagick.org/Usage/crop/#splice
http://www.imagemagick.org/Usage/crop/#chop
Code: Select all
convert logo.png -crop 640x67 +repage -gravity south -background none -splice 0x67 -append -chop 0x10 logo_stripe.png
see
http://www.imagemagick.org/Usage/crop/#crop_tile
http://www.imagemagick.org/Usage/crop/#splice
http://www.imagemagick.org/Usage/crop/#chop
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Inserting blank lines between parts of an image
There are several ways to go about this task. Look over the good solutions fmw42 and snibgo have provided above. Here's another similar approach...
Code: Select all
convert input.png -alpha set -crop 0x67 -bordercolor none -border 0x5 -append -shave 0x5 output.png
If you're using IM7 you would start the command with "magick" instead of "convert".
Re: Inserting blank lines between parts of an image
Thank you all for the help.