img2yaya

Crates.ioimg2yaya
lib.rsimg2yaya
version0.1.1
sourcesrc
created_at2021-05-28 21:18:56.781739
updated_at2021-05-28 21:22:51.191767
descriptionGenerate yayagram files from images
homepage
repositoryhttps://github.com/AaronErhardt/img2yaya
max_upload_size
id403314
size110,605
Aaron Erhardt (AaronErhardt)

documentation

README

img2yaya - generate yayagram files from images

yayagram image of ferris the crab created with img2yaya

Yayagram is a super neat nonogram puzzle game for the terminal. It either generates random grids or loads predefined grids from a file. It even features an editor to easily create your own grids. But let's be honest, creating grids isn't as much fun as playing them.

This is where img2yaya becomes handy. It automatically generates grids from images with the desired dimensions in just a couple of seconds.

Installation

cargo install img2yaya

Usage

  • Print help
img2yaya --help
  • Read image and output yayagram to stdout
img2yaya input.png
  • Read image and output yayagram to file
img2yaya input.png output.yaya
  • Additionally set threshold for filling cells to 50 (0-255), invert colors and set grid width to 20
img2yaya input.png output.yaya -t 50 -i -w 20

Example grids

Examples of grids generated by img2yaya can be found in the examples folder. Images of those examples loaded and solved in yayagram can be found in the images folder.

If you have a nice grid you'd like to share please open up a pull request to merge this grid into this repository!

Limitations

img2yaya uses a grayscale format to determine which fields to fill and which not and is therefore not aware of colors. For now the grids are primarily made for playing as a puzzle so other fill types such as "maybe" are not used to represent the color of the image more accurately.

Too much detail in images will likely cause problems due to the limited amount of pixels available on a grid and large grids (over about 20x20) become very hard to play. Therefore simple images with few colors will have the best results.

Varying the threshold can yield much better results.

Commit count: 17

cargo fmt