I am an editor of a mmo gaming wiki (wikidot) site. The project I am on entails geting the images and icons from the games TGA files which is also used in its UI. There are tons of images and icons to extract, I have tried looking around for something use to extract each idon into separate files to use on the wiki. So aside from taking screen shots of each one of them, does anyone have any suggestions? I have tried to use Gimp and IrfanView but the farthest I can get is determining icon/image location start and stop points and size (most are 40x40 px). Game UI's use the locations to use the icon or image within the game. I sure could use an XML based extractor or something. any help and pointers will be appreciated.
an example (imagur doesnt take tga)
Need help findng appropriate programs
-
- Posts: 3
- Joined: 2013-03-01T14:02:44-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help findng appropriate programs
If the icons are all the same size, you could try using -crop in tiling mode -crop WxH +repage (without the +X+Y offsets). see http://www.imagemagick.org/Usage/crop/#crop_tile
or a simple example at
http://www.fmwconcepts.com/imagemagick/ ... .php#crop2
If the background is made black and you trim the image to remove most of the black excess, you can also try my bash script, multicrop, at the link below, with the right grid spacing. You may lose some of the black around each icon, but if you know the size you can put it back using -border.
or a simple example at
http://www.fmwconcepts.com/imagemagick/ ... .php#crop2
If the background is made black and you trim the image to remove most of the black excess, you can also try my bash script, multicrop, at the link below, with the right grid spacing. You may lose some of the black around each icon, but if you know the size you can put it back using -border.
-
- Posts: 3
- Joined: 2013-03-01T14:02:44-07:00
- Authentication code: 6789
Re: Need help findng appropriate programs
I never seen nor used imagemagic before today, and I really dont know where to start, I did found a standalone zip and so far its nice to look at to get confused. So point me in the right direction to get to the command line.
Oh and the preferred output is .png instead of .ico.
Looking at the cropping (1st link ) looks like a decent way to go breaking up into individual files.
On the other page,the .tga all look like mirror tiling.
I have flattened it and merged all layers so now i just need to split into 40x40
Oh and the preferred output is .png instead of .ico.
Looking at the cropping (1st link ) looks like a decent way to go breaking up into individual files.
On the other page,the .tga all look like mirror tiling.
I have flattened it and merged all layers so now i just need to split into 40x40
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Need help findng appropriate programs
This works very well.
convert fIWp1IP.png -crop 40x40 +repage icon_%02d.png
convert fIWp1IP.png -crop 40x40 +repage icon_%02d.png
Re: Need help findng appropriate programs
I think that should be "icon_%03d.png" because there are more than 99 images.fmw42 wrote:This works very well.
convert fIWp1IP.png -crop 40x40 +repage icon_%02d.png
-
- Posts: 3
- Joined: 2013-03-01T14:02:44-07:00
- Authentication code: 6789
Re: Need help findng appropriate programs
after spending several hours of scouring pages I did find a solution to use with Gimp, sadly i never got know imagemagick better. thanks for your help.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Need help findng appropriate programs
If the image size lines up with tile size (trim is not?) You can use just count up the tiles (12x12 in this case), then use...
Code: Select all
-crop 12x12@ +repage
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/