nbimg is a command line tool which allows to convert HTC Splash Screen images from NB to BMP and create NB splash screens from BMP format. Any splash screen size is supported (yes, it works for Diamond or Athena at 640×480 resolution too).
=== nbimg v1.1
=== Convert NB <--> BMP splash screens
=== (c)2008 Pau Oliva - pof @ xda-developers
Usage: nbimg -F file.[nb|bmp]
Mandatory arguments:
-F <filename> Filename to convert.
If the extension is BMP it will be converted to NB.
If the extension is NB it will be converted to BMP.
Optional arguments:
-w <width> Image width in pixels. If not specified will be autodetected.
-h <height> Image height in pixels. If not specified will be autodetected.
-t <pattern> Manually specify the padding pattern (usually 0 or 255).
-p <size> Manually specify the padding size.
-n Do not add HTC splash signature to NB file.
-s Output smartphone format.
NBH arguments: (only when converting from BMP to NBH)
-D <model_id> Generate NBH with specified Model ID (mandatory)
-S <chunksize> NBH SignMaxChunkSize (64 or 1024)
-T <type> NBH header type, this is typically 0x600 or 0x601
Example to convert a NB to BMP:
$ ./nbimg.exe -F diamond137.nb === nbimg v1.1 === Convert NB <--> BMP splash screens === (c)2008 Pau Oliva - pof @ xda-developers [] File: diamond137.nb [] Image dimensions: 480x640 [] Encoding: diamond137.nb.bmp [] Done!
Example to convert a BMP to NB:
$ ./nbimg.exe -F diamond137.bmp === nbimg v1.1 === Convert NB <--> BMP splash screens === (c)2008 Pau Oliva - pof @ xda-developers [] File: diamond137.bmp [] Encoding: diamond137.bmp.nb [] Image dimensions: 480x640 [] Done!
Download
version 1.1
- Linux version (source code): nbimg-1.1.tar.gz
- Windows version: nbimg-1.1win32.zip
version 1.0
- Linux version (source code): nbimg-1.0.tar.gz
- Windows version: nbimg-1.0win32.zip

Google+
linkedin.com/in/pauoliva
twitter.com/pof
Hi Pau,
I found your nbbmp converter through XDA and came upon your blog here via Google. I was thinking about making a simple gui-based application to do a similar process, and was wondering two things.
1) How were you able to figure out the format details of the NB file type? Is there a specification somewhere or did you somehow reverse-engineer it.
2) If there isn’t a spec somewhere, would you be ok with my using your file as a reference in making my own application, if I do end up making it?
Thanks!
-Al
Hi,
1) no specs as far as I know, I reversed it using imagemagick but that was quite a long time ago and I can’t remember the specific details now.
2) feel free to use my source as a reference, no problem at all. The code is licensed under the GPL3.
On lines 430, 453, 461 of source v1.1 above, require the following changes:
430:
(-) sprintf(filename, optarg);
(+) sprintf(filename, “%s”, optarg);
453:
(-) sprintf(modelid, optarg);
(+) sprintf(modelid, “%s”, optarg);
461:
(-) sprintf(type, optarg);
(+) sprintf(type, “%s”, optarg);
Built in Ubuntu 10.10 x64.
Thank you so much =) Please add this fix to 1.2!
Sorry for being daft, but how do I run this in Linux?
You need to compile it first: gcc nbimg.c -o nbimg
When I convert 24bit image (Original http://yfrog.com/hskbrtp ), I got 24bit image that looks like 16bit image (Converted image http://yfrog.com/kjnlfp ).
Can you give me a favor, so I can deal with this problem?
Doesn’t work. Command not found even after compiling.
In linux I mean, tried both versions. Using ubuntu 10.10
Run it with ‘./nbimg’ instead of ‘nbimg’, because it is not in your $PATH.