1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Ren'Py] [Others] Booom313's decompiler + multi threaded image compressor

Discussion in 'Tools & Tutorials' started by booom313, Feb 5, 2018.

  1. booom313

    booom313 Drama Queen Modder Donor Game Developer

    103
    280
    Sep 15, 2016
    Hello i'm here to release my costume build compressor/renpy decompiler.

    I created this tool after i got into porting games to android and didn't want to spend a lot of time decompiling the game and compressing it.

    this tool decompiles and compresses games in +- 10 mins.

    the compresion is lossy but you don't notice any quality loss,
    it's based on pngquants compression.

    this compressor is faster than normal pngquant compression because it uses multi threading (meaning multiple files are compressed at 1 time) instead of the 1 after the other like pngquant normaly does

    [​IMG]

    How to use my tool:

    open up the folder and open compression.exe

    the options do the following:

    1.) this will compress all png's and jpgs in a folder + all the subfolders
    2.) will extract rpa packages and compress all the png's and jpgs
    3.) does the same as 2 but also enables developer mode ( enables console usage etc.)

    The buttton on the bottom will toggle if a rpyc decoder is put in the /game folder

    you'll need to start the game up first for the rpyc decoder to start working.


    [​IMG]
    this is how you'll select the folder
    (you'll have to select the main .exe folder of the game to make the renpy decoder work)

    Hope you guys like the tool!
    if you guys have any suggestions to add something to it please mention it in the comments!


    Please Log in / Register to view this link

     
  2. Ryahn

    Ryahn jande21 is not the law Staff Member Moderator Donor

    1,414
    3,634
    Jul 5, 2017
    lossless :p
     
  3. tombfall

    tombfall Active Member

    144
    70
    Oct 6, 2016
    Welcome back Boom!
     
  4. booom313

    booom313 Drama Queen Modder Donor Game Developer

    103
    280
    Sep 15, 2016
    [​IMG]

    don't think so . . .
     
  5. Ryahn

    Ryahn jande21 is not the law Staff Member Moderator Donor

    1,414
    3,634
    Jul 5, 2017
    You're lossy <3
     
  6. Gab

    Gab Salty Montrealer Uploader

    843
    2,137
    May 10, 2017
    little bit of feedback. enlarge and bold the text for What it does, How to extract, and How to use as titles
    And I can't see the files on the OP, seems you didn't add the file as .zip or similar
     
  7. booom313

    booom313 Drama Queen Modder Donor Game Developer

    103
    280
    Sep 15, 2016
    yeah if forgot to add the mega download link to the release post

    it has been a little while since i last used this site XD

    sorry about that!
     
  8. jerricho13

    jerricho13 Well-Known Member Donor

    1,842
    230
    Dec 4, 2016
    FYI: Files <10MB can be uploaded as an attachment. Yo, Joe!
     
  9. Godwyn

    Godwyn New Member

    3
    0
    Nov 18, 2017
    Sounds very useful booom
     
  10. muttdoggy

    muttdoggy Dogerator Staff Member Moderator

    5,863
    13,515
    Aug 6, 2016
    Welcome back, @booom313 . Since I'm not familiar with pngquant compression, I have a couple of questions..
    1- Does this work well with dual core CPUs?
    2- What is the average compression ratio and/or loss?

    Edited.. I assume the results are uncompressed so compressing the folder will further reduce the size for storage/backup purposes??
     
  11. booom313

    booom313 Drama Queen Modder Donor Game Developer

    103
    280
    Sep 15, 2016
    Alrighty.

    1.) It should but it'll take a little longer to compress due to lack power.

    2.) The standard size reduction is around 60% +-

    3.) Correct! It is just a diffrent way of storing png's and jpg's so they take up less data but look the same to us humans.

    If you lets say zipped them it will also get smaller.

    Also i'm glad to be back mutt <3
     
  12. GDS

    GDS Active Member Game Developer

    163
    267
    Jul 19, 2017
    hum..
    How do I knwo its working?
    no progress bar, no nothing
    Im using to compress a folder full of PNG
     
  13. osmcuser132

    osmcuser132 Active Member Modder

    348
    652
    Aug 8, 2017
    Since we are talking Ren'Py: Why don't you just convert all images to WEBP format?
    In my last conversion that brought the size of PNG images down from 1.8GB to 206MB which is about an 89% size reduction and I set the RGB channel compression to 90% (-q command line option).

    original PNG 1.3MB
    WEBP 100% => 386K
    WEBP 90% => 111K
    WEBP 60% => 42K

    Granted, you probably also need to change all in-game image declarations from .png/.jpg/.jpeg to .webp but that could also be easily done with some reg-ex
     

    Attached Files:

  14. anne O'nymous

    anne O'nymous Well-Known Member Modder

    981
    882
    Jun 10, 2017
    Reading this, I fear for the quality of the pictures. That modern compression algorithms can do better than PNG's one, I agree and find it natural. But dividing by 9 the size of an already compressed picture without (a visible) lose, seem really impossible to me.


    Then stop declaring every single picture used.

    Please Log in / Register to view this link

    and

    Please Log in / Register to view this link

    are pretty useful tools :
    Code:
    define config.automatic_images = [ '/', '_' ]
    define config.automatic_images_strip = [ "images" ]
    
    Is all you need to have all your pictures automatically declared for you by Ren'py.

    Let's say you have these two pictures :
    [main directory]/game/images/character/mc_sleeping.png
    [main directory]/game/images/location/bedroom/night.png
    With these two configuration lines, you can now address them with :
    Code:
       scene character mc sleeping
       scene location bedroom night
    
    And obviously, you can change the format, and so the extension, as often as you want, without having to change a single line of your code.
     
    bossapplesauce likes this.
  15. osmcuser132

    osmcuser132 Active Member Modder

    348
    652
    Aug 8, 2017
    I attached an example to my post, you can check the quality for yourself. Most modern web browsers can open WEBP files if you don't have a supported image viewer installed.
    Also WEBP can do lossless and I tested it on the PNG in the example and even then reduced the size by 100K.

    Trust me, I don't do this, but he created this tool for porting to Android and many game developers declare every single picture used.
     
  16. anne O'nymous

    anne O'nymous Well-Known Member Modder

    981
    882
    Jun 10, 2017
    chill-100 is acceptable, but 90 start to smooth too much the wall texture. And the 60 blur the motif of the towel.
    This said, it's better than I expected, the algorithm clearly try to keep track of the forms, which lead to a blur effect more than a mosaic one like for JPEG. Still, it feel like I forgot to put my glasses, which is annoying. But there's probably other possible parameters to achieve a better rendering while still having a smaller size.
     
Loading...