Jump to content

[Help] PC "Alien Nations 2"/"die völker 2" compressed images decompression


Recommended Posts

Greetings guys.
I'm trying to decode .imag files, which can be found in .ca archives of the game Alien Nations 2 (die völker 2).

I've been trying to understand how it's possible to convert these custom-formatted images into a commonly supported format, like PNG or GIF. And since I'm pretty new to reverse engineering, would appreciate any help.

If I'm getting it right - these images are of 16-bit colour, must be RGB565 or RGBA4444.
The first and the third byte define the image size. (e.g. 28x28), the fifth byte is a some kind of a flag - (probably palette?) - but it's always set to 1. And the pixelarray offset is 24 bytes, again, if I get it right.

Although, what confuses me much - this pixelarray is always shorter than it's supposed to be for 16-bit image:

Quote

e.g.:
`gsausage.imag`
24x24 image = 576 pixels. Which should return 1152 bytes of data for 16-bit.
While pixelarray for this image is only 462 bytes.

I've compared it to the other file with the same image dimensions - and it's also different:
`wsausage.imag`
24x24 image = 576 pixels.
Pixelarray 784 bytes

Looks like it's definitely compressed in some way, so I'm looking for a piece of advice from the people who now how to deal with such stuff. Hope you'll be able to give me some help or possible guidance.

I've added examples of .imag files I've been working with - they're relatively small images (28x28 and 24x24) [in attachment].

I've picked the `sausage` icon to start with - it's relatively small image and pretty easy to find all the appearances in the game.
Interestingly enough, almost every icon in the archive is prefixed with `b,g,h,s,w`, e.g.: [bsausage, gsausage, hsausage, ssausage, wsausage]. I've added all of them to the example archive.
The meaning of these prefixes is not yet quite clear to me, tho. But looks like all of them are used for different places in-game:

"b, h" are 28x28
"g, s, w" are 24x24

 

Quote


The final image should look like this, I suppose (just the icon itself, without the background and text).
Also, possibly, `gsausage` might refer to the greyed-out/grayscale version of it. But it's just a guess.
image.png.80364061d24ecb6d880cae764007201c.png

 

 

I want to preserve the awesome artwork of this game and other old-school gems, so it won't be lost in time.

I did try to find contact somehow the programmers who've been working on this title. But it's been too far long ago, I'm afraid. And either it's not possible to find their contacts, or they simply do not respond.

Thanks in advance!

examples.zip

Edited by LoserAntbear
Clarified more info, rephrasing
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...