Need help findng appropriate programs

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Zatzmanzatz
Posts: 3
Joined: 2013-03-01T14:02:44-07:00
Authentication code: 6789

Need help findng appropriate programs

Post by Zatzmanzatz »

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)


Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Need help findng appropriate programs

Post by fmw42 »

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.
Zatzmanzatz
Posts: 3
Joined: 2013-03-01T14:02:44-07:00
Authentication code: 6789

Re: Need help findng appropriate programs

Post by Zatzmanzatz »

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.

Image

I have flattened it and merged all layers so now i just need to split into 40x40
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Need help findng appropriate programs

Post by fmw42 »

This works very well.

convert fIWp1IP.png -crop 40x40 +repage icon_%02d.png
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Need help findng appropriate programs

Post by glennrp »

fmw42 wrote:This works very well.

convert fIWp1IP.png -crop 40x40 +repage icon_%02d.png
I think that should be "icon_%03d.png" because there are more than 99 images.
Zatzmanzatz
Posts: 3
Joined: 2013-03-01T14:02:44-07:00
Authentication code: 6789

Re: Need help findng appropriate programs

Post by Zatzmanzatz »

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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Need help findng appropriate programs

Post by anthony »

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/
Post Reply