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.
To build the binary, run the following:
make build
Once the binary is compiled, use as follows:
./bin/cross-stitch -n 10 examples/test_images/FullMoon150px.jpg
This will make two files in examples/test_images:
FullMoon150px-dmc-lab.png
FullMoon150px-dmc.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.
./bin/cross-stitch --help
Usage of ./bin/cross-stitch:
-all
use all thread colors available (currently broken)
-color string
color palette to use (OPTIONS: dmc, lego, bw) (default "dmc")
-d implement dithering
-g convert image to greyscale
-n int
number of colors to attempt to match (2^n) (default 6)
-rgb
use rgb color space
make examples
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
Original | RGB Distance | CIELab Distance |
---|---|---|
Original | RGB Distance | CIELab Distance |
---|---|---|
Original | RGB Distance | CIELab Distance |
---|---|---|
Original | RGB Distance | CIELab Distance |
---|---|---|