Quantize image into discrete colors using the median cut algorithm
Usage
quantize_image(image, n, ...)
Arguments
image
Matrix The image from which the palette will be extracted from. Should
be a 3 (or more) dimensional matrix. The output of a function such as readJPG()
or readPNG() are suitable as image.
n
Integer The number of discrete colors to be extracted from the image.
...
Pass any of the arguments for image_palette
Details
Note: This function is extremely slow for large images.
Takes up to 20 seconds for 500x500 image on a desktop with 2.7GHz processor and 4Gb ram.