for PNG images I attempt an indexed colour encoding, subtractively combine it with the original image data, threshold the luma and chroma deltas to get a per-pixel "different/same" value, sum those, and if less than 1% of the image is affected then I keep it. if not I fall back to max compression RGB888. (I don't use transparency in blog images)