The pngnudge algorithm was an accidential discovery. While failing at the pixeltweek denoising filter I found that it had the interesting side-effect of making some images considerably more compressible for PNG while producing (usually) minimal visual alteration. With some further refinement I was able to sacrifice noise removal ability and thus the visual alteration while retaining the compression optimisation in a reduced form.
The algorithm used is very simple - it's nothing more than a form of mode filter limited by a threshhold mask. The masking guarantees that no pixel is altered in color value by more than a defined distance (In RGB space) - anything less than around eight or so is imperceptable. The mode filter also has the interesting property of guaranteeing the output image palette is a subset (Though not a proper subset) of the input image palette - a factor that contributes to the compressibility and also prevents the introduction of fringe artifacts.
Essentially, the filter works by altering the boundries between quantitisation bands in a manner that gives them a more predictable structure. This is an emergent property - nothing in the filter explicitly operates on regions or boundries. It has a similar effect on JPEG compression artifacts - not directly removing them, but reshaping them in very slight ways to improve compressibility to PNG.
I have prepared some demonstration images. The filter in current form operates only upon 24-bit .BMP files - all PNGs were produced using the ImageMagick convert utility on default settings.
|A very simple cartoon image.||53896||50697||0.940644945821582|
|A more detailed cartoon image, after lossy video (h264) compression.||435657||360912||0.828431541327237|
|A more detailed cartoon.||628845||549317||0.873533223608361|
|A scientific diagram, one which has never been lossy compressed.||53860||46969||0.87205718529521|
|Gradients and lots of pixel-level detail that must be preserved.||204891||175483||0.856470025525767|
|The ultimate gradient image.||9016||8995||0.997670807453416|
|Two-color printable image.||60283||47955||0.795497901564288|