1st Release TOO Big?

Mikethe3DGuy

Member
Game Developer
Mar 14, 2019
233
449
I've been working on my (first) VN for a while, and I'm almost done creating all the content (still images, animations, sound files). Next step is choosing music, then Ren'Py coding.

I just reviewed all my content and I'm wondering if there are issues with total size. Here's the breakdown:

  • 640 stills (1920x1080 png) - total 1.7GB
  • 3 animations (1920x1080 H.264 MP4) - total 94MB
  • 250 SFX & voice files (.ogg) - 50MB
Still need a few more voice files, and all music files, so that total will go up a bit. I'm worried that the total payload for the stills is high. Since I'm new to this I don't know if THAT is a problem. Also, is my filesize per image unusually large, or okay? Created them as PNGs - is that common, or just a dumb waste of space? Never actually thought about it tbh - just wanted high quality - but it looks like converting to JPGs might cut the payload down hugely. I'm not using transparency, so there may be no valid reason not to convert.

Comments?
 

c3p0

Forum Fanatic
Respected User
Nov 20, 2017
5,536
13,142
No, yes, maybe. It all depends on the game and the quality of it.
If you want shrink the file size, then use wepb (and not jpg). The size will only go up, even as I and others like me don't have a problem to download a few GB others will have.
Also different download site have different restrictions and for Mega, who is one of the popular ones, it is normal around 5 GB. So, from your initial size only a total of 3 release fits in that limit.

It is up to at the end of the day, but the size will some to avoid this - same case would be if the size was very small, because a very high compression.

As example Harem Hotel current size is around 10 GB with wepb. "Uncompress" PNGs and you would have around 90 GB.
 

Mikethe3DGuy

Member
Game Developer
Mar 14, 2019
233
449
If you want shrink the file size, then use wepb (and not jpg).

As example Harem Hotel current size is around 10 GB with wepb. "Uncompress" PNGs and you would have around 90 GB.
It's a little puzzling when I test-convert my png files to webp because the file size ratio is not what I'm reading it should be. Just took a 2.55MB png and converted it to webp. It went down to 59kb. Webp is supposed to be about 1/4 the size of png, but my test has it at about 1/43 the size... so 10x smaller than I expected. Are there different compression ratios or quality levels for webp? I see no options like that in the program I'm using, which is Irfanview.

Thanks
 

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,371
8,637
So, c3p0 basically hit the nail on the head. I'll add a bit to the WebP side, though.

There's WebP at XX%. You'll often see 90%, 95%, or 98% as the given number. While you'll see noticeable banding/artifacting on either (specifically the former two), the file size given is hard to argue with. Often within a few hundred kilobytes depending on the size of the image/render. Whereas there's Lossless WebP, and while slightly larger than standard WebP/95% at about 1MB or so, it retains all of the quality while often more than halving size.

Here's the banding you'll often see with WebP (left is untouched 4K, right is WebP at 95%):

ql.png

Here's the Lossless WebP version at 4K:

Lossless4K.png

But you're obviously not making your VN at 4K, so downscaling to 1080 + Lossless WebP:

lossless1080.png

Whether that size difference is worth it to you or not is a choice that can only be made by you. Banding sticks out like a sore thumb to me, so it's worth the extra size, but it may not be for you or another John Doe. At the end of the day, it's just about finding the right balance between quality and file size (and type, I suppose, given that Ren'py doesn't support a ton of the more superior file formats currently out there. Hopefully that helps a bit.

Edit: Photoshop and XnConvert can both downscale and convert (or export/"Save As" to WebP.). The latter being free.
 

JeFawk

Newbie
Game Developer
Mar 8, 2023
93
82
Easiest: get an image compressor like ImageOptim (mac) or Pngyu (windows) and compress the png files 80% ish. The quality difference will not be noticeable almost at all but you'll save up on A LOT of space. Try to avoid compressing anything with blur or very smooth color differences (it can turn to sharp gradient after compresion).

Don't use Webp: Webp is not fully supported yet, also it's more of a format for web stuff, not exported programs. Also last I compared a webp vs an optimized .png (a few months ago) I found that the latter was smaller in size. Another disadvantage with webp is that it cannot be compressed further (not sure why, I couldn't find any tools)

Most optimized: If you want to be a bit more optimized, you can change the format of the files into JPG, with quality loss.

Why compressions appears to work best with png?
They remove the alpha information per pixel that doesn't need it. So the compression tool shows stuff like 80% saved space, however vs a similarly compressed .jpg, the compressed png might still take up more space.

You might want to look at the end result export from ren'py. I'm not too familiar with it, but some game engines take the file, then fuck about with it, and export it again. So if you feed them a very compressed 1mb file, they might save it again, and put it back as 3mb, with compressed quality.
If this is the case, you can simply compress only the output of the game engine.

This is an example of an 3000x1684 uncompressed png, a mid-compressed jpg (50-60%), and a compressed png

Uncompressed 4.5mb:
no-compression-png.png

Compressed png (1.3 mb):
compressed png.png

Compressed jpg:
jpg-mid-compression.jpg

Took the uncompressed png and turned into a 3.4 mb webp (for some reason it doesn't show to display?):
View attachment no-compression-png.webp

At the end of the day, you have to figure out what workflow suites you best. You need to try different methods as different compressions work better or worse, depending on what type of art you have.

Good luck! Tell me how it goes, I find this a very interesting topic.
 
  • Like
Reactions: Mikethe3DGuy

Rell games

Newbie
May 5, 2020
62
74
Don't use Webp: Webp is not fully supported yet, also it's more of a format for web stuff, not exported programs. Also last I compared a webp vs an optimized .png (a few months ago) I found that the latter was smaller in size. Another disadvantage with webp is that it cannot be compressed further (not sure why, I couldn't find any tools)
I can't agree with this, according to Renpy's official documentation, the Webp format is at the top of the list they recommend using.
1678699621339.png
My workflow with webp is quite simple yet effective: use an addon for Photoshop that allows you to export files in webp format, and then automate the process using batch functionality to convert the entire folder of images into webp. 700 images with a 95% compression ratio with the slowest mode of compression gives around 250 MB as a result.
 

JeFawk

Newbie
Game Developer
Mar 8, 2023
93
82
I can't agree with this, according to Renpy's official documentation, the Webp format is at the top of the list they recommend using.
View attachment 2463183
My workflow with webp is quite simple yet effective: use an addon for Photoshop that allows you to export files in webp format, and then automate the process using batch functionality to convert the entire folder of images into webp. 700 images with a 95% compression ratio with the slowest mode of compression gives around 250 MB as a result.
Would be interesting to know on say, a few images, how the size difference would be vs compressed png, and compressed jpg.

I found a very old but possibly useful thread about it, explains and links to the Photoshop plugin required:
 
  • Like
Reactions: Mikethe3DGuy

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,371
8,637
explains and links to the Photoshop plugin required:
Photoshop added support for it (finally) sometime last year, iirc. I think it's natively compatible with most of the Adobe suite at this point.
 

Mikethe3DGuy

Member
Game Developer
Mar 14, 2019
233
449
Too many to directly respond to here, but thank you all, this has been very helpful!

I downloaded pngyu and tested it. It's a bit of a blunt instrument but I compressed a folder of PNGs. Not sure what % compression since there's no number but I used the default setting (two clicks from "high quality" which I assume would be 20%?). Took a 2.5MB file to about 0.8GB which is great. I do see some slight image degradation but I'd say it's probably acceptable for me.

I installed a webp plugin to Photoshop from github and converted the same file as above to losslesss webp. This dropped the filesize to 1.8MB. Not sure if that's going to be enough of a reduction though. I'll try some levels of webp loss % and see how it compares to my pngyu sample when I reach a similar file size.
 
  • Like
Reactions: JeFawk

cooperdk

Engaged Member
Jul 23, 2017
3,503
5,160
I can't agree with this, according to Renpy's official documentation, the Webp format is at the top of the list they recommend using.
View attachment 2463183
My workflow with webp is quite simple yet effective: use an addon for Photoshop that allows you to export files in webp format, and then automate the process using batch functionality to convert the entire folder of images into webp. 700 images with a 95% compression ratio with the slowest mode of compression gives around 250 MB as a result.
I can't agree with your non-agreement. Ren'Py is actually too slow to handle webp with an acceptable speed; webp requires more computer power than JPG. Much more (webp uncompresses almost three times slower than JPG).
You should only use webp for compressed game versions, and JPG for regular ones (PNG if you need opacity).

The main issue with Ren'Py "developers" is that they often have no comprehension of the term "compression" at all. I sometimes see 1.5 GB games with 200 images and one video. These are people who need to take a course first. This also happens with both Unreal and Unity developers.
 
  • Like
Reactions: hiya02

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,188
Ren'Py is actually too slow to handle webp with an acceptable speed;
:ROFLMAO:

You don't have permission to view the spoiler content. Log in or register now.
Ren'Py can compute and draw the seven rasters, and move the logo, in real time, but wouldn't be able to handle a WEBP file processed few interactions before it's needed, doing it in all the free time it have while the player read the text...

Yeah, sure...
 

cooperdk

Engaged Member
Jul 23, 2017
3,503
5,160
:ROFLMAO:

Ren'Py can compute and draw the seven rasters, and move the logo, in real time, but wouldn't be able to handle a WEBP file processed few interactions before it's needed, doing it in all the free time it have while the player read the text...

Yeah, sure...
Right. Renpy is based on a really old framework which didn't support webp so it was programmed in afterwards. And webp has never been meant for fast image switching. It is a format specifically for websites/static images that can load asynchronously.

JPEG is actually considerably faster because the compression algorithm in webp is much more advanced and requires many more calculations. I did a test once and it is three times slower than JPEG.

But hey, what do I know. I am just an ex photographer and photo/video editing professional.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,188
Right. Renpy is based on a really old framework which didn't support webp so it was programmed in afterwards.
What mean absolutely nothing. It's not because a codec is implemented afterwards that its implementation will not be optimized.


And webp has never been meant for fast image switching.
Who care about this ?

No, really, who care about this ?

It's not webp, jpeg, png, or whatever, images that will be used for fast switching, it's pure bitmaps. Because it's what will be in memory, and therefore what will be used, when the time will come for Ren'Py to switch from an image to another.
The only moment when the format matters, is when Ren'Py preload the image. But its doing this far before the image will be needed, what mean that it will have all the time it want for this. And like it will do it in a thread, it will not block the game.
You don't have permission to view the spoiler content. Log in or register now.


JPEG is actually considerably faster because the compression algorithm in webp is much more advanced and requires many more calculations. I did a test once and it is three times slower than JPEG.
Well, a chance that what matters here is the decoding.



But hey, what do I know. I am just an ex photographer and photo/video editing professional.
Yeah, so someone who know shit about coding, what explain why you are saying a lot of bullshit.