Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

posterization-pyladies

This is the code for a workshop (slides) I ran for the Seattle Pyladies group in May 2015. In it we implement k-means clustering and use it to "posterize" images.

It requires matplotlib. Apparently, for some people it also requires Pillow if you want it to work with jpg files, I haven't quite figured out under which circumstances that is. :O

The file posterization.py contains stubs for all the methods. The "hints" folder contains hints for writing each one, while the "solution" folder contains my solution (which, it goes without saying, is not the only one).

For instance, if you start with the bee image (from http://commons.wikimedia.org/wiki/File:Polistes_May_2013-2.jpg)

bee

and posterize it to four colors, you get:

bee4

If instead you use eight colors, you get:

bee8

Similarly, if you start with the crayon image (from http://commons.wikimedia.org/wiki/File:Crayons-scent.png)

crayons

and posterize it to four colors, you get:

crayons4

If instead you use eight colors, you get

crayons8

About

image posterization using k-means clustering

Resources

License

Releases

No releases published

Languages

You can’t perform that action at this time.