Forum: Official Open PS2 Loader Forum - Discussion and information on the Official Open PS2 Loader.


The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the new info from
PSX-Scene in your email each day?




Want to learn more about the team keeping you up to date with the latest scene news?

Read about them now!

Check out our Developer bios, too!

 


User Tag List

Like Tree3Likes

Thread: PNG images could be compressed to reduce ELF size slightly
  

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1 PNG images could be compressed to reduce ELF size slightly 
    mark_k is offline Member
    Join Date
    Dec 2010
    Posts
    101
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    7
    Hi,

    I noticed that the PNG images used in Open PS2 Loader can be made a bit smaller using the PNG optimisation program PNGOUT.

    For example, I tried running PNGOUT on the few largest PNG files. Here are the before and after file sizes:
    app.png: 6042 -> 5828
    config.png 5174 -> 5174 (no improvement)
    eth.png 5373 -> 5211
    exit.png 4236 -> 4040
    hdd.png 7241 -> 6990
    logo.png 63906 -> 55319
    save.png 2978 -> 2759
    usb.png 4905 -> 4803

    Because most files are fairly small the optimised versions are only a couple of hundred bytes shorter. But the optimised logo.png is about 8.4KB shorter. The total saving for those PNG files is 9731 bytes. Not a huge difference, but it would speed up loading the OPL ELF file ever so slightly.

    I ran all the PNG files through PNGOUT and the result is attached. Total bytes saved: 12897
    Update: I tried again with different settings and got the total size down to 105877 bytes (vs 118956 for the originals), saving 13079 bytes.
    Update 2: Total size down to 105642 bytes, saving almost exactly 13KB.
    Update 3: "Fixed" optimised PNGs zip attached. It turns out OPL can't handle paletted PNGs with transparent colour. It needs all the images to be RGB+alpha.
    Attached Files
    Last edited by mark_k; 03-09-2013 at 04:37 AM.
    AKuHAK likes this.
    Reply With Quote  

  2. #2  
    fresh's Avatar
    fresh is offline Member
    Join Date
    Jul 2003
    Location
    3rd Rock From Sun!
    Posts
    594
    Downloads
    0
    Uploads
    0
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    7
    Likes Received
    46
    Hi!

    Have you noticed most of the png-optimizers destroy gradients?
    Or produce other unacceptable results.

    For me it makes no sense to reduce the elf via png optimizers.
    Maybe i am wrong. Concrete pro examples for that?


    Rgds.
    "Keep the information comin' or we'll never be able to release the power of PS2!"
    IceWater@2002
    Reply With Quote  

  3. #3  
    mark_k is offline Member
    Join Date
    Dec 2010
    Posts
    101
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    7
    Well hopefully, the zip I uploaded with the optmised PNGs should be a good example.

    Compare them with the original OPL PNGs. They should be pixel-for-pixel 100% identical to the originals. If they're not, please let me know as that would indicate a bug in PNGOUT.
    Reply With Quote  

  4. #4  
    fresh's Avatar
    fresh is offline Member
    Join Date
    Jul 2003
    Location
    3rd Rock From Sun!
    Posts
    594
    Downloads
    0
    Uploads
    0
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    7
    Likes Received
    46
    Quote Originally Posted by mark_k View Post
    Well hopefully, the zip I uploaded with the optmised PNGs should be a good example.

    Compare them with the original OPL PNGs. They should be pixel-for-pixel 100% identical to the originals. If they're not, please let me know as that would indicate a bug in PNGOUT.
    Hi!

    Okay. I had a quick look at the files.
    The sources have been optimized before, so it's difficult to say something about the results.

    And, what i said before were my experiences, but one question is still there: Why this?


    Rgds.
    "Keep the information comin' or we'll never be able to release the power of PS2!"
    IceWater@2002
    Reply With Quote  

  5. #5  
    mark_k is offline Member
    Join Date
    Dec 2010
    Posts
    101
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    7
    Why not? Replacing the current PNGs with optimised ones would be an easy way to reduce the file size slightly, which should make OPL ever-so-slightly quicker to load from memory card.

    PNGOUT is supposed to be lossless, so regardless of how the original PNGs in OPL were generated, the output from running them through PNGOUT should be identical in terms of the image content. From what you said, I guess there exist some other PNG optimiser programs which are not lossless; maybe they reduce the size of the palette or something?
    Reply With Quote  

  6. #6  
    fresh's Avatar
    fresh is offline Member
    Join Date
    Jul 2003
    Location
    3rd Rock From Sun!
    Posts
    594
    Downloads
    0
    Uploads
    0
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    7
    Likes Received
    46
    Quote Originally Posted by mark_k View Post
    Why not? Replacing the current PNGs with optimised ones would be an easy way to reduce the file size slightly, which should make OPL ever-so-slightly quicker to load from memory card.
    Hopes and illusions die at last...

    The ps2 has a memory bandwidth of ~3.2 gigabytes per second.
    The mc makes around 50-100kB per second. That would be 0.1-0.2 seconds faster loading @ 10kB reduction.
    Maybe simply load elfs from usb or hdd if the mc is too slow.



    Rgds.
    usrmd likes this.
    "Keep the information comin' or we'll never be able to release the power of PS2!"
    IceWater@2002
    Reply With Quote  

  7. #7  
    AKuHAK is offline Member
    Join Date
    Jan 2012
    Posts
    105
    Downloads
    2
    Uploads
    0
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Likes Given
    37
    Likes Received
    57
    There is such a thing called "double packing". I can explain it:
    Example:
    We have 2 files which are 5Mb and 10Mb. With 7-zip Ultra compression we can archive it both to 1Mb. But if this 2 files firstly pack with zip, we can get sizes, mmmmm...., for example 3Mb un 2Mb. And if we pack this 2 archives with 7-zip ultra compression we get output size 4Mb!!!

    According to OPL. With such manipulation we can reduce size of UNPACKED elf but we will increase size of PACKED elf. And the second why we don't use it - for any program is better to reduce unpacking steps for freeing memory.

    So, frankly speaking, our purpose is to find all archived data in sources and try to alter it with unpacked (raw) data.
    Reply With Quote  

  8. #8  
    fresh's Avatar
    fresh is offline Member
    Join Date
    Jul 2003
    Location
    3rd Rock From Sun!
    Posts
    594
    Downloads
    0
    Uploads
    0
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    7
    Likes Received
    46
    Quote Originally Posted by AKuHAK View Post
    There is such a thing called "double packing". I can explain it:
    Example:
    We have 2 files which are 5Mb and 10Mb. With 7-zip Ultra compression we can archive it both to 1Mb. But if this 2 files firstly pack with zip, we can get sizes, mmmmm...., for example 3Mb un 2Mb. And if we pack this 2 archives with 7-zip ultra compression we get output size 4Mb!!!

    According to OPL. With such manipulation we can reduce size of UNPACKED elf but we will increase size of PACKED elf.
    Interesting point.


    Quote Originally Posted by AKuHAK View Post
    And the second why we don't use it - for any program is better to reduce unpacking steps for freeing memory.
    As i know the ps2-packer stubs use in place unpacking.



    Rgds.
    "Keep the information comin' or we'll never be able to release the power of PS2!"
    IceWater@2002
    Reply With Quote  

  9. #9  
    mark_k is offline Member
    Join Date
    Dec 2010
    Posts
    101
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    7
    Quote Originally Posted by AKuHAK View Post
    There is such a thing called "double packing". I can explain it:
    Example:
    We have 2 files which are 5Mb and 10Mb. With 7-zip Ultra compression we can archive it both to 1Mb. But if this 2 files firstly pack with zip, we can get sizes, mmmmm...., for example 3Mb un 2Mb. And if we pack this 2 archives with 7-zip ultra compression we get output size 4Mb!!!

    According to OPL. With such manipulation we can reduce size of UNPACKED elf but we will increase size of PACKED elf. And the second why we don't use it - for any program is better to reduce unpacking steps for freeing memory.

    So, frankly speaking, our purpose is to find all archived data in sources and try to alter it with unpacked (raw) data.
    I understand your example. However, remember that PNG file compression is done with some knowledge of the image structure, whereas the generic zip/7z compression works for arbitrary data.

    My guess is, if you were to build an OPL ELF with the optimised PNGs, the final size after ps2packer would be smaller than the original/release OPL ELF.

    If you want to try building OPL using uncompressed PNGs, check the archive attached. It contains all the PNGs in OPL uncompressed. For example logo.png expands in size to 405489 bytes uncompressed.

    Update: "Fixed" uncompressed PNGs zip attached. It seems OPL doesn't work with paletted PNGs where one palette entry is transparent. It needs RGB + alpha images.
    Attached Files
    Last edited by mark_k; 03-09-2013 at 04:38 AM.
    Reply With Quote  

  10. #10  
    fresh's Avatar
    fresh is offline Member
    Join Date
    Jul 2003
    Location
    3rd Rock From Sun!
    Posts
    594
    Downloads
    0
    Uploads
    0
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    7
    Likes Received
    46
    Hi!

    Quote Originally Posted by mark_k View Post
    My guess is, if you were to build an OPL ELF with the optimised PNGs, the final size after ps2packer would be smaller than the original/release OPL ELF.
    Nop. You have not understood AKuHAK's words and the "doubler effect".


    Rgds.
    "Keep the information comin' or we'll never be able to release the power of PS2!"
    IceWater@2002
    Reply With Quote  

Page 1 of 2 1 2 LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •