/beadmachine

Bead pattern creator

Primary LanguageGoMIT LicenseMIT

beadmachine

beadmachine is a bead pattern creator. Convert any imagine into a suitable color palette pixel by pixel in order to be able to create a matching, beadable pattern. It also shows you a statistic about the used beads.

Features

  • Cross platform
  • Uses all available CPU cores to process the image
  • Supports gif/jpg/png as input file formats
  • Can output a HTML file with detailed info on which bead to use for each pixel
  • Color matching based on CIEDE2000
  • Included bead palettes: Hama
  • Optional image resizing
  • Image filters to preprocess the input image

Command-line options:

-i=FILENAME
Filename of image to process.
-o=FILENAME.png
Output filename for the converted PNG image.
-l=pattern.html
Output filename for a HTML based bead pattern.
-p=colors_hama.json
Filename of the bead palette.
-w=0
Resize image to width.
-h=0
Resize image to height.
-x=1
Resize image to width in amount of boards.
-y=1
Resize image to height in amount of boards.
-b
Make output file look like a beads board.
-t
Include translucent colors for the conversion.
-f
Include flourescent colors for the conversion.
-n
Skip the bead color matching.
-verbose
Verbose logging with details about the color matching.
--grey
Convert the image to greyscale.
--blur=1.0
Apply blur filter (0.0 - 10.0).
--sharpen=1.0
Apply sharpen filter (0.0 - 10.0).
--gamma=1.0
Apply gamma correction (0.0 - 10.0).
--contrast=1.0
Apply contrast adjustment (-100 - 100).
--brightness=1.0
Apply brightness adjustment (-100 - 100).

Example Usage

To convert the sample yoshi image to Hama bead colors:

./beadmachine -i examples/yoshi_thinking_in.png -o out.png -l pattern.html

Yoshi thinking in -> Yoshi thinking out

And will print out a statistic:

Input image width: 28, height: 32
Bead boards width: 1, height: 1
Beads width: 14 cm, height: 16 cm
Bead colors used: 9
Beads used 'H10 Green': 30
Beads used 'H47 Pastel Green': 72
Beads used 'H1 White': 525
Beads used 'H37 Neon green': 38
Beads used 'H38 Neon orange': 18
Beads used 'H4 Orange': 10
Beads used 'H35 Neon red': 13
Beads used 'H27 Beige': 11
Beads used 'H18 Black': 179
Image processed in 6.0004ms

The output of the HTML pattern file will look like this:

Yoshi HTML pattern

To convert the sample Mona Lisa image to Hama bead colors, resize to a width of 58 pixel and create a bead style output:

./beadmachine -i examples/mona_lisa_in.jpg -o out.png -w 58 -b --blur 2.75 --contrast 10

Mona Lisa in -> Mona Lisa out

And will print out a statistic:

Input image width: 722, height: 1074
Bead boards width: 2, height: 3
Beads width: 29 cm, height: 43 cm
Output image pixel width: 58, height: 86
Bead colors used: 22
...

Installation

You need to have a Golang environment set up. Install beadmachine:

go install github.com/CornelK/beadmachine

Todo

  • Mouse over hints in HTML pattern file for multiple same colored beads counts
  • Specify different width and height for board dimension
  • Perler bead palette
  • Support for giving bead stocks as input
  • GUI / Webservice