GithubHelp home page GithubHelp logo

blanket-maker's Introduction

Blanket Maker

Create blankets by converting an image into squares following a palette!

C++

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

Python

Dependencies:

Run With:

python3 main.py [output size x] [output size y] <--image imageFile> <--output outputFile> <--palette paletteFile> <--upscale true/false> <--textfile filename>

Example

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

blanket-maker's People

Contributors

harrisonsscott avatar mhscott avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

mhscott

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.