nbimg: HTC splash screen tool

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.2+

version 1.1

version 1.0

This entry was posted in android, HTC, linux and tagged , , , , , , , , , . Bookmark the permalink.

18 Responses to nbimg: HTC splash screen tool

  1. Al C. says:

    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

    • pof says:

      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.

  2. swatspyder says:

    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.

  3. marc dilnutt says:

    Sorry for being daft, but how do I run this in Linux?

  4. J says:

    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?

  5. austin says:

    Doesn’t work. Command not found even after compiling.
    In linux I mean, tried both versions. Using ubuntu 10.10

  6. Evan says:

    Utilizing this utility (v1.1 on win7 enterprise) for an HTC splash image of 720×1280 and the utility crashes at the “No padding added. Check file size” step. Any thoughts? It will work on an iMac however….

  7. pof says:

    I’ve implemented a bunch of new resolution support in the github repo:
    https://github.com/poliva/nbimg

  8. pof says:

    Released version v1.2 on github :)

  9. Rafael Gawenda says:

    Program received signal SIGSEGV, Segmentation fault.
    convertBMP2NB (input=, filename=, dataLen=, addhtcsig=1, smartphone=0,
    padsize=0, pattern=255) at nbimg.c:136
    136 encoded |= (int)(pixdata[1]>>2) << 5 ; //G
    (gdb)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>