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.

22 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)

  10. Matthieu says:

    Hi, thanks for this tool! FYI, version 1.2.1 available on github do not work well on Windows 7. Original colors of the bmp are lost + the quality is lowered (for instance, a green HTC logo is changed to a yellow one with a lot of pixels visible).
    Version 1.1 available on this page works correctly!

  11. Bernard says:

    Hi Pau,
    Thanks for the tool.
    I have a conversion problem with it. I’m trying to convert a bmp file (24-bit) created with GIMP. The file looks perfect with an image viewer under Linux (Mint 15).
    The img file obtained with your tool is not correct : the colors are different (purple instead of blue) and the image is off-centered (a band of the right side of the image end up on the left side of the pic…..)…
    I’m using your tool without any height or width parameters since my file is already the good size.
    Tried 1.1 and 1.2….
    Any clues as to what I’m doing wrong ?

    • pof says:

      try specifying the width & height manually in the command line

      • Bernard says:

        Hello again,

        Thanks for your answer. Tried what you said with both versions with no luck… Any other idea ?
        Maybe I can send you the .bmp file I’m working on so that you can check that it’s correct ?

        Thank you for your time.

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>