Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Battle Mages DISPLACE.BIN

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
User avatar
ermaccer
ultra-n00b
Posts: 5
Joined: Sun Jul 24, 2016 9:14 pm
Has thanked: 1 time
Been thanked: 2 times

Battle Mages DISPLACE.BIN

Post by ermaccer »

The most i could decode of it:
Image

Seems to be some float array.
You do not have the required permissions to view the files attached to this post.
Last edited by ermaccer on Sat Dec 12, 2020 8:54 am, edited 1 time in total.
herbert3000
veteran
Posts: 145
Joined: Wed Jun 02, 2010 4:53 am
Has thanked: 20 times
Been thanked: 149 times
Contact:

Re: Battle Mages DISPLACE.BIN

Post by herbert3000 »

Hi, the file is not a usual image file. It's an array of 128 x 128 floating point numbers (IEEE 754).

I see 3 possibilites here for converting the .bin files into a format that you can work with.

1) Convert it to an 8-bit grayscale bitmap. Pros: you can edit it with many programs, cons: you would lose precision.
The minimum value in displace.bin is 193.0 the maximum is 759.0, for a grayscale bitmap, the values need to streteched so they fit into a [0,255] interval. This leads to a loss in precision.

2) Convert it to a 16-bit grayscale bitmap. Pros: No precision loss, cons: you need a program that can handle 16-bit images.

3) Convert it to an .OBJ file. Pros: No precision loss, cons: you need a 3D program to edit the file.

Here's the file converted to a 8-bit grayscale bmp:
displace_193_759.bmp
You do not have the required permissions to view the files attached to this post.
User avatar
ermaccer
ultra-n00b
Posts: 5
Joined: Sun Jul 24, 2016 9:14 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Battle Mages DISPLACE.BIN

Post by ermaccer »

Thanks.
How did you generate it?
Last edited by ermaccer on Sat Dec 12, 2020 8:54 am, edited 1 time in total.
herbert3000
veteran
Posts: 145
Joined: Wed Jun 02, 2010 4:53 am
Has thanked: 20 times
Been thanked: 149 times
Contact:

Re: Battle Mages DISPLACE.BIN

Post by herbert3000 »

I used MATLAB to convert the binary file into an image.
Don't know if that's the best method, but here's the code I used:

Code: Select all

% open file
file = fopen('displace.bin');

% read content of file into a 128x128 float matrix
A = fread(file, [128,128], 'float');

% transpose matrix
A = A';

% close file
fclose(file);

% get minimum and maximum value
amin = min(min(A));
amax = max(max(A));

% convert matrix to grayscale image
I = mat2gray(A, [amin amax]);

% convert image to 16-bit, without the conversion the output image would only be 8-bit
I =  uint16(I * 65535);

% show image in Matlab
imshow(I);

% write image to file
imwrite(I, 'displace.png');
Post Reply