Menu

How We Built a 100% Browser-Local Image-to-Cross-Stitch Chart Maker (Canvas Quantization + DMC Palette Matching)
📰

How We Built a 100% Browser-Local Image-to-Cross-Stitch Chart Maker (Canvas Quantization + DMC Palette Matching)

DEV Community: javascript·yifei Huang·8 days ago
#pvNmJfTG
#devtojavascript#devto#dev#chart#color
Long article (823 words) — no AI summary yet.
Reading 0:00
15s threshold

A photo can look fine as a thumbnail and still make a maddening cross-stitch chart. A shadow that reads as one shape on screen might turn into several almost identical thread colors. A lone stitch in an otherwise blank area means another start and stop. We built Thread & Grid around the decisions a stitcher can make before either of those problems reaches the fabric. The browser samples the image onto a stitch grid, reduces the palette, and draws a symbol chart with suggested floss codes. The photo and chart stay in the tab during conversion.

Sample onto the grid you can actually stitch

The file picker accepts JPEG, PNG, and WebP. We decode the selected file through a browser object URL and revoke that URL when loading finishes. The app checks both file size and decoded dimensions because a compressed image can take much more memory once decoded. It also rejects unusually tall output grids before building the chart.

The user sets the chart width in stitches.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.