Create blankets by converting an image into squares following a palette!
Dependencies:
sudo apt install libopencv-dev
Build Instructions:
cd cpp
cmake .
make
Run With:
./blanketMaker [output size x] [output size y] <--image imageFile> <--output outputFile> <--palette paletteFile> <--upscale true/false> <--textfile filename>
For both c++ and python, you can also use "auto" instead of specifying a json file for the palette parameter followed by the palette size to automatically generate a palette.
Example
./blanketMaker 10 10 --rainbow.png --palette auto 8
Dependencies:
Run With:
python3 main.py [output size x] [output size y] <--image imageFile> <--output outputFile> <--palette paletteFile> <--upscale true/false> <--textfile filename>
./blanketMaker 10 10 --image rainbow.png --upscale true --output out.png
rainbow.png (original)
out.png (output)
Using the palette:
{
"colors": [
"#ff0000",
"#ffff00",
"#00ff00",
"#00ffff",
"#0000ff"
]
}
A text file is also made that makes it easier to follow the colors when making the blanket.
#ff0000: 0
#ffff00: 1
#00ff00: 2
#00ffff: 3
#0000ff: 4
Row #0: 2 2 2 3 4 4 4 4 4 4
Row #1: 1 2 2 2 2 4 4 4 4 4
Row #2: 1 1 1 2 2 2 3 4 4 4
Row #3: 1 1 1 1 2 2 2 3 4 4
Row #4: 1 1 1 1 1 2 2 2 3 4
Row #5: 1 1 1 1 1 1 2 2 2 3
Row #6: 1 1 1 1 1 1 1 2 2 2
Row #7: 0 1 1 1 1 1 1 1 2 2
Row #8: 0 0 1 1 1 1 1 1 1 2
Row #9: 0 0 0 1 1 1 1 1 1 1