realias.py - undo anti-aliasing, resampling blur and compression artefacts on
flat-colour images (cartoons, clipart, pixel art, logos, line art) and snap
every pixel back to a small palette of solid colours.
Nothing here needs tuning per image: every threshold is measured from the image
itself. The pipeline:
1. MEASURE noise level (JPEG-style speckle) from the flat areas.
2. REGIONS Palette #1 comes from "flat" pixels - pixels in a 2x2 block of
(near) identical colour. Anti-aliased edge pixels almost never
Post too long. Click here to view the full text.