Page 1 of 1

Help Wanted [Solved]

Posted: 2012-12-07T19:57:35-07:00
by VincentAMV
Hello people who know how to use ImageMagick. Let it be clear that I am not familiar with any coding but I wanted to cut an image holding about 2500 icons into about 2500 different images holding each icon seperate. It takes too long to select them individually and paste them into paint to save them and I don't have photoshop or similar programs.

I have no clue how to use the program although I figured out the command line I should enter, but I don't know where....
[spoiler]Image[/spoiler]
This image here should be cut into with the line:
convert IconSetAll: -crop 16x213@ +repage +adjoin IconSetCut_16x213@_%d.png
As it's 16 icons wide and 213 icons high (this includes the blank lines)

Is there anyone who can tell me how to use the program to even enter lines or someone willing to do this for me and turn the icons into a .zip or .rar for me?


Any help is appriciated, I hope you will stumble onto this soon.
Vincent

PS: I know this is a copy of the post I made in the Consult Subforum, but I was adviced to place it here as well. If either one is resolved or being resolved I will delete the other to prevent any confusion.

Re: Help Wanted

Posted: 2012-12-07T20:14:23-07:00
by fmw42
convert IconSetAll: -crop 16x213@ +repage +adjoin IconSetCut_16x213@_%d.png
This should properly be

convert IconSetAll.png -crop 16x213@ +repage +adjoin IconSetCut_16x213@_%d.png

But it will not likely work well as there is little room between some icons, the icon heights look to vary and the height of the image is not evenly divisible by 213. Furthermore there are groups of icons with different headers and likely different spacing that is not matched to cut into 213 pieces in the height dimension. Each group probably needs to be cropped properly before trying the command above (so that each is evenly divisible in height by the number of icons).

Re: Help Wanted

Posted: 2012-12-08T04:37:39-07:00
by snibgo
With a bit of experimentation, I count 230 rows.

The icons are not in strict columns, so the following nearly works but not quite:

Code: Select all

convert iconAll.png ^
  -bordercolor White -border 1x1 ^
  +repage ^
  -trim ^
  -trim ^
  +repage ^
  -crop 16x230@ ^
  i01_%%04d.png
I hoped that each group might be in strict columns, so it would be a fairly simple task to treat each group separately. Sadly not -- even the first group isn't in columns. Some icons abut others, so automatic separation would be difficult. I reckon it would take a day to go through it, piece by piece.

Re: Help Wanted

Posted: 2012-12-08T05:54:15-07:00
by VincentAMV
If they aren't properly spaced out evenly then there is nothing to do about it, it would take as much work to edit this to be perfectly even as it would be to cut out every icon from the sheet.
Thank you all for looking at it and responding so quickly.

Vincent.

Re: Help Wanted

Posted: 2012-12-08T06:05:48-07:00
by snibgo
I reckon the above command (Windows script) gives about 99% of the icons with no problem. If you can't run the command, send me a PM with your email address and I'll send you the results in a zip file.

Re: Help Wanted [Solved]

Posted: 2012-12-18T16:28:17-07:00
by anthony
You may be able to do it by using a program to seperate (or mask) each unconnected object in the image.

Take a look at Fred Weinhaus's script "multicrop", It may need some tweaking to reduce the 'grid search pattern' it uses in finding objects, but it should do the trick.
http://www.fmwconcepts.com/imagemagick/multicrop/

If each row has a actual gap between them (though I don't think that is the case) then you can use a script 'divide_vert' to try separate each row from each other. It will at a minimum separate each group.
http://www.imagemagick.org/Usage/scripts/divide_vert