Go Cross-Stitch Pattern Generator
This is a project that will take an image and convert it to a png and pdf of DMC thread colors and instructions.
Other palettes include Anchor cross-stitch threads, simple LEGO colors, and greyscale.
How To Use
Build From Scratch
To build the binary, run the following:
go build
General Usage
Once the binary is compiled, use as follows:
./go-cross-stitch -n 10 test_images/full-moon.png
This will make four files in test_images:
full-moon-dmc-rgb.png
full-moon-dmc-rgb-A4.pdf
full-moon-dmc-rgb-A2.pdf
full-moon-dmc-rgb-A1.pdf
the png is the image converted to cross-stitch DMC thread colors.
the PDF is the instructions to stitch the pattern, with the DMC image included.
Run the help command to see all flags available:
./go-cross-stitch --help
Render all test images
make examples
References
Color distance formulas: https://en.wikipedia.org/wiki/Color_difference
Color quantization: https://en.wikipedia.org/wiki/Color_quantization
CIELab color space: https://en.wikipedia.org/wiki/CIELAB_color_space
Example Image Conversions
Mars (reds)
Original |
RGB Distance |
CIELab Distance |
|
|
|
Earth (blues and greens)
Original |
RGB Distance |
CIELab Distance |
|
|
|
Moon (greyscale)
Original |
RGB Distance |
CIELab Distance |
|
|
|
Full Color Spectrum
Original |
RGB Distance |
CIELab Distance |
|
|
|