Convert Binary image (.BIN) to other image format (e.g. PNG)

Tips for creating and manipulating planet textures for Celestia.
Topic author
Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Convert Binary image (.BIN) to other image format (e.g. PNG)

Post #1by Fightspit » 30.09.2006, 11:43

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 :? :oops: , I ask you if you know an utility or a "SINGLE" command line (as t00fri :wink: ) which can do it (I hope :roll:).

Thanks for the help :!:
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 30.09.2006, 12:48

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.
Selden

Topic author
Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #3by Fightspit » 30.09.2006, 14:04

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
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #4by cartrite » 30.09.2006, 18:11

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.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #5by t00fri » 30.09.2006, 19:17

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.
Image

Topic author
Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #6by Fightspit » 30.09.2006, 19:18

It doesn't work with or without depth option :?

Image

EDIT: I have a bug with this post :? and I don't know why ...
Last edited by Fightspit on 30.09.2006, 19:27, edited 3 times in total.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Topic author
Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #7by Fightspit » 30.09.2006, 19:22

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 8O :lol: 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 :(
Last edited by Fightspit on 01.10.2006, 15:28, edited 1 time in total.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #8by t00fri » 30.09.2006, 19:27

Deleted.
Last edited by t00fri on 30.09.2006, 21:16, edited 1 time in total.
Image

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #9by cartrite » 30.09.2006, 19:34

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.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

LoneHiker
Posts: 53
Joined: 10.10.2005
With us: 19 years 1 month

Post #10by LoneHiker » 10.10.2006, 01:17

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


Return to “Textures”