Wondered if anyone has some sample code to quantize a png picture file with TBgrabmp ?
In my search I came across these (but was still looking for a TBgraBmp alternative):
PngDrop: GUI tool for creating PNG8 (Done in Lazarus)
https://github.com/c-yan/pngdropI quickly played around with PNGDrop) ( written in Lazarus by a cluey Japanese guy
c-yan , Sunday programmer in Tokyo, Japan )
Here are my findings:
It contains some great ColorReduction pascal code that uses TLazIntfImage
Looks like it uses
IntegerTripleArrays, KMeans, AverageError and Map Color with Dithering.
Uses drag and drop to load the png image and even saves it back to the original folder.
I tried it on a 233kB png and it compressed it to only 79kB.
Amazing.
Also tried a 306kB transparent png and it compressed it to only 79kB.
(attached is the sample png that was compressed,)