go-cross-stitch

command module
v0.0.0-...-1e39f03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 5 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL