Hey Guys,
I need to take something like this (though it might have more tiles in either direction):
And pad where the tiles touch with a duplicate pixels in the row or column that touches:
Zoomed In Versions:
Input:
Output:
For this 2x2 example the output is two pixels longer and wider then the original. Those extra two pixels are used to add and extra row and column to each tile where it borders the other tiles. I have a script that made this same buffer but using transparency but I have no idea how to go about duplicating part of an image. What commands can I use to do this, any ideas how it might be done?
Thank you,
poohshoes
Adding Duplication Padding to Tile Sheet [Resolved]
Adding Duplication Padding to Tile Sheet [Resolved]
Last edited by poohshoes on 2013-11-17T23:22:27-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Adding Duplication Padding to Tile Sheet
Several ways.
1) you can crop a row and append it (see http://www.imagemagick.org/Usage/crop/#crop and http://www.imagemagick.org/Usage/layers/#append )
2) you can use a viewport with -filter point -distort SRT 0 see http://www.imagemagick.org/Usage/distor ... t_viewport
1) you can crop a row and append it (see http://www.imagemagick.org/Usage/crop/#crop and http://www.imagemagick.org/Usage/layers/#append )
2) you can use a viewport with -filter point -distort SRT 0 see http://www.imagemagick.org/Usage/distor ... t_viewport
Re: Adding Duplication Padding to Tile Sheet
Thank you fmw42, Distort was exactly what I needed.
Here's the final script:
This forum is so helpful!
Here's the final script:
Code: Select all
convert filledSpaceInput.png ^
-crop 32x0 +repage ^
-define distort:viewport=34x64-1-0 ^
-filter point ^
-distort SRT 0 +repage +append ^
-crop 0x32 +repage ^
-define distort:viewport=68x34-0-1 ^
-distort SRT 0 +repage -append ^
output.png