[MOD][SPLASH][OP5t] Splash Screen Image Injector

Search This thread

makers_mark

Senior Member
Sep 21, 2013
192
477
Kings Mountain
This is a program that I wrote to decode and re-encode the OnePlus 5T "logo.bin" file. Please read below so you can better understand this type of encoding being used:
What Is A Raw Image?

A raw image, whether it be a file or an image in memory, is simply pixel data. There is no extra information like width, height, name, end of line... Absolutely nothing, just pixel data. If you have an image that is raw and the resolution is 1080x1920 and you are using a typical RGB24 or BGR24 (like the ones used here), then your exact filesize or size in memory will be 1080x1920x3! We use 3 here because there is one byte for the R or red component, one for the G (green), and one for the B(blue).

What Is A Run Length Encoded Image?

A run length image encoding uses a count ;usually a single byte (char), 2 bytes (short int), or 4 bytes (long int); and then the pixel components. So instead of writing out 300 bytes of '0's to make a line of 100 black pixels. Black is RGB(0,0,0). You could encode this as 100, 0, 0, 0. And only use 4 bytes of data to get the exact same image as the 300 byte raw image. All the run length encoding I've found, except the Motorola style which is a little different, use a run length encoding that is pixel-oriented like this.

Now I've found this new one and it is a byte-oriented run length encoding. This is for runs of bytes, not pixels. You may think, well whats the big deal? When you add a little area of color, you increase the run length encoded image in you logo.bin immensely! You use 6 bytes per pixel if there aren't any runs of color data. If you had an image that was a 1080x1920 black image with a 25 pixel horizontal line in the middle. The encoder would be doing runs of black data efficiently until it reached the red area.
.....0 255 0 255 0 255 0 255 0 255 0 133 /// we've reached the top left corner of the red line /// 13 1 30 1 255 1 // << that was just one red pixel!! in bgr color order (13, 30, 255) <<// And it keeps going through the rest of the red pixels on that line using 6 bytes per pixel, which is the opposite of compression. Before reaching the red line the encoding was decoding to 255 zeros over and over, until finally 133 zeros. 255 zeros is 85 black pixels stored in just 2 bytes!

This type of encoding is ONLY good for grey scale images. It is not good with color, but it still will handle color of course. In grey scale, the Red, Blue, and Green data components are always the same values. All the way from black (0,0,0) to white (255, 255, 255); including every shade of grey in between>>>(1,1,1) (2,2,2) (3,3,3)....(243, 243, 243) (254, 254, 254)<<<

One other difference in this method of run length encoding is that the color byte is before the count, which is backwards from all of the other methods.​

The attachment contains the executable that was compiled using mingw32 on a 64 bit Windows 10 PC. The PNG library that I used is LodePng, the source is in the download.

Big thanks to @RajGopi for sharing his logo.bin with me and requesting this mod, and testing it as well!:good:

To use the OnePlus 5T Logo Injector:

Decode your logo.bin:
Code:
OP5tLogo -i logo.bin -d

All the PNG 's will be extracted from logo.bin. Edit the PNG(s) that you want to change...

Note:
Your original "logo.bin" file is never changed, it is just read. If the file you try to load isn't a logo.bin file, or a different style, then the program will tell you and exit.​

Inject the image(s) back in to the logo.bin:
Code:
OP5tLogo -i logo.bin -j fhd_oppo fhd_at
To list whats in your logo file:
Code:
OP5tLogo -i logo.bin -l
For a more detailed list:
Code:
OP5tLogo -i logo.bin -L
If the colors are messed up use the "-s" switch while decoding.
Code:
OP5tLogo -i logo.bin -d -s
If you had to use the "-s" switch to decode properly, you'll have to use it to inject also:
Code:
OP5tLogo -i logo.bin -j image_name -s
Note:
You can put as many names after "-j" as you want, and it's not case sensitive. You also don't have to put the whole name. If you just put "-j fhd" every image in the logo.bin that starts with "fhd" will be injected. There has to be a PNG with the name in the directory though​

The size of your modified.logo.bin will displayed along with the original size, if everything went good. The 'splash' partition is 16 MB on the OnePlus 5T. If you use too much color on too many of the images you will easily go over 16 MB. The program will tell you and delete the "modified.logo.bin" that was created. If for some strange reason you would like to keep it, use the "-B" flag on the command.

The last step is to flash the modified logo file via fastboot with the command
Code:
fastboot flash LOGO modified.logo.bin


Use this at your own risk.
Always make backups.
Always.
 

Attachments

  • OP5tLogo.zip
    64.2 KB · Views: 1,508
Last edited:

Bradl79

Senior Member
May 25, 2008
3,355
4,586
J'Ville
thank u so much, i was trying to figure out how to do it with the OP3/T/5 and could not figure it out, it just crashed.
 
Flash the "modified.logo.bin" file through fastboot.

Please forgive my ignorance. I think I got everything done properly. I just don't know what you mean by the above statement.

Normally, if I flash a new recovery in fastboot, I use the phrase fastboot flash recovery xxxx.img

What phrase do I use to flash the new logo.bin file?

Thanks,
Peter

P.S. Where on my OP5T is the original logo.bin file located?

P.P.S. I believe I found my logo.bin file; however, it appears I made some kind of mistake and now I simply have a black splash screen, and nothing I do gets the default splash screen back, including Nandroid restore. It always remains black. Does anyone have an original OP5T logo.bin file they can give me to download? Also, the file I found is called LOGO, not logo.bin. It's in the following directory:

/dev/block/bootdevice/by-name/

P.P.S. I also believe I found the right command in fastboot. Is this the command to flash the logo.bin file:

fastboot flash LOGO logo.bin ???
 
Last edited:

RajGopi

Senior Member
Apr 4, 2014
647
1,237
28
Warangal,Telangana
Samsung Galaxy Watch 4
Please forgive my ignorance. I think I got everything done properly. I just don't know what you mean by the above statement.

Normally, if I flash a new recovery in fastboot, I use the phrase fastboot flash recovery xxxx.img

What phrase do I use to flash the new logo.bin file?

Thanks,
Peter

P.S. Where on my OP5T is the original logo.bin file located?

P.P.S. I believe I found my logo.bin file; however, it appears I made some kind of mistake and now I simply have a black splash screen, and nothing I do gets the default splash screen back, including Nandroid restore. It always remains black. Does anyone have an original OP5T logo.bin file they can give me to download? Also, the file I found is called LOGO, not logo.bin. It's in the following directory:

/dev/block/bootdevice/by-name/

P.P.S. I also believe I found the right command in fastboot. Is this the command to flash the logo.bin file:

fastboot flash LOGO logo.bin ???
Try this one, flash in recovery just like any flashable zip
Let me know if you still want stock logo
Yes, fastboot flash LOGO logo.bin
 
  • Like
Reactions: makers_mark

makers_mark

Senior Member
Sep 21, 2013
192
477
Kings Mountain
Please forgive my ignorance. I think I got everything done properly. I just don't know what you mean by the above statement.

Normally, if I flash a new recovery in fastboot, I use the phrase fastboot flash recovery xxxx.img

What phrase do I use to flash the new logo.bin file?

Thanks,
Peter

P.S. Where on my OP5T is the original logo.bin file located?

P.P.S. I believe I found my logo.bin file; however, it appears I made some kind of mistake and now I simply have a black splash screen, and nothing I do gets the default splash screen back, including Nandroid restore. It always remains black. Does anyone have an original OP5T logo.bin file they can give me to download? Also, the file I found is called LOGO, not logo.bin. It's in the following directory:

/dev/block/bootdevice/by-name/

P.P.S. I also believe I found the right command in fastboot. Is this the command to flash the logo.bin file:

fastboot flash LOGO logo.bin ???

Thanks for the question, but 49 out of 50 times I do not have the device that I am working with. When you use fastboot program, you flash `x` partition with `y` file.

It doesn't matter what `y` is, but `x` is the name of the particular partition that is case sensitive. You can rename `y` whatever you want. It is hard to find partition dumps or names, so I can not worry about what the actual partition name is for a particular device. I could of asked @RajGopi when he tested, but I did not. With nearing 9 million people on XDA, I will gladly let people do their own research or what not before flashing anything for unsaid reasons which others will understand unsaid. In the past I have guided people to this thread. But thank you for wanting more clarification on the actual command with fastboot, I will include it in the post since this program is made specifically for the OP5t.
 
Last edited:
  • Like
Reactions: RajGopi
Try this one, flash in recovery just like any flashable zip
Let me know if you still want stock logo
Yes, fastboot flash LOGO logo.bin

Worked perfectly. Thank you.

Peter

---------- Post added at 07:22 AM ---------- Previous post was at 07:21 AM ----------

Thanks for the question, but 49 out of 50 times I do not have the device that I am working with. When you use fastboot program, you flash `x` partition with `y` file.

It doesn't matter what `y` is, but `x` is the name of the particular partition that is case sensitive. You can rename `y` whatever you want. It is hard to find partition dumps or names, so I can not worry about what the actual partition name is for a particular device. I could of asked @RajGopi when he tested, but I did not. With nearing 9 million people on XDA, I will gladly let people do their own research or what not before flashing anything for unsaid reasons which others will understand unsaid. In the past I have guided people to this thread. But thank you for wanting more clarification on the actual command with fastboot, I will include it in the post since this program is made specifically for the OP5t.

Thank you for the detailed reply. I appreciate all your hard work. Have a great day.

Peter
 
  • Like
Reactions: RajGopi
Try this one, flash in recovery just like any flashable zip
Let me know if you still want stock logo
Yes, fastboot flash LOGO logo.bin

Argh! While your zip file worked perfectly, I'm now trying to modify the PNG file. I got everything done correctly (I think), but when I flash it, I still have your logo, not mine. Obviously there's something I'm doing wrong. Is there anything special about the PNG file? When I copy the modified logo.bin file back to the ZIP file, do I use standard compression or no compression?

Any ideas?

Peter

P.S. I'm trying to get the following PNG file as my Splash Boot image. If someone could create a flashable zip, that would be great, but I still would like to know what I did wrong. I want to learn how to do it, as I did with my OnePlus5.

CustomBootSplash.png
 
Last edited:
  • Like
Reactions: Mecca EL

RajGopi

Senior Member
Apr 4, 2014
647
1,237
28
Warangal,Telangana
Samsung Galaxy Watch 4
Argh! While your zip file worked perfectly, I'm now trying to modify the PNG file. I got everything done correctly (I think), but when I flash it, I still have your logo, not mine. Obviously there's something I'm doing wrong. Is there anything special about the PNG file? When I copy the modified logo.bin file back to the ZIP file, do I use standard compression or no compression?

Any ideas?

Peter

P.S. I'm trying to get the following PNG file as my Splash Boot image. If someone could create a flashable zip, that would be great, but I still would like to know what I did wrong. I want to learn how to do it, as I did with my OnePlus5.
I hope you are renaming the output file to logo.bin and replacing it in the zip
- Check for image resolution
- Normal/standard compression will do fine
 
  • Like
Reactions: makers_mark
I hope you are renaming the output file to logo.bin and replacing it in the zip
- Check for image resolution
- Normal/standard compression will do fine

Yes, I renamed it to logo.bin, and I tried both normal/standard compression and no compression, but it's not working. Your splash continues to display.

What about the image itself? Must it be 256 colour gammut? I'm also assuming that it has to be a PNG file.

Peter

P.S. I even tried flashing the new zip AND by the fastboot method: fastboot flash LOGO logo.bin
 
Last edited:

RajGopi

Senior Member
Apr 4, 2014
647
1,237
28
Warangal,Telangana
Samsung Galaxy Watch 4
Yes, I renamed it to logo.bin, and I tried both normal/standard compression and no compression, but it's not working. Your splash continues to display.

What about the image itself? Must it be 256 colour gammut? I'm also assuming that it has to be a PNG file.

Peter

P.S. I even tried flashing the new zip AND by the fastboot method: fastboot flash LOGO logo.bin
I'll give you flashable zip tomorrow with the image you provided.
Yes, it must be a PNG
 
I'll give you flashable zip tomorrow with the image you provided.
Yes, it must be a PNG

Thank you. In the meantime, I'm going to try and figure out what's going wrong. I simply can't let this go. I have to solve the problem.

Regards,
Peter

P.S. I figured it out. I had to modify the encoding command to make it all work.

Was using: OP5tLogo -i logo.bin -j fhd_oppo fhd_at

Changed to: OP5tLogo -i logo.bin -j fhd_plus_oppo fhd_plus_at

Now everything is working perfectly. Thank you for your assistance.
 
Last edited:
  • Like
Reactions: RajGopi
OP3TInject crashes whenever I try to convert my logo.img, guess something's wrong with my pc.

I'm preparing a detailed Guide on how to prepare and implement a custom boot splash. I should have it ready for download within the hour.

Peter

---------- Post added at 03:27 PM ---------- Previous post was at 02:46 PM ----------

Okay, as mentioned in my previous post, below is a detailed Guide on how to create your own custom boot splash for the OnePlus5T.

Download the PDF file here: https://www.dropbox.com/s/t45ld1abip5orhv/OnePlus5T Custom Boot Splash.pdf?dl=1

Regards,
Peter
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    This is a program that I wrote to decode and re-encode the OnePlus 5T "logo.bin" file. Please read below so you can better understand this type of encoding being used:
    What Is A Raw Image?

    A raw image, whether it be a file or an image in memory, is simply pixel data. There is no extra information like width, height, name, end of line... Absolutely nothing, just pixel data. If you have an image that is raw and the resolution is 1080x1920 and you are using a typical RGB24 or BGR24 (like the ones used here), then your exact filesize or size in memory will be 1080x1920x3! We use 3 here because there is one byte for the R or red component, one for the G (green), and one for the B(blue).

    What Is A Run Length Encoded Image?

    A run length image encoding uses a count ;usually a single byte (char), 2 bytes (short int), or 4 bytes (long int); and then the pixel components. So instead of writing out 300 bytes of '0's to make a line of 100 black pixels. Black is RGB(0,0,0). You could encode this as 100, 0, 0, 0. And only use 4 bytes of data to get the exact same image as the 300 byte raw image. All the run length encoding I've found, except the Motorola style which is a little different, use a run length encoding that is pixel-oriented like this.

    Now I've found this new one and it is a byte-oriented run length encoding. This is for runs of bytes, not pixels. You may think, well whats the big deal? When you add a little area of color, you increase the run length encoded image in you logo.bin immensely! You use 6 bytes per pixel if there aren't any runs of color data. If you had an image that was a 1080x1920 black image with a 25 pixel horizontal line in the middle. The encoder would be doing runs of black data efficiently until it reached the red area.
    .....0 255 0 255 0 255 0 255 0 255 0 133 /// we've reached the top left corner of the red line /// 13 1 30 1 255 1 // << that was just one red pixel!! in bgr color order (13, 30, 255) <<// And it keeps going through the rest of the red pixels on that line using 6 bytes per pixel, which is the opposite of compression. Before reaching the red line the encoding was decoding to 255 zeros over and over, until finally 133 zeros. 255 zeros is 85 black pixels stored in just 2 bytes!

    This type of encoding is ONLY good for grey scale images. It is not good with color, but it still will handle color of course. In grey scale, the Red, Blue, and Green data components are always the same values. All the way from black (0,0,0) to white (255, 255, 255); including every shade of grey in between>>>(1,1,1) (2,2,2) (3,3,3)....(243, 243, 243) (254, 254, 254)<<<

    One other difference in this method of run length encoding is that the color byte is before the count, which is backwards from all of the other methods.​

    The attachment contains the executable that was compiled using mingw32 on a 64 bit Windows 10 PC. The PNG library that I used is LodePng, the source is in the download.

    Big thanks to @RajGopi for sharing his logo.bin with me and requesting this mod, and testing it as well!:good:

    To use the OnePlus 5T Logo Injector:

    Decode your logo.bin:
    Code:
    OP5tLogo -i logo.bin -d

    All the PNG 's will be extracted from logo.bin. Edit the PNG(s) that you want to change...

    Note:
    Your original "logo.bin" file is never changed, it is just read. If the file you try to load isn't a logo.bin file, or a different style, then the program will tell you and exit.​

    Inject the image(s) back in to the logo.bin:
    Code:
    OP5tLogo -i logo.bin -j fhd_oppo fhd_at
    To list whats in your logo file:
    Code:
    OP5tLogo -i logo.bin -l
    For a more detailed list:
    Code:
    OP5tLogo -i logo.bin -L
    If the colors are messed up use the "-s" switch while decoding.
    Code:
    OP5tLogo -i logo.bin -d -s
    If you had to use the "-s" switch to decode properly, you'll have to use it to inject also:
    Code:
    OP5tLogo -i logo.bin -j image_name -s
    Note:
    You can put as many names after "-j" as you want, and it's not case sensitive. You also don't have to put the whole name. If you just put "-j fhd" every image in the logo.bin that starts with "fhd" will be injected. There has to be a PNG with the name in the directory though​

    The size of your modified.logo.bin will displayed along with the original size, if everything went good. The 'splash' partition is 16 MB on the OnePlus 5T. If you use too much color on too many of the images you will easily go over 16 MB. The program will tell you and delete the "modified.logo.bin" that was created. If for some strange reason you would like to keep it, use the "-B" flag on the command.

    The last step is to flash the modified logo file via fastboot with the command
    Code:
    fastboot flash LOGO modified.logo.bin


    Use this at your own risk.
    Always make backups.
    Always.
    3
    Were you ever successful in creating your custom boot logo file? Would you be willing to share the actual custom logo.bin file? I was going to grab the red +1 from my OPO bin file, that I'd been using for years, but yours looks cooler. Thanks

    Yes, I was successful. Here's a file that you can simply flash in recovery::

    https://www.dropbox.com/s/ib0syyrucwqvy8h/OP5T Custom Boot Splash.zip?dl=1

    Peter
    3
    OP3TInject crashes whenever I try to convert my logo.img, guess something's wrong with my pc.

    I'm preparing a detailed Guide on how to prepare and implement a custom boot splash. I should have it ready for download within the hour.

    Peter

    ---------- Post added at 03:27 PM ---------- Previous post was at 02:46 PM ----------

    Okay, as mentioned in my previous post, below is a detailed Guide on how to create your own custom boot splash for the OnePlus5T.

    Download the PDF file here: https://www.dropbox.com/s/t45ld1abip5orhv/OnePlus5T Custom Boot Splash.pdf?dl=1

    Regards,
    Peter
    3
    I love you, man. Thank you so much

    If you're interested, I have a boot animation that matches the splash screen. Here's a GIF of the animation:

    OP5TBootanimationGIF.gif


    Here's a link to download the bootanimation:

    https://www.dropbox.com/s/gl9edc38r69x2r3/bootanimation.zip?dl=1

    If you're rooted, simply go into your system\media directory and replace the existing bootanimation with the new bootanimation.

    Peter
    2
    Glad to see your work here.
    Been waiting for this.
    Merry Christmas

    Merry Christmas to you too. Thank you for being humble, understanding, patient, polite, and more than likely an upstanding individual in your realm.:D