7
$\begingroup$

I've rendered a 900 frames animation as a png sequence. RGBA with 100% compression and i got round about 34mb each frame and the overall sequence is about 30gb big. That is pretty huge.

Tools like Premiere Pro or After Effects struggle to load those huge sequences and compositing is pretty impossible because it's way too slow.

My question is, why are those png images so huge? If i take them and rewrite them with e.g. media encoder the file sizes it gives me is about 2mb per frame. But it looks totally the same and also contains alpha.

Is there a way to get normal file sizes out of the box from blender so i can skip the converting part with external tools like media encoder?

Thanks for your help!

(Additional informations: Render Engine Cycles / 3840x2160px 4K / PNG RGBA)

$\endgroup$
5
  • $\begingroup$ Looks like you have about 8 megapixels with about 4 bytes/pixel, corresponding to the 4 channels, per image. This would be the numbers if your frames don't have large contiguous areas of exactly the same color, e.g. in typical renderings with color gradients (because PNG only compresses runs of the same pixel values). Adobe Media Encoder seems to support video formats like H.264 which compress video really well, but lossy -- a totally different animal than lossless PNG (single image) frame sequences. $\endgroup$ May 5, 2022 at 15:36
  • 1
    $\begingroup$ @Peter-ReinstateMonica PNG doesn't just compress runs of same pixel values. It has filters to subtract the left pixel or top pixel, etc. It has Huffman coding to compress frequently appearing values that are not in runs. $\endgroup$
    – Nayuki
    May 5, 2022 at 15:37
  • $\begingroup$ @Nayuki Thanks for the info -- I was so sure because in my experience PNG compresses very well for e.g. screen shots of text and really badly for the typical photograph. Perhaps the more sophisticated compression methods are not supported by all encoders? Or their benefit is limited with typical photography. $\endgroup$ May 5, 2022 at 15:40
  • $\begingroup$ @Peter-ReinstateMonica The filters in PNG are supported by libpng, the pervasive encoder that everyone uses. The compression methods like Huffman is supported by zlib, the pervasive library that everyone uses. If anything, it's harder to not use the standard filters and compression methods that libpng+zlib provide by default. $\endgroup$
    – Nayuki
    May 5, 2022 at 15:46
  • $\begingroup$ @Nayuki After reading the PNG Wikipedia page I should correct my first comment -- uniform color gradients actually do compress very well with PNG, but irregular, small-scale patterns don't. So it's possible that the color depth of your PNG frames is more bits/color and PNG achieves a compression ratio leading to the observed image size. $\endgroup$ May 5, 2022 at 15:47

3 Answers 3

13
$\begingroup$

It seems you have set 16-bit color and then resaved it in 8-bit.

Saving 4k image in 16-bit gives me relatively same size of PNG.

enter image description here

Images look the same because typical monitor is limited by 8-bit color, the only difference you may note is banding effect which is not the case in 8-bit color because of dithering.

$\endgroup$
0
1
$\begingroup$

Before comparing "cats with dogs", be aware that PNG is an non-lossy image format. So for every pixel you would have four components (R,G,B,A) with the required bit depth (e.g. 8 or 16 bits). The only thing that PNG can do is to pack the bits and compress common pattern (non-lossy).

In contrast JPEG (just one example) is a lossy format, depending on the quality factor. Typically the file size can be smaller but you can have artefacts (like grass looking like green mud). Maybe JPEG2000 (or similar) that use a different approach storing the image data will provide smaller image sizes.

However in some cases PNG images are actually smaller than JPEG images are (depending on the image).

Another important fact is that even when images look the same initially, the result of processing those any further can be quite different (like when listening to MP3 music at half of the speed). If you repeat the procedure "load from lossy format, modify, save as lossy format" a few times the image will become quite terrible.

$\endgroup$
1
  • $\begingroup$ While technically true, the original question did not state that they were comparing PNG with JPEG but rather that saving the same image as a PNG with another software results in smaller file sizes. $\endgroup$
    – Robert Gützkow
    May 5, 2022 at 18:06
0
$\begingroup$

Why even save as PNG? It's not a production format, it's only meant as a final export format for the internet, so is jpeg.
It lacks a lot of features like including render passes, it's heavy, and incredibly slow to write and read. When you save an image sequence, you should use a format made for production.

EXR comes with some compression algorithm like Pxr24 if you want lossy, or any lossless compression method. Just avoid DWAA if you uses passes as it will lose crucial data on passes. Alternatively, if you don't need passes, use targa raw.

The only occasions you should use png or jpeg as an output is if you are outputting a single image ready to post on the internet. Any other cases, you most likely should avoid anything not meant for production, you will lose either data or time.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .