Say, for example, we have a triangle and a circle on the same file and on a transparent background. Like this:
And after processing the image we get the circle in one file and the triangle in another. Like cropping but instead of specifying the tile size, the shapes get autodetected and extracted into separate files.
I'm aware something similar can be done with a script I found here, but the images I need to do this on have more than two colors.
[SOLVED] Is it possible to split an image based on border detection over a transparent background?
[SOLVED] Is it possible to split an image based on border detection over a transparent background?
Last edited by Rubonnek on 2016-11-15T06:46:25-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Is it possible to split an image based on border detection over a transparent background?
Code: Select all
call %PICTBAT%rectSubimages Vyl7bO4.png out.png
For the rectSubimages Windows BAT script, see my "Subimage rectangles" page.
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: Is it possible to split an image based on border detection over a transparent background?
See my script multicrop for unix-based systems
Re: Is it possible to split an image based on border detection over a transparent background?
I don't currently use ImageMagick on Windows, but I'll definitely keep this in mind. Thanks a lot!snibgo wrote:This creates out-0.png and out-1.png, the required images.Code: Select all
call %PICTBAT%rectSubimages Vyl7bO4.png out.png
For the rectSubimages Windows BAT script, see my "Subimage rectangles" page.
I used multicrop2 and it worked wonderfully. Thanks a lot!fmw42 wrote:See my script multicrop for unix-based systems