Page 1 of 1
How to split image into uneven parts?
Posted: 2017-04-21T14:08:59-07:00
by Alex Jr
Hi everyone, I installed ImageMagick for Terminal on Mac and I am wondering how I can split my image into uneven pieces, and create a new file for each piece?
No, I am not going to release this copyrighted image in my game, its just for experimentation.
Re: How to split image into uneven parts?
Posted: 2017-04-21T14:14:50-07:00
by fmw42
Please always provide your IM version and platform, since syntax and scripting may differ.
How does one know where to split these, since especially some overlap horizontally?
If there is not a clean separation, then you likely will have to do that manually using the -crop operator. See
http://www.imagemagick.org/Usage/crop/#crop
Re: How to split image into uneven parts?
Posted: 2017-04-21T14:24:02-07:00
by snibgo
Code: Select all
convert 83596.png -alpha extract -scale x1! -fill White +opaque Black a.png
This is black where we can cut, and white where we can't. However, it misses the right-most cut point because of the "Sprites ripped by..." text.
Re: How to split image into uneven parts?
Posted: 2017-04-21T14:25:55-07:00
by Alex Jr
IM Version @6.9.8-3_0+x11, Platform OS X El Capitan, 10.11.6
Re: How to split image into uneven parts?
Posted: 2017-04-21T14:27:57-07:00
by Alex Jr
@snibgo, What's 83596.png and a.png supposed to represent?
This is my first time using ImageMagick.
Re: How to split image into uneven parts?
Posted: 2017-04-21T14:32:37-07:00
by fmw42
Alex Jr wrote: ↑2017-04-21T14:27:57-07:00
@snibgo, What's 83596.png and a.png supposed to represent?
This is my first time using ImageMagick.
The input and output images, respectively.
Re: How to split image into uneven parts?
Posted: 2017-04-21T14:59:54-07:00
by snibgo
As Fred says. The file you uploaded has been renamed 83596.png by that website.
If you know the x-coordinates of your cut positions or the width of the pieces, you can just do a number of "-crop" operations. Five of the cut points can be found automatically (eg by my guillotine.bat script). If you crop off the "Sprites ripped by..." text, it finds them all.