WSL/SLF GitLab Repository

Commit d31214f2 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

After playing with pngcrush, a new filter has been enabled for the PNG...

After playing with pngcrush, a new filter has been enabled for the PNG compression. A specific compression strategy for deflate is also now enabled for indexed images. This keeps run time identical but offers a significantly smaller file size (compared to the full color, initially generated PNG of the last benchmarks, it now shows a 40% run time reduction for the whole loading+png output and 87% size reduction).
parent ed0e449c
......@@ -290,7 +290,8 @@ void PNGIO::setFile(const std::string& filename, png_structp& png_ptr, png_infop
//png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
if(optimize_for_speed) png_set_compression_level(png_ptr, Z_BEST_SPEED);
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, PNG_FILTER_SUB); //any other filter is costly and brings close to nothing...
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, PNG_FILTER_SUB|PNG_FILTER_UP); //any other filter is costly and brings close to nothing...
if(indexed_png) png_set_compression_strategy(png_ptr, Z_RLE); //Z_DEFAULT_STRATEGY, Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE
// Write header (8 bit colour depth). Full alpha channel with PNG_COLOR_TYPE_RGB_ALPHA
if(indexed_png) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment