Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Kim committed Jul 11, 2012
1 parent 2cc36ac commit 31b3a86
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions README.md
Expand Up @@ -13,21 +13,17 @@ flag on your browser (I'll leave that up to you to figure out).

Using your own image:
==========================================================================
Currently the image is hardcoded so just change the refernce in the img
src to point to whichever one you want. This will change in the future
to allow drag/drop, file upload, or something generally cleaner.
Just drag and drop an image from your desktop into the grey box!

Controling how many colours are outputted:
==========================================================================
The function generateColourPalette(imageData, threshold) is the main function
that determines how many colours are outputted. Try setting the threshold to
a lower number to allow more colours and a higher number for less.

Don't set it too low (less than 16) otherwise it might take awhile to
process.

If you set it too high, you'll get less and less colours to point where
you might just get two.
I'll be adding some html controls in a bit so you'll have to change the
code. If you look up the generateButton.onclick function, you can see
two parameters within the options object: threshold and maxNumColours. The
threshold controls how closely it wants to sample colours that are similar
(filters out a bit of noise) and the maxNumColours will return a set of
colours equal to or less than the number you specify. Usually lowering
the threshold means more colours are sampled.


Author: Tim Kim
Expand Down

0 comments on commit 31b3a86

Please sign in to comment.