HELP: Image file size increases by 10x after an export

Godot Version

4.2.2 stable

Question

Hey, I’m currently losing my mind over this issue as my game contain a lot of images which makes this a really big issue. It goes from 300MBs (total size of all images) to 900MBs, which is just the image files. I’m not super familiar with the technically part of the exporting process, and this Godot Docs has been no help to me. I’ve noticed that changing the texture format can change how much space the game takes up, but It doesn’t seem to fix the issue. FYI I’m using Godot extract tools to open the project post export and looking at the files. Using Godot 4.2.2 stable.

For an example. One image file starting at (86kbs) becomes (859kbs). I have nearly 500 of these types of files…

If anyone knows someway to keep the file size of images post export, I would be very grateful.

Your source images (the ones that you add to your project) are not included in the final pck file. What’s included inside the pck file are the imported files from those images. It depends how you import the image file.

Read this documentation page to know how you should import each image depending on how you are using them Importing images — Godot Engine (stable) documentation in English

1 Like

I’ve looked more into this issue, and that isn’t really the problem. The file size of the images is a fixed amount depending on the resolution, no matter the quality. So unless I can some how keep the file size through exporting, I’m essentially screwed.

(I think this might be correct, but I’ll keep looking into it)

Which compression mode did you choose for images in the Import dock? Lossy should result in the smallest file sizes.

Note that if you use VRAM Compressed, the compression ratio is fixed. This means that regardless of the image’s complexity, the compression ratio remains the same (typically 1:4, sometimes 1:6). This is a requirement for VRAM compression to work, as it’s the only way fast random access can be performed on the GPU.

1 Like

You really probably want to set your images import mode to “Lossy”. Every other mode is going to be a large uncompressed webp file.

In my own quick tests with a 4K asset switch from Lossless to Lossy nets about a 1/4th filesize in my “.godot/imported” folder.

I’ve tried, and it doesn’t actually help all too much, files are still larger than they should be.

The problem is post exporting, the actual file size in the editor is no problem.

It affects the export, at this point if lowering the lossy quality isn’t an option or doesn’t net the results needed you may have to look to alternatives. How are the image files used? Are they textures that could be shrunk down? Is it a video frame-by-frame that could be ogv encoded?

Of course if you just want a smaller file size for conveyance, try zipping the exported project. The uncompressed texture may zip better than the lossy compressed verison.

it does affect the export, but it doesn’t help, the files still have a least a 30% increase per file (there’s hundreds). The files themselves are quite small, all under 100Kbs. I’ve tried the ogv video format in the past but it isn’t really up to par with the images in quality. Zipping the project won’t really help either as I already do that and it’s still too big (also I don’t want the game to take up unnecessary space)

You’ll have to run a better ogv convert, higher bitrate and all that. What did you use to create the ogv video? If they are small <100KB images I can’t imagine them being 1080p so you should be able to get away with 100kb/s or less.

The files are 1080 webp files, so it’s not that surprising to be under 100Kbs. The images are all blender renders, so I used blender to render them as a ogv, but it didn’t look great.

Solution: Godot, per usual is odd, and setting it to lossy will pretty much fix the issue. The problem I was having was my own stupidity as I thought all the files were being set to lossy when I saved the custom import as default, but you have to delete the import files for each of the files. Everything should be alright now. Thank you to those who responded.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.