Others Has anyone tested ideal image compression in JPEG/WEBP?

Crepusculum

Member
Jan 4, 2018
276
266
Hey guys,
I'm banging my head against the wall here trying to get the ideal format/settings for near-lossless with minimal image size

I've been playing around with XnConvert, and choosing quality 90 with any method (Which i don't understand the difference in) gives near identical results. With method 6, i get the smallest possible file (5.54mb to 301kb) i could, and when compared side by side with the original PNG - but there are still differences, but i was relatively happy with the result.

I then realized JPG has a ton of compression settings too, and then i saw JPEGXL, etc.

So before i spend days mapping every possible combination of configuration and comparing everything, is there any conclusive answer someone already reached?
thank you!
 

Rell games

Newbie
May 5, 2020
62
74
Not sure what the ideal settings and format are, but I ended up using webp with a 95% quality using the . Size varies, from 150kb to 400kb, but the quality is close to the lossless one to the rate that you can't tell the difference anymore. Would be great to hear from other devs on this topic
 

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,375
8,643
From another thread:

"There's still noticeable quality loss in the form of banding in nearly every render you do it on. Untouched (left), WebP Lossy at 95% (right):

ql.png

Now, whether that's a passable/acceptable tradeoff for a dev or not is up to the individual developer, of course. In my opinion, it's not. 1080 Lossless WebP is still under a megabyte in a lot of cases. Unless you're working with a BaD-sized VN, that's perfectly fine."

Lossless WebP is both faster and easier than most alternative options. At least as far as current Ren'py-compatible image formats go. There's certainly better out there than WebP currently, but none that really work with Ren'py. Assuming that's what you're looking to use the compressed images with.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,191
I'm banging my head against the wall here trying to get the ideal format/settings for near-lossless with minimal image size
There's nothing like an ideal setting. Ideally, if really you want to keep the highest possible quality while still having a significant size reduction, you should define the compression factor image by image.
 
  • Like
Reactions: Crepusculum

Corvus G.

Newbie
May 19, 2019
72
150
I had the same questiions a few day ago. Apparently the best thing format is Webp in terms of size and compatibility. There are probably smaller formats, but they will probably cause issues. Plus, unless your game is already big in terms of content, size is not really that big of an issue. So yeah, webp is the way to go, either lossless or around 90-95% quality
 
  • Like
Reactions: Crepusculum

Crepusculum

Member
Jan 4, 2018
276
266
From another thread:

"There's still noticeable quality loss in the form of banding in nearly every render you do it on. Untouched (left), WebP Lossy at 95% (right):

View attachment 2380628

Now, whether that's a passable/acceptable tradeoff for a dev or not is up to the individual developer, of course. In my opinion, it's not. 1080 Lossless WebP is still under a megabyte in a lot of cases. Unless you're working with a BaD-sized VN, that's perfectly fine."

Lossless WebP is both faster and easier than most alternative options. At least as far as current Ren'py-compatible image formats go. There's certainly better out there than WebP currently, but none that really work with Ren'py. Assuming that's what you're looking to use the compressed images with.
First of all let me say, that render and lighting are very pretty.
and it's a good point about resizing, how do you resize without any additional detail loss while converting to WebP?

There's nothing like an ideal setting. Ideally, if really you want to keep the highest possible quality while still having a significant size reduction, you should define the compression factor image by image.
is that really realistic for an AVN though?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,957
16,191
is that really realistic for an AVN though?
It depend how many images you'll have. But the best compromise is probably to select a bunch of images (a dozen should be enough) that really differ (a big uniform background, a bright light, a dark image, one character, many details, etc.) and test the different compression factors with each.
Then now you have a compression factor that will give you a reasonable result depending of the kind of images. Starting there, you have to do is to split the images in a "x factor", "y factor", directory depending of the nearest model (big uniform background with big uniform background), compress them accordingly, and regroup them again in the game image directory.
A bit annoying, but it's either that, or a game that will never fully satisfy you, either in terms of quality or in terms of size.
 
  • Like
Reactions: Crepusculum

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,375
8,643
First of all let me say, that render and lighting are very pretty.
Thanks. :)

how do you resize without any additional detail loss while converting to WebP?
I usually resize the render after doing postwork in Photoshop. I basically do the postwork > CTRL + ALT + I to downsize to 1920x1080 > File > Save As > Change the File Format to WebP > Lossless > OK.

Or (just don't do both of them.) you could do all the postwork and save them out in whatever your render size is in its native file format and then batch (meaning all of the renders) downscale to 1080 and convert them all to Lossless WebP at the same time.

Either way works fine and neither have any real quality degradation, just depends on your process and workflow.