Jump to content

Reduce texture sizes


Recommended Posts

I just saw that the sizes of the textures, especially PNG ones, are HUGE. There is an amazing tool called tinyPNG that can help us fixing that. It uses lossless compression algorithms to reduce texture sizes without losing quality. I tried it on some textures, and their size got drastically reduced :e3619dc221.png

Applying it to all textures might be a great optimisation : lower loading time, but also faster rendering.

  • Like 1
Link to comment
Share on other sites

10 minutes ago, jrevel said:

I just saw that the sizes of the textures, especially PNG ones, are HUGE. There is an amazing tool called tinyPNG that can help us fixing that. It uses lossless compression algorithms to reduce texture sizes without losing quality. I tried it on some textures, and their size got drastically reduced :e3619dc221.png

Applying it to all textures might be a great optimisation : lower loading time, but also faster rendering.

Hey,

actually not really. All the textures are cached as dds file, using either DXT1 or DXT5 before getting into the game :) Package bundle comme with dds and not png :) But I might have not compressed that png yes.

Link to comment
Share on other sites

4.2MB -> 500KB is a lot. There is the drawback of requiring longer to decompress. Usually we already compress at highest lossless compression.

If you mean https://tinypng.com/ it also uses 8bit instead of 24bit colors

Quote

This technique is called “quantization”. By reducing the number of colors, 24-bit PNG files can be converted to much smaller 8-bit indexed color images

It says

Quote

TinyPNG uses smart lossy compression

So that would not be lossless however.

Link to comment
Share on other sites

It's probably good for someone to go through and standardize the texture sizes. 512x512 for a unit texture, for example, would be excessive. And then comparatively, it wouldn't make sense for a boar texture to be larger than a unit texture. No need for helmet textures at 512 if an entire unit is 256. Got to look at comparably sized items in the game world. A small vase should be 128. Etc. Judgments need made, but it would be good if artists made those judgments before they committed them. ;) It's been better lately, but I am sure some stuff has fallen through the cracks.

Link to comment
Share on other sites

43 minutes ago, elexis said:

4.2MB -> 500KB is a lot. There is the drawback of requiring longer to decompress. Usually we already compress at highest lossless compression.

Indeed, yet it wouldn't change much in the game. The caching part where everything is grey might be slower, but after it's cached it will be using the dds and its mimaps.

29 minutes ago, wowgetoffyourcellphone said:

It's probably good for someone to go through and standardize the texture sizes. 512x512 for a unit texture, for example, would be excessive. And then comparatively, it wouldn't make sense for a boar texture to be larger than a unit texture. No need for helmet textures at 512 if an entire unit is 256. Got to look at comparably sized items in the game world. A small vase should be 128. Etc. Judgments need made, but it would be good if artists made those judgments before they committed them. ;) It's been better lately, but I am sure some stuff has fallen through the cracks.

Yes. This is called texel density and it should be added to the Art Design document. Each type of objects should have a texture size depending on its size. The Art Design Document should be split into different wiki pages for new artists, and that might actually be a good theme for my presentation in the art school in Rennes in may. This is a daunting task though. I'd appreciate some help in that department.

Were we to reduce texture size, original pngs should be put in the art repository.

 

Link to comment
Share on other sites

Just now, stanislas69 said:

 Were we to reduce texture size, original pngs should be put in the art repository.

 

Oh absolutely. Save everything. You never know what could be useful in the future. (y)

 

1 minute ago, stanislas69 said:

Yes. This is called texel density and it should be added to the Art Design document. Each type of objects should have a texture size depending on its size.

Thank you! I figured there would be a name for the concept I was clumsily describing.

Link to comment
Share on other sites

We already tried PNG lossless compression years ago. See this commit: https://trac.wildfiregames.com/changeset/16386 Notably the cursors went from 4+KB to 1+KB.

Ideally it should be done before committing the PNGs to the SVN. If you rather recompress the PNGs already committed, the SVN bloats (including the checkout) because it still keeps the older PNGs (because SVN needs to let you access older revisions) as well the new ones.

A better way to improve on game size (also reflecting in the final game download, not only on the source which has PNG but not S3TC textures) is to recompress the audio files, using a proper, updated ogg codec and sensible compression value. For some more info see this:

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...