Reducing size of renders

Agent HK47

Active Member
Mar 3, 2018
649
1,949
Alright, I only recently joined this forum, as people can probably see, but I have been lurking around for a good while before that.
I am currently playing around with the idea of making my own adult VN/dating sim, and as I result of that, I recently got daz studio and learned the basics of the program from YT and the provided tutorials from daz itself.

I have been doing some test renders of a fairly simple scene, which turned out alright. Took 10-15 mins per render, and the quality looks pretty good. Now, the thing is that the size of the images are still too large for my liking. They hang around 3-4 MB each (1920x1080) and I would like them to get down to half of that at the least, since I dont want the game size to suffer too much from the size of the images.
Would like some pointers as to how I could get the best combination of quality, render speed and image size. I render with Iray on a GTX 980TI and I save my renders as PNG (1920x1080)

I tried messing around a little on my own, reducing max samples from 5000 > 1000, but that didn't change file size or quality (unless I am blind), so I would appreciate some tips from people who have more experience with this stuff.
Also, I tried to load the finished render into Gimp and export it to web, hoping to able to be able to lower quality a little, as I have seen on YT, but the quality slider wasn't there. Maybe I am just an old fool (definately not to be ruled out), but am kinda confused as what the hell to try next.

Anyway, I am going to bed, and gather energy for some more experimenting tomorrow, hopefully with some new tips and tricks in my pocket.

Thanks for taking the time to read all these many characters of the alphabet for little ol' me :biggrin:
 
  • Like
Reactions: Palanto
U

User_10739

Guest
Guest
I use PNGoo to compress the images. It's a free program and does an excellent job.
 
  • Like
Reactions: Dinker

Aeilion

Member
Jun 14, 2017
125
144
For me, the best is to save your render in .tif, open it on gimp and work the sharpness (and any other necessary editing) before exporting it in .jpg / .png
Then you can potentially reduce the size with other programs but I think we are already pretty good at that moment.

Never record directly in .jpg or .png because you will almost always finish with a reduction of quality compared to what you have in the preview because of the compression and without work on the sharpness, it's not great.
And as you are always losing more quality with each compression, it is better to start by recording in a format that offers the least loss of quality.

I will add that if you do not have transparency in your rendering it is better to leave on .jpg than .png.
 

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,839
Well it depends on what you want to do with the images.... In my case I'm using ren'py which has great support for .webp which is why I downloaded this converter .... But engines like RPGMaker i.e. don't support it so in that case you wouldn't be able to use it. I usually set the converting to lossless, 100% Quality and Level 6 Compression, which is a little slow but it keeps the quality and reduces the filesize at least by 25-30%, the standard settings are 60% quality iirc and 3 compression with a lossy conversion. Which would reduce the size by about 60% but also reduces the quality of the image a bit and doesn't keep the transparency, which lossless does.
 
  • Like
Reactions: anne O'nymous

Agent HK47

Active Member
Mar 3, 2018
649
1,949
Thanks for the suggestions guys, I am already seeing some drastic improvements in filesize after applying some of your tips. Now, onwards to mess around with genitals and trying to see if I can make a somewhat decent sexual render. This should be fun, but I have a feeling I am about to embark on a journey of frustration :p
 
  • Like
Reactions: Palanto and Dinker

Rich

Old Fart
Modder
Respected User
Donor
Game Developer
Jun 25, 2017
2,478
6,965
You'll probably find that a decent quality JPG is good enough for your game. One way to quickly do that is to use ImageMagik. It's a command line utility.

magick input.png -quality 90% output.jpg

will both convert a PNG to JPG, but also decrease (slightly) the image quality. Makes a HUGE difference in file size. Even the JPG's that Daz will output directly (if you select JPG instead of PNG) are really high quality, and can be significantly reduced the same way. You can experiment with the % value to find the optimum tradeoff between file size and apparent quality. (The latter being very subjective.)

But since PNG has (virtually) no compression at all for photographic images, it's not the greatest choice for embedding in a game if you don't want it to be massive.
 

Deleted member 167032

Alternate Existence
Donor
Game Developer
Aug 16, 2017
2,719
4,931
Yep is what i do... DAZ rendered png is around 8mb after a quick Save for Web Photoshop resize it's under 1mb. I do resize them also to 1920x1080 as most players will be using this size and under.

Render in 1080P via DAZ. Export as .jpg via Photoshop. Will lose about 5/10% of the quality. But will rersult in massively smaller file sizes.
 

gue5t

Active Member
Sep 11, 2016
594
1,028
I use PNGoo to compress the images. It's a free program and does an excellent job.
PNGoo - lossy compression of PNG images == quality loss.

For me, the best is to save your render in .tif, open it on gimp and work the sharpness (and any other necessary editing) before exporting it in .jpg / .png
Then you can potentially reduce the size with other programs but I think we are already pretty good at that moment.

Never record directly in .jpg or .png because you will almost always finish with a reduction of quality compared to what you have in the preview because of the compression and without work on the sharpness, it's not great.
And as you are always losing more quality with each compression, it is better to start by recording in a format that offers the least loss of quality.

I will add that if you do not have transparency in your rendering it is better to leave on .jpg than .png.
You'd better check your facts... (reconversion vs compression)

You'll probably find that a decent quality JPG is good enough for your game. One way to quickly do that is to use ImageMagik. It's a command line utility.

magick input.png -quality 90% output.jpg

will both convert a PNG to JPG, but also decrease (slightly) the image quality. Makes a HUGE difference in file size. Even the JPG's that Daz will output directly (if you select JPG instead of PNG) are really high quality, and can be significantly reduced the same way. You can experiment with the % value to find the optimum tradeoff between file size and apparent quality. (The latter being very subjective.)

But since PNG has (virtually) no compression at all for photographic images, it's not the greatest choice for embedding in a game if you don't want it to be massive.
If 10% quality loss is slight ... and I would check on the PNG compression topic before repeating that statement.

Render in 1080P via DAZ. Export as .jpg via Photoshop. Will lose about 5/10% of the quality. But will rersult in massively smaller file sizes.
I believe the default PhotoShop setting for jpg export was set at 75% ...

Using .tiff is pointless now when you can use .png instead (same quality with smaller size), if you can easily re-render the images when needed and don't intend to do post render modifications you can export them directly to .jpg if not you should go for .png (convert to .jpg when finished if you like to) but no mater which one you choose don't forget to clean and optimize the images before releasing them. Once you decide on your approach you can upload a few sample images (in a zip file because the forum is resizing and "optimizing" uploaded images) and we can recommend what can be done to optimize them with or without quality loss depending on your preferences.
 

Agent HK47

Active Member
Mar 3, 2018
649
1,949
Well, the reason why I went with PNG is that it has been my favourite img format for countless years, due to the superb quality and compatability it offers. However, for the time being, I have settled on using jpg instead, and see how the results turns out. A slight sacrifice in quality is something I am willing to accept, if it keeps the game at less than half the size of what it would otherwise be.

In any case, it will be some time before any of you will be seeing any concrete results. I am mostly doing this game for my own amusement, and even though I hope to release it to the public at some point, I won't be doing it until there is enough content to actually have it feel like a game, and not a snapshot of a game.
Also, it will take a bit to gather the required materials for the game. Seeing as how I am doing the game for my own sake, I don't find it fair to open a patreon page to support it. This is also due to my vision of the game being in conflict with patreon's new TOS, so I find it much simpler to just take them completely out of the equation. Basically, this means I will be funding everything in the game out of my own pocket and when (and IF) the time comes, I will release the game free of charge. This way, I don't have to feel stressed about making other people satisfied and can make sure the game is my own vision, and if it fails, it will all be on me alone.

If the game is positively recieved, then I might try to release more games with patreon support, but that is wayyyyy too far in the future for me to think about right now. For the time being, I am just trying to make a solid foundation, on which I can build something entertaining for myself.
 

gue5t

Active Member
Sep 11, 2016
594
1,028
You don't need to upload game renders, as long as the renders are going to use the same rendering settings a room with a generic model should be enough to test the possible image formats and optimizations. And once you have decided on the image format it's up to you if the game will see the light of day or stay private.
 

Agent HK47

Active Member
Mar 3, 2018
649
1,949
I am not planning on uploading the renders by themselves, but the size of my image files will inevitably affect the size of my game when i upload it sometime, and I dont want it to be countless of gigabytes for people to download it. I just want to find the right image format from the start, so I won't have re-render every image when I am finished.
 

8873672413434

I Steal Your Cats
Donor
Oct 4, 2017
369
302
I am not planning on uploading the renders by themselves, but the size of my image files will inevitably affect the size of my game when i upload it sometime, and I dont want it to be countless of gigabytes for people to download it. I just want to find the right image format from the start, so I won't have re-render every image when I am finished.
720-1080P tends to be a good render for games. Be pointless going any lower. By all means.. Go all the way to 4K Res.. But.. While the renders look amazing. It'll take a hella lot of time.
 

Agent HK47

Active Member
Mar 3, 2018
649
1,949
720-1080P tends to be a good render for games. Be pointless going any lower. By all means.. Go all the way to 4K Res.. But.. While the renders look amazing. It'll take a hella lot of time.
Well, currently most of my renders have taken about 10-15 mins on average, in 1080p Iray, so I guess that 4K wouldn't be too bad. I also have plans of replacing my GTX 980TI with the GTX 1180TI or whatever it will be called, when it is released in (according to rumours) around july/august, so that will hopefully boost the speed even more.
Other than that, it isn't the render time as much as the size of the render file itself which concerns me. I have played several adult VN's which were 1280x720 res, but several gigs in filesize due to poorly optimized render files. I am hoping to avoid that pitfall.
 

8873672413434

I Steal Your Cats
Donor
Oct 4, 2017
369
302
Well, currently most of my renders have taken about 10-15 mins on average, in 1080p Iray, so I guess that 4K wouldn't be too bad. I also have plans of replacing my GTX 980TI with the GTX 1180TI or whatever it will be called, when it is released in (according to rumours) around july/august, so that will hopefully boost the speed even more.
Other than that, it isn't the render time as much as the size of the render file itself which concerns me. I have played several adult VN's which were 1280x720 res, but several gigs in filesize due to poorly optimized render files. I am hoping to avoid that pitfall.
What software do you plan to use to make the game? As some of the softwares that make them. Aren't that great at file compression, Hence some VN's filesizes are huge compared to the content. Etc.
 

gue5t

Active Member
Sep 11, 2016
594
1,028
I am not planning on uploading the renders by themselves, but the size of my image files will inevitably affect the size of my game when i upload it sometime, and I dont want it to be countless of gigabytes for people to download it. I just want to find the right image format from the start, so I won't have re-render every image when I am finished.
The idea is to use few sample images to decide on the settings you will use for the rest and in the process find out what will or won't work for you and what will be the quality loss you end up with. Just deciding on using .jpg means nothing because whats important is how you will make the files and with what settings and/or optimizations - unlike .png files the .jpg files are lossy by default so each time you change the image you loss quality.
 

Agent HK47

Active Member
Mar 3, 2018
649
1,949
The idea is to use few sample images to decide on the settings you will use for the rest and in the process find out what will or won't work for you and what will be the quality loss you end up with. Just deciding on using .jpg means nothing because whats important is how you will make the files and with what settings and/or optimizations - unlike .png files the .jpg files are lossy by default so each time you change the image you loss quality.
That is pretty much what I have been doing so far. I have 3 different scenes which I have rendered several times each, with different settings and image formats, to see what would be the best in regards of speed, quality and file size. As stated on my first few posts, I was aiming for PNG, because I like the quality and compatability it offers, but figured the file size would be too much at the end.
Most of my PNG renders ended up at 3-4 MB each, and since I know that I will likely be doing several hundreds of renders, maybe even more than a thousand, the size becomes a big factor. I would still prefer PNG over jpg, because PNG is the format I normally use, but right now I am tempted to settle for jpg, simply because it is much easier to reach the file size I am looking for. Of course this is less than optimal and I am hoping to find a way to better optimize PNG.

@ Right now I going with VNM, since this is my first journey into making a VN, and I don't feel comfortable enough with coding to use Ren'py. VNM seems like the ideal place to start out and test the waters, but when I get more comfortable, I will most likely change over to Ren'py for my next game. (If I make it that far)
 

gue5t

Active Member
Sep 11, 2016
594
1,028
The idea is that most if not all rendering tools are producing big unoptimized files regardless of the format you choose and you have to do the optimization afterward - that's why I've asked you to upload a sample we can use to test optimizations with.

VNM is a bad idea at the moment, you should check and the problems it's authors and users had with VNM ...