Page 1 of 1
Convert Binary image (.BIN) to other image format (e.g. PNG)
Posted: 30.09.2006, 11:43
by Fightspit
I already downloaded the "bmng" data (world.200406.3x86400x43200.bin.gz) and I finished to decompress it (it takes 10 GB
).
After searching with google how to convert a binary picture to an other format without sucess
, I ask you if you know an utility or a "SINGLE" command line (as t00fri
) which can do it (I hope
).
Thanks for the help
Posted: 30.09.2006, 12:48
by selden
ImageMagick and NetPBM both are command line utility packages that can convert among different image formats. Neither one understands DDS/DXT, though. Both are freeware and available for multiple platforms.
Posted: 30.09.2006, 14:04
by Fightspit
I have already got Imagemagick but it doesn't support ".bin" format:
http://www.imagemagick.org/script/formats.php
I am not sure that NetPBM recognize ".bin" images:
http://netpbm.sourceforge.net/doc/index.html#formats
Posted: 30.09.2006, 18:11
by cartrite
Fightpit wrote:
I have already got Imagemagick but it doesn't support ".bin" format:
IM can open the .bin file. Rename it to .rgb and give dimensions and depth info on the command line.
Code: Select all
convert -size 86400x43200 -depth 8 world.200406.3x86400x43200.rgb blue-marble.png
Edit: It's been a while and the depth may be wrong or unnecessary.
Posted: 30.09.2006, 19:17
by t00fri
Of course it works, but you havn't got enough cache space on your hd! You need ~ > 50 GB FREE space where you started convert. IM is highly inefficient and incredibly slow for VERY big files. It's just not suited...
I do the conversion directly with my custom code, which is VERY easy and fast.
Posted: 30.09.2006, 19:18
by Fightspit
It doesn't work with or without depth option
EDIT: I have a bug with this post
and I don't know why ...
Posted: 30.09.2006, 19:22
by Fightspit
t00fri wrote:You need ~ > 50 GB FREE space where you started convert. IM is highly inefficient and incredibly slow for VERY big files. It's just not suited...
Wow
50 GB
thanks for advise.
I do the conversion directly with my custom code, which is VERY easy and fast.
Edit: Unnecessary to aks him to test his code
Posted: 30.09.2006, 19:27
by t00fri
Deleted.
Posted: 30.09.2006, 19:34
by cartrite
I just looked at my bash history and i think the - depth 8 was used. I couldn't find that exact command though. I used to get those eof errors and it was caused by not enough memory or pixel cache that a too small. IM would crash with a eof when it ran out of memory. The other reason I got them was the file was corrupted by the extraction process.
If you have the space you need to set an environment variable for IM's pixel cache. I beleive IM needed about 60 GB to process a rgb file that large.
Posted: 10.10.2006, 01:17
by LoneHiker
If you have access to Photoshop try renaming the extension to .raw and input the image parameters in the 'Photoshop RAW Options' dialog:
Dimensions
Width: 86400
Height: 43200
Channels
Count: 3
Depth: 8 bits
Byte Order: Mac
Header
Size: 0
----------
Note: I don't recall if the byte order is Mac ("Big Endian") or IBM PC ("Little Endian") so try one or the other if the file loads improperly.
----------
BTW, unless you REALLY need this file in this form it might be easier just to use the 500 meter non-shaded BMNG PNG tiles. They're exactly the same.
Lone