Image Optimization for renpy

Raw Magic

Gangster
Game Developer
Feb 2, 2021
165
1,170
Hello Guys. I am working on my first game and i wanted to make it as optimized as possible without losing quality ( render quality is my main focus here ). I am rendering in 1440p and than turning back into 1080p again using photoshop ( i saw that tip to reduce grain without using the denoiser but i don't see great difference).

But the images are getting too big and i am afraid that the game is getting heavy. So, some doubts got in my head like, what type of image should i use ? jpeg png or other ? should i compress the image ? there's other program that i can use to shrink the images in bulk that isn't photoshop ? any other tip that you guys can give me i will be glad!
 

DoubleLust

Member
Feb 16, 2021
101
297
Jpeg.

compressed your image to 1/4.
only time you will need a non compressed image is for extreme close ups or an animated scene that zooms in on a character
otherwise no ones going to tell the difference.
You don't have permission to view the spoiler content. Log in or register now.
 
  • Like
Reactions: Raw Magic

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,504
8,040
WEBP (Images) and WEBM (Videos).

I assume you are using the flawed design of rendering an image every sentence, if that is the case, you'll just have to accept that your game will reach a pretty big size... Unless you want to compress it down to oblivion (along with its image quality).
 
  • Like
Reactions: Raw Magic

SecretSal

Active Member
Aug 25, 2016
797
1,888
I've been using as my default image viewer for almost 2 decades now. It can batch convert to most image formats, including WEBP, which is probably your best bet for image optimisation if they are large fullscreen-size images.
 

DoubleLust

Member
Feb 16, 2021
101
297
1113089_Scarlet10.jpg

test out each option, IrfanView is very easy to batch export, it can be done in photoshop but that's a few more steps
WEBP and JPEG both have drawbacks depending how much you compress them.

I've been using
havent used Irfanview since modding days in Half-Life, but for some reason it adjusts the color range of the imported image
 
Last edited:

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,504
8,040


WEBP is the way to go.
It also supports transparency, so you can use it for sprites as well.

It goes without saying that as the developer, you need to deliver the best quality possible, so you should still distribute lossless and let someone else break it down in order to save up a few hundred MBs.
 

DoubleLust

Member
Feb 16, 2021
101
297
It also supports transparency
Would be the biggest reason to use WEBP.

Wonder if using the photoshop plugin for WEBP will produce better results.
At least exporting through IrfanView, the Jpeg had a sharper image and better detail



decided to look more into it, that article explains some issues along with the comment section on WEBP vs JPEG
 
Last edited:

SecretSal

Active Member
Aug 25, 2016
797
1,888
havent used Irfanview since modding days in Half-Life, but for some reason it adjusts the color range of the imported image
Interesting to see the side-by-side! I should probably check the settings and see what side-by-side differences there when using settings like Resample, auto-adjust colours, etc while converting.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,258
[...] any other tip that you guys can give me i will be glad!

Conventional wisdom is to use .jpg files for background images and .png for foreground sprites/buttons/etc.
Render everything to as big as a .png as you have the time and patience for, then convert as appropriate. Maybe even downscale to 1080p or 720p if you'd like.

Keep your render images and the images used by the game separate (any post production editing is much easier on the higher quality renders).

If your game is good enough, hardly anyone will care if it's 7GB. In fact, some people will even mistake that for quality.
I'm not suggesting making a game that big, just saying that maybe don't worry about it.

[...] there's other program that i can use to shrink the images in bulk that isn't photoshop ?

If you really want to save space, there are batch tools like Cruncher here on F95. Cruncher converts all the images in the /images/ folder and subfolders to .webp and .webm formats. It's only a batch file and you can edit the command lines to alter the quality settings used if you'd rather aim for "a bit smaller" rather than "tiny" (not for the for faint of heart, but not hard either). It's a destructive process though, with the resulting files overwriting the original files (RenPy doesn't care that it finds a .webp file called myimage1.jpg, for example).
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,557
If you are using photoshop just save them as .jpg with a quality of between 8 and 10. There is no need to install another program and then do another step as well.
 
Apr 24, 2020
192
257
One way of optimizing that I haven't yet seen mentioned is separating the elements into individual images.
The classic example is a scene with a single background, a few of different characters (depending on your path) with several different facial expressions.

Whilst you could just render each combination, it takes a lot less space if you simply have an image that covers the default face with a different expression rather than changing the entire scene.
 
  • Like
Reactions: Raw Magic

Raw Magic

Gangster
Game Developer
Feb 2, 2021
165
1,170
Yeah, i am exporting the characters and the BG and them i am using actions on photoshop to glue everything together in a batch. This pipeline is being very good and fast to work with. Thank you guys !
 

TDoddery

Member
Apr 28, 2020
175
167
One way of optimizing that I haven't yet seen mentioned is separating the elements into individual images.
The classic example is a scene with a single background, a few of different characters (depending on your path) with several different facial expressions.

Whilst you could just render each combination, it takes a lot less space if you simply have an image that covers the default face with a different expression rather than changing the entire scene.
Old fashioned but it works for me as it also means less rendering. Just spot render the differences.