# img2yaya - generate yayagram files from images ![yayagram image of ferris the crab created with img2yaya](images/ferris_yayagram.png) [Yayagram](https://github.com/r00ster91/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 ```sh cargo install img2yaya ``` ## Usage + Print help ```sh img2yaya --help ``` + Read image and output yayagram to stdout ```sh img2yaya input.png ``` + Read image and output yayagram to file ```sh img2yaya input.png output.yaya ``` + Additionally set threshold for filling cells to 50 (0-255), invert colors and set grid width to 20 ```sh 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](https://github.com/AaronErhardt/img2yaya/tree/main/examples). Images of those examples loaded and solved in yayagram can be found in the [images folder](https://github.com/AaronErhardt/img2yaya/tree/main/images). 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.