pngwolf png optimizer
This is the homepage of `pngwolf`, an open source utility to optimize the file size of PNG images. The format allows encoders to apply a filter to each row in an image that transforms the bytes used to represent the pixels in the image data by mathematically relating them with bytes of neighbouring pixels. As an example, a gradient may be represented as a sequence of numbers like 1, 2, 3, 4, and a filter transforms the sequence into a sequence like 1, add 1, add 1, add 1, which usually compresses better. It is infeasible for most images to analyze all possible combinations of filters, so `pngwolf` uses a genetic algorithm to gradually evolve a selection of filters to the best it can find within some boundaries like the time a user wishes the tool to run. Then the image data is compressed using the Deflate implementation from Igor Pavlov’s 7-Zip compression toolkit, which, at the right settings, is usually able to compress at a higher ratio than other encoders, at the expense of compression time.