vectorcraft/crates/trace/src
japbcoelho 4268b8edd5 Trace: colour mode keeps close dark tones apart
The colour histogram used the top 5 bits of each channel, so tones less
than 8 values apart always shared a bin and could never get their own
palette entry, however many colours were asked for. A dark, low-contrast
photo (a book-cover texture with RGB 33..66) traced to 5 colours when 12
were requested, and eight grey stripes 32..39 traced to one:

  vectorcraft-cli run --in stripes-32-39.png --cmd select.all \
    --cmd imageTrace.makeAndExpand \
    --params '{"params":{"mode":"color","colors":8,"noise":0,"method":"overlapping"}}'
  -> {"anchors":4,"colors":1,"id":4,"paths":1}

The histogram keeps its 32x32x32 bins, now fitted to each channel's range
among the opaque pixels: a channel spanning at most 32 values keeps every
value apart, a full-range channel keeps the old 5-bit bins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 06:59:50 +07:00
..
logo Image Trace: Flat Logo mode (sub-pixel edges, restored corners, true lines and circles) 2026-10-09 17:57:04 +11:00
centerline.rs Part of #641: Image Trace: Create Strokes 2026-10-09 10:11:09 +07:00
contour.rs continued work 2026-09-30 09:43:24 -04:00
fit.rs Part of #641: Image Trace: Create Strokes 2026-10-09 10:11:09 +07:00
lib.rs Image Trace: Flat Logo mode (sub-pixel edges, restored corners, true lines and circles) 2026-10-09 17:57:04 +11:00
mosaic.rs M12.7: Object → Create Object Mosaic… (trace::mosaic tile averages; columns/rows, new size, spacing, gray, delete raster; follows the image transform) 2026-10-02 08:16:36 -04:00
quantize.rs Trace: colour mode keeps close dark tones apart 2026-10-12 06:59:50 +07:00
tests.rs Trace: colour mode keeps close dark tones apart 2026-10-12 06:59:50 +07:00