[TOOL][v1.3.2] Change bootlogo (and other images) with imgdata tool

Search This thread

bitdomo

Senior Member
Nov 3, 2011
1,542
1,244
31
Göd
What is imgdata tool?

It is a tool to extract images like the bootlogo from the partition called imgdata. Then you can change these images with gimp or photshop then repack them into a new imgdata image and flash it to your device and see your new custom bootlogo or fastboot menu.

Instructions

  1. Download imgdata tool from here or from the attachments.
  2. Run start.bat script if you are a windows user or run start script if you are a linux or mac user.
  3. Verify your phone's model by exactly typing NEXUS 5.
    96387321_www.kepfeltoltes.hu_.png
  4. Select option number 1 called Extract imgdata.
    2869737862_www.kepfeltoltes.hu_.png
  5. Drag and drop the imgdata.img file from stock folder to imgdata tool or type the path to imgdata.img.
    7946335533_www.kepfeltoltes.hu_.png
  6. The folder with the extracted images should pop-up. If it does not happen you will find the images in the images folder.
  7. Edit the desired images.
  8. Edit pos.txt:
    • Never change the entries line and never remove any line.
    • First column is the name of the image second column is the position of the image.
    • 0x0 means the image will be shown on your screen in the top left corner.
    • If it is 0x1 the image move 1 pixel down.
    • If it is 1x0 the image will move 1 pixel right.
    • If it is 281x868 the image will move 281 pixels right and 868 pixels down.
  9. You can check your changes in option number 2 called Preview from the main menu in the imgdata tool. It should open the image you selected or open the preview folder if you selected the option View all. If it does not happen then the preveiw images can be found in the folder called preveiws.
    5130430194_www.kepfeltoltes.hu_.png
  10. When you finished editing the images you can build a new imgdata from the images you edited by selecting option number 3 called Build imgdata from the main menu in the imgdata tool.
  11. After the building finished you can flash the zip called flash-me.zip to flash the new imgdata to your phone or if you want you can flash it using imgdata tool.
    10329753225_www.kepfeltoltes.hu_.png

Notes
  • Only 24 bit bmp files are acceptable.
  • You can find the custom imgdata image in the folder called custom after the building.
  • The maximum file size of the imgdata.img is 3145728 bytes (3 MiB). The tool will show you an error if that happens and it will ask you do you want to reduce the color depth of an image from 24 bit to 16 bit. If you still exceed the 3 MiB limit you can resize other images which are not important to you to a 1x1 pixel image.
  • If you want to use full screen images in the fastboot menu, then it will cover the system texts.
  • If a new bootloader is released stop using the tool until I check whether the imgdata changed or not.
  • Working with bootloader versions up to HHZ20f
Changelog

1.3.2
Linux 32 and 64 bit binaries
Making clear this tool is for Nexus 5 and not for Nexus 5X
Added missing entries for 16 bit menu
1.3.1
Added full support for imgdata.img after the HHZ12h bootloader update.
Added padlock image to the oem unlock screen in the preview option.
1.3.0
Linux and mac support.
Start.bat now adds C:\Windows\System32 and C:\Windows\SysWOW64 to the path environment variable if they are missing.
For imgdata binary: 16bit switch now checks the input file to determine is it a valid bmp file.
1.2.1
16 bit conversion: does in one step when you open an image with gimp then save it as 16 bit then reopen and save it as 24 bit.
the original image will get "o-" tag to the begining of its name
1.2.0
Preview function.
Option for flash with adb or fastboot.
Added more-space.img to the custom folder. I removed padlock, fastboot background, downloadmode screen and I minimalized fastboot screen and oem unlock screen to gain more space for custom boot logos.
1.1.1
1.1.0
Built from reworked code.
1.0.1
Added file size check for new-imgdata.img
1.0.0
First public version
Sources
https://github.com/bitdomo/imgdata/tree/hammerhead

Technical details
Structure of imgdata

mi1cbbzpgz06wv1yai03.png

Partition header

DATA1: 8 byte string. It says IMGDATA!. It is similar to the begining of boot.img and recovery.img that says ANDROID!
DATA2: I don't know.
DATA3: Number of images. It is 12.
8 bytes of 0: I dont know the purpose of that

Image headers

DATA4: 16 byte string. Tells the name of the image.
DATA5: image width in pixel
DATA6: image height in pixel
DATA7: X position of the image in pixel
DATA8: Y position of the image in pixel
DATA9: it tells where is the begining of the picture on imgdata
DATA10: size of the image

This pattern goes on, from DATA4 to DATA10.

Structure of the images

It consist of 4 bytes of chunks.

  • First byte: count number
  • Second byte: R value
  • Third byte: G value
  • Fourth byte: B value

Example:

05 00 00 00 02 FF FF FF

05: count number = 5
00 00 00: RGB value = black

02: count number = 2
FF FF FF: RGB value = white

So from the top left corner of your screen you would see 5 black pixels then 2 white pixels.
 

Attachments

  • imgdata-tool-v131.zip
    4.4 MB · Views: 1,105
  • imgdata-tool-v132.zip
    9 MB · Views: 3,031
Last edited:

bitdomo

Senior Member
Nov 3, 2011
1,542
1,244
31
Göd
I managed to decode the structure of the images. It consist of 4 bytes of chunks.

First byte: countnumber
Second byte: R value
Third byte: G value
Fourth byte: B value

Example:

05 00 00 00 02 FF FF FF

05: countnumber = 5
00 00 00: RGB value = black

02: countnumber
FF FF FF: RGB value = white

So from the top left corner of your screen you would see 5 black pixels then 2 white pixels.

I wrote a C program which converts these raw images to bmp images. So my guessing was right about the Image headers in the first post.

I will later post that program with an option to convert bmp files to raw files.

If you want to write your own program then here are a few hint:

BMP stores pixel values in BGR order while the pixels stored in RGB order in the raw file.

BMP picture starts from bottom left corner while the raw file starts from top left corner.

In a BMP file the size of a pixel row in bytes has to be multiple of 4. Lets say you have 2x1 bmp picture. (width x height, column x row) . You have 2 pixels.
Each pixel stored on 3 bytes (BGR). 2*3=6.
6%4 = 2 so you have to add two more bytes to the row, then 8%4 will be = 0.

Tapatalk-kal küldve az én Nexus 5-el
 

Paradoxxx

Senior Member
Aug 14, 2008
5,584
5,959
Krakow
IT WORKS!

https://www.youtube.com/watch?v=UMKgpVVjLgI

I have just finished with the imgdata builder/extractor app, but before I share it with you all I want to make some tests and debugs to make sure everything works perfectly.

Good job dude. This is what I call true development.

EDIT : Change the title, I'm trying to make it to front page as a news :)

EDIT 2 : Just checked the imgdata rar, so basically we could even change the tiny "unlocked" logo at the bottom of the booting screen?

:highfive:
 
Last edited:

bitdomo

Senior Member
Nov 3, 2011
1,542
1,244
31
Göd
Good job dude. This is what I call true development.

EDIT : Change the title, I'm trying to make it to front page as a news :)

EDIT 2 : Just checked the imgdata rar, so basically we could even change the tiny "unlocked" logo at the bottom of the booting screen?

:highfive:

To "EDIT": What should be the new title?
To "EDIT2": Yes we could, and many other pictures.

All the images we can edit is in the attachments.
 

Attachments

  • images.rar
    337 KB · Views: 457
Last edited:

gee one

Senior Member
Jul 29, 2010
1,979
866
linux command line
I managed to decode the structure of the images. It consist of 4 bytes of chunks.

First byte: countnumber
Second byte: R value
Third byte: G value
Fourth byte: B value

Example:

05 00 00 00 02 FF FF FF

05: countnumber = 5
00 00 00: RGB value = black

02: countnumber
FF FF FF: RGB value = white

So from the top left corner of your screen you would see 5 black pixels then 2 white pixels.

I wrote a C program which converts these raw images to bmp images. So my guessing was right about the Image headers in the first post.

I will later post that program with an option to convert bmp files to raw files.

If you want to write your own program then here are a few hint:

BMP stores pixel values in BGR order while the pixels stored in RGB order in the raw file.

BMP picture starts from bottom left corner while the raw file starts from top left corner.

In a BMP file the size of a pixel row in bytes has to be multiple of 4. Lets say you have 2x1 bmp picture. (width x height, column x row) . You have 2 pixels.
Each pixel stored on 3 bytes (BGR). 2*3=6.
6%4 = 2 so you have to add two more bytes to the row, then 8%4 will be = 0.

Tapatalk-kal küldve az én Nexus 5-el
This sounds like the RLE format, which is used for the splash screens. It's pretty compact if you just have a logo on a solid background, like a boot logo.

Nice work.
 
  • Like
Reactions: fffft

simms22

Recognized Contributor - R.I.P
Jun 4, 2009
34,053
25,934
BROOKLYN!
www.androidcommunity.com
There was an app for the Galaxy Nexus that did it called LogoMe but it hasn't been updated AFAIK. I can't wait till I can do it on my Nexus 5!

Sent from my Nexus 5 using Tapatalk

yea, that was @Ezekeel that made it, i tested for him when he was developing it. during its development, he was afraid about bricking a testers device. as where the image was stored could of bricked the device if something wrong was changed.
 

bitdomo

Senior Member
Nov 3, 2011
1,542
1,244
31
Göd
I managed to fix every bugs in my program.
I am currently running tests on the imgdata changer. 2000 runs with memory checks for memory leaks and access violation, still 1000 runs to go, and no problems so far.
During the testing process it automaticly creats random bmp files like this http://kepfeltoltes.hu/140530/start_www.kepfeltoltes.hu_.jpg with random dimensions (from 1x1 to 1080x1920), then build the imgdata file from the random pictures, then extracts the built imgdata file.
If the testing showes no errors, then I will share the program with you in the morning. (Its 0:21 or 12:21 pm here now)

A little teaser. If you flash this zip from my attachment then it will make the padlock disappear. (I've just replaced the padlock picture with a same sized only black picture)

md5 for the zip:

Code:
aa837bfce15c114283fba48797f1ea3f *no-padlock.zip
 

Attachments

  • no-padlock.zip
    300.8 KB · Views: 159
Last edited:

simms22

Recognized Contributor - R.I.P
Jun 4, 2009
34,053
25,934
BROOKLYN!
www.androidcommunity.com
I managed to fix every bugs in my program.
I am currently running tests on the imgdata changer. 2000 runs with memory checks for memory leaks and access violation, still 1000 runs to go, and no problems so far.
During the testing process it automaticly creats random bmp files like this http://kepfeltoltes.hu/140530/start_www.kepfeltoltes.hu_.jpg with random dimensions (from 1x1 to 1080x1920), then build the imgdata file from the random pictures, then extracts the built imgdata file.
If the testing showes no errors, then I will share the program with you in the morning. (Its 0:21 or 12:21 pm here now)

A little teaser. If you flash this zip from my attachment then it will make the padlock disappear. (I've just replaced the padlock picture with a same side only black picture)

md5 for the zip:

Code:
aa837bfce15c114283fba48797f1ea3f *no-padlock.zip


works!
padlock gone :)
 

Paradoxxx

Senior Member
Aug 14, 2008
5,584
5,959
Krakow
Uauaua, this is so ****ing great. Good job.

Will you share the SRC BTW ?

Envoyé de mon Nexus 5 en utilisant Tapatalk
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 105
    What is imgdata tool?

    It is a tool to extract images like the bootlogo from the partition called imgdata. Then you can change these images with gimp or photshop then repack them into a new imgdata image and flash it to your device and see your new custom bootlogo or fastboot menu.

    Instructions

    1. Download imgdata tool from here or from the attachments.
    2. Run start.bat script if you are a windows user or run start script if you are a linux or mac user.
    3. Verify your phone's model by exactly typing NEXUS 5.
      96387321_www.kepfeltoltes.hu_.png
    4. Select option number 1 called Extract imgdata.
      2869737862_www.kepfeltoltes.hu_.png
    5. Drag and drop the imgdata.img file from stock folder to imgdata tool or type the path to imgdata.img.
      7946335533_www.kepfeltoltes.hu_.png
    6. The folder with the extracted images should pop-up. If it does not happen you will find the images in the images folder.
    7. Edit the desired images.
    8. Edit pos.txt:
      • Never change the entries line and never remove any line.
      • First column is the name of the image second column is the position of the image.
      • 0x0 means the image will be shown on your screen in the top left corner.
      • If it is 0x1 the image move 1 pixel down.
      • If it is 1x0 the image will move 1 pixel right.
      • If it is 281x868 the image will move 281 pixels right and 868 pixels down.
    9. You can check your changes in option number 2 called Preview from the main menu in the imgdata tool. It should open the image you selected or open the preview folder if you selected the option View all. If it does not happen then the preveiw images can be found in the folder called preveiws.
      5130430194_www.kepfeltoltes.hu_.png
    10. When you finished editing the images you can build a new imgdata from the images you edited by selecting option number 3 called Build imgdata from the main menu in the imgdata tool.
    11. After the building finished you can flash the zip called flash-me.zip to flash the new imgdata to your phone or if you want you can flash it using imgdata tool.
      10329753225_www.kepfeltoltes.hu_.png

    Notes
    • Only 24 bit bmp files are acceptable.
    • You can find the custom imgdata image in the folder called custom after the building.
    • The maximum file size of the imgdata.img is 3145728 bytes (3 MiB). The tool will show you an error if that happens and it will ask you do you want to reduce the color depth of an image from 24 bit to 16 bit. If you still exceed the 3 MiB limit you can resize other images which are not important to you to a 1x1 pixel image.
    • If you want to use full screen images in the fastboot menu, then it will cover the system texts.
    • If a new bootloader is released stop using the tool until I check whether the imgdata changed or not.
    • Working with bootloader versions up to HHZ20f
    Changelog

    1.3.2
    Linux 32 and 64 bit binaries
    Making clear this tool is for Nexus 5 and not for Nexus 5X
    Added missing entries for 16 bit menu
    1.3.1
    Added full support for imgdata.img after the HHZ12h bootloader update.
    Added padlock image to the oem unlock screen in the preview option.
    1.3.0
    Linux and mac support.
    Start.bat now adds C:\Windows\System32 and C:\Windows\SysWOW64 to the path environment variable if they are missing.
    For imgdata binary: 16bit switch now checks the input file to determine is it a valid bmp file.
    1.2.1
    16 bit conversion: does in one step when you open an image with gimp then save it as 16 bit then reopen and save it as 24 bit.
    the original image will get "o-" tag to the begining of its name
    1.2.0
    Preview function.
    Option for flash with adb or fastboot.
    Added more-space.img to the custom folder. I removed padlock, fastboot background, downloadmode screen and I minimalized fastboot screen and oem unlock screen to gain more space for custom boot logos.
    1.1.1
    1.1.0
    Built from reworked code.
    1.0.1
    Added file size check for new-imgdata.img
    1.0.0
    First public version
    Sources
    https://github.com/bitdomo/imgdata/tree/hammerhead

    Technical details
    Structure of imgdata

    mi1cbbzpgz06wv1yai03.png

    Partition header

    DATA1: 8 byte string. It says IMGDATA!. It is similar to the begining of boot.img and recovery.img that says ANDROID!
    DATA2: I don't know.
    DATA3: Number of images. It is 12.
    8 bytes of 0: I dont know the purpose of that

    Image headers

    DATA4: 16 byte string. Tells the name of the image.
    DATA5: image width in pixel
    DATA6: image height in pixel
    DATA7: X position of the image in pixel
    DATA8: Y position of the image in pixel
    DATA9: it tells where is the begining of the picture on imgdata
    DATA10: size of the image

    This pattern goes on, from DATA4 to DATA10.

    Structure of the images

    It consist of 4 bytes of chunks.

    • First byte: count number
    • Second byte: R value
    • Third byte: G value
    • Fourth byte: B value

    Example:

    05 00 00 00 02 FF FF FF

    05: count number = 5
    00 00 00: RGB value = black

    02: count number = 2
    FF FF FF: RGB value = white

    So from the top left corner of your screen you would see 5 black pixels then 2 white pixels.
    20
    Some mods by me with new google logo)
    2ajcp4y.jpg
    15
    IT WORKS!

    https://www.youtube.com/watch?v=UMKgpVVjLgI

    I have just finished with the imgdata builder/extractor app, but before I share it with you all I want to make some tests and debugs to make sure everything works perfectly.
    15
    I managed to fix every bugs in my program.
    I am currently running tests on the imgdata changer. 2000 runs with memory checks for memory leaks and access violation, still 1000 runs to go, and no problems so far.
    During the testing process it automaticly creats random bmp files like this http://kepfeltoltes.hu/140530/start_www.kepfeltoltes.hu_.jpg with random dimensions (from 1x1 to 1080x1920), then build the imgdata file from the random pictures, then extracts the built imgdata file.
    If the testing showes no errors, then I will share the program with you in the morning. (Its 0:21 or 12:21 pm here now)

    A little teaser. If you flash this zip from my attachment then it will make the padlock disappear. (I've just replaced the padlock picture with a same sized only black picture)

    md5 for the zip:

    Code:
    aa837bfce15c114283fba48797f1ea3f *no-padlock.zip
    14
    I managed to decode the structure of the images. It consist of 4 bytes of chunks.

    First byte: countnumber
    Second byte: R value
    Third byte: G value
    Fourth byte: B value

    Example:

    05 00 00 00 02 FF FF FF

    05: countnumber = 5
    00 00 00: RGB value = black

    02: countnumber
    FF FF FF: RGB value = white

    So from the top left corner of your screen you would see 5 black pixels then 2 white pixels.

    I wrote a C program which converts these raw images to bmp images. So my guessing was right about the Image headers in the first post.

    I will later post that program with an option to convert bmp files to raw files.

    If you want to write your own program then here are a few hint:

    BMP stores pixel values in BGR order while the pixels stored in RGB order in the raw file.

    BMP picture starts from bottom left corner while the raw file starts from top left corner.

    In a BMP file the size of a pixel row in bytes has to be multiple of 4. Lets say you have 2x1 bmp picture. (width x height, column x row) . You have 2 pixels.
    Each pixel stored on 3 bytes (BGR). 2*3=6.
    6%4 = 2 so you have to add two more bytes to the row, then 8%4 will be = 0.

    Tapatalk-kal küldve az én Nexus 5-el