• v1.7.0 928253a4c9

    dvs released this 2026-09-26 06:39:51 +00:00 | 0 commits to main since this release

    lineartization v1.7.0

    Convert color illustrations / posters into clean black-and-white line art.
    Pure Python + OpenCV + scikit-image. No deep-learning models required.

    Highlights

    minimum mode — new min_true_black switch (default True = unchanged v1.6.1 behaviour)

    min_true_black=True min_true_black=False
    True-black gate applied not applied
    Colored regions excluded kept as strokes
    Cleanup median → open → CC filter → median despeckle → drop short fragments
    Thinning none (original stroke weight) distance transform to a thin even line
    Best for mostly-black line work colorful posters

    Pick per image — a math worksheet reads best with the gate on, a colorful
    festival poster reads best with it off.

    skeleton mode — region-agnostic. The flat-color smoothing step previously
    keyed on one specific hue and assumed the region lay on the left half of the
    image. It now selects any strongly saturated area (color_sat_min,
    color_area_range), so it works on any layout or palette. Measured difference
    on a test poster: 0.11% of pixels.

    Other changes

    • All comments, docstrings and messages moved to English.
    • No built-in default paths anywhere; examples/demo.py now requires
      <input_image> <output_dir>.
    • README rewritten: resolution guidance, both minimum variants, full parameter
      reference, pipeline documentation.
    • 18 unit tests covering I/O, both modes and both minimum variants.

    Compatibility

    min_true_black defaults to True, so existing minimum callers get the
    same behaviour as v1.6.1. The renamed skeleton fields
    (enable_green_smoothing → enable_color_smoothing, green_sat_min →
    color_sat_min, green_area_range → color_area_range) are a breaking change
    for code that passed the old names explicitly.

    Resolution note

    Extraction quality depends directly on the source resolution: the higher the
    resolution, the cleaner and more complete the result. For low-resolution
    sources prefer method="minimum".

    Install

    pip install lineartization
    

    Quick start

    lineartization poster.jpg lineart.png                      # skeleton
    lineartization handwriting.jpg lineart.png -m minimum       # minimum, true-black
    lineartization colorful.jpg lineart.png -m minimum --no-true-black
    
    Downloads