go-cross-stitch

command module
v0.0.0-...-8d5969d Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 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:

make build

General Usage

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.

Flags
./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
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