Tool Others Ren'Py Booom313's Decompiler + Multi Threaded Image Compressor

booom313

Drama Queen
Modder
Donor
Game Developer
Sep 14, 2016
107
392
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



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.



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!


 

GAB

Salty Montrealer
Donor
May 10, 2017
2,334
17,475
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
 

booom313

Drama Queen
Modder
Donor
Game Developer
Sep 14, 2016
107
392
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
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!
 

Papa Ernie

Squirrel!?
Uploader
Donor
Dec 4, 2016
12,327
47,047
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!
FYI: Files <10MB can be uploaded as an attachment. Yo, Joe!
 

muttdoggy

Dogerator
Staff member
Moderator
Aug 6, 2016
7,793
43,341
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??
 

booom313

Drama Queen
Modder
Donor
Game Developer
Sep 14, 2016
107
392
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??
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
 

GDS

Best Dev EVUR!
Game Developer
Jul 19, 2017
967
2,124
hum..
How do I knwo its working?
no progress bar, no nothing
Im using to compress a folder full of PNG
 

osmcuser132

Well-Known Member
Modder
Aug 8, 2017
1,005
3,691
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
 
  • Like
Reactions: GreeneMotion

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,948
14,548
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 [...]
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.


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
Then stop declaring every single picture used. and 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.
 
  • Like
Reactions: bas

osmcuser132

Well-Known Member
Modder
Aug 8, 2017
1,005
3,691
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.
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.

anne O'nymous said:
Then stop declaring every single picture used. and are pretty useful tools
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.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
9,948
14,548
I attached an example to my post, you can check the quality for yourself.
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.
 

GreeneMotion

Newbie
Oct 1, 2017
69
39
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
How? Any releted post or software suggest plz...