ID:151898
 
Well, it quite often happens that you need to convert from real-world images to 32x32 sliced icons. Right now, for example, I want to put large animations into a single icon file using the "0,0" "1,0" etc. states, which turns out to be a very tedious task. Is there any program out there that can do this for you, or is there any documentation on .dmi files through which I could write my own python script to handle this?
.dmi files are just .png's with the extension changed. The information for directions, animation frames, etc is stored in the image's metadata (the format should be easy enough to figure out if you take a look at it).

Edit:
Here's an example of what the metadata might look like:
# BEGIN DMI
version = 4.0
state = "blue"
dirs = 1
frames = 4
delay = 4,2,2,1
state = "green"
dirs = 1
frames = 4
delay = 4,2,2,1
state = "red"
dirs = 1
frames = 4
delay = 4,2,2,1
# END DMI


You could write a program in Python (or a similar language) to accomplish what you need to do, although it may be easier to use DM's icon procs.
In response to Nickr5
Nickr5 wrote:
.dmi files are just .png's with the extension changed. The information for directions, animation frames, etc is stored in the image's metadata (the format should be easy enough to figure out if you take a look at it).

It's also possible to use DM itself to import and setup a series of graphics as you like. You can set states, frames, or anything else you want.
In response to Jon88
Yeah - I just remembered that and edited my post right as you replied.
It seems that you want something similar as Opop1 did here ( [link] ), so maybe Xooxers suggestion would suite you as well ( [link] )?
In response to Jon88
Jon88 wrote:
It's also possible to use DM itself to import and setup a series of graphics as you like. You can set states, frames, or anything else you want.

Interesting, where can I find documentation on that? I couldn't find any way to set up frames in the /icon documentation, but maybe it's a new feature or I didn't look closely enough.
In response to CIB
CIB wrote:
Jon88 wrote:
It's also possible to use DM itself to import and setup a series of graphics as you like. You can set states, frames, or anything else you want.

Interesting, where can I find documentation on that? I couldn't find any way to set up frames in the /icon documentation, but maybe it's a new feature or I didn't look closely enough.

http://www.byond.com/docs/ref/info.html#/icon/proc/Insert

Not a new feature, but few people use it. It's surprisingly helpful sometimes.