Skip to content

csams/pixelation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixelation

This is a little server that accepts images and pixelates them according to a color palette automatically generated by the median-cut algorithm (thanks go-quantize!). The server produces json, but the same binary can convert images directly or render json produced by the server.

It works on jpeg and png images.

Examples

Server

./bin/pixelate --serve

In another terminal

$ curl -v --compressed -F block-width=8 -F colors=16 -F file=@/path/to/some/picture.jpg 'http://localhost:8080/api/convert' > output.json
$ ./bin/pixelate --render --input=output.json --output=output.jpeg

Standalone

$ ./bin/pixelate --input=file.jpeg --output=pixelated.jpeg

$ ./bin/pixelate --input=file.jpeg --output=pixelated.jpeg --colors=64 --block-width=4