What's more efficient - EXR, JPG, TIF?

Hey there,

maybe someone can help me with this question - what format of textures is more efficient (memory usage, loading performance, etc.)?
I’m asking because two same textures (2048 px) have different size - .EXR ~15mb, .JPG ~3mb.

Thanks,
Kirill

Avoid JPG for textures cause its a compressed format, your results will be inconsistent and lower quality. If you need to use a compressed format try PNG with a little compression IMO better quality than JPG.

This really depends on what you’re using it for.

  • Do you want to store 8 bit, 16 bit (float) or 32 bit (float) per channel?
  • Should the compression be lossy or lossless?
  • Do you care about encoding or decoding speed?
  • Do you need associated/premultiplied alpha or unassociated/straight alpha?

You cannot compare JPG to EXR, because JPG can only store 8 bit per channel. It stores RGB values (3 channels) and it uses lossy compression. In comparison, with the default settings in Blender, EXR will write 32 bit float values for each channel, it stores RGBA (4 channels) and it uses lossless compression.

Also keep in mind that size on disk does not equal size in memory. The file needs to be decompressed to be used for rendering. Assuming you are using two formats that use lossless compression and have the same bit depth, then it should roughly use the same amount of memory for the same content even if they have a different size on disk because one format has a better compression.

Generally EXR is a good format. You can also use 16 bit and lossy compression (DWAA) if you need to keep the file size really small on disk. TIFF and PNG work too. The latter uses straight alpha though and encoding speed is not great.

7 Likes

Thank you for such detailed answer.

I assume the main question for me is decoding speed (as well as how fast GPU memory will fed with textures) when I hit F12. I’m trying to optimize really heavy scene with dozens of different textures.
Maybe the texture format is not that important as I think, maybe it depends on RAM, CPU, GPU performance?

Thank you in advance,
Kirill

It’s difficult to give a recommendation without knowing specifics about the scene. You will likely see the biggest improvement in memory usage and loading times by reducing the texture size for objects that aren’t seen up close. If the rendering itself is slow, then you should also check if you can optimize geometry, shader nodes, modifiers and render settings.

If you have questions about possible optimizations for some specific example, then I would suggest creating a post on one of our community websites like Blender’s Stack Exchange or blenderartists.org.

1 Like

The determining factor in terms of efficient memory use would be any file that loads with a small size in an image SEQUENCE.
The determining factor in terms of speed read use for a sequence would be JPG.
The determining factor in terms of loading colors in a texture would be a .DDS
The determining factor in terms of efficient memory use for 2k textures would be PNG
The determining factor in terms of Quality and efficient Memory use for NEAR camera textures (with no alpha channels) textures would be TIFF
The determining factor in terms of Quality and Efficient memory use in terms of NEAR camera textures (with alpha channels / RGB additional data channels) would be TGA.

I think you can basically extrapolate from this information.
I agree, depending on your case (your 3d scene, 3D tracking or 2D composition, or EXR multi layer compositor scene) there are other optimal scenarios to favor:

  • Reading fast
  • Writing fast
  • Reading quality
  • Storing quality + additional data info in color channels or layers.
1 Like

In terms of R/W speeds and file size, I tend to use these tests from @Robert ;

The TL; DR for me is that EXR is basically the winner.

Although depending on what you are doing it might not be ideal event if being the faster R/W and smallest file size.
I’ll take my case as an example, I mostly do animations rendering, and unless I need to do compositing in another software I will avoid using Blender’s EXR as output because it seems that some of the softwares I use down the line (especially ffmpeg) expect the channels to be stored in a different order.
And when I’m doing a quick and dirty preview render, or when I just want to post something on the Internet, I just use jpegs. And overall I avoid PNG all the time except if I need to post a still picture with transparent backround on the Internet.

As input though, I’m usually not the one making assets, but otherwise I tend to use EXR or Tiff.

1 Like

Bear in mind that EXR can hold many layers and passes in the same file and the performance of the I/O will depend on if such additions are part of the file.

Considering no other file format can do that and hence the other alternative is to save each layer/pass in a different file, has anyone actually benchmarked what’s faster in that scenario ?

JPG is forbidden for anything that is not a meme.