Description Usage Arguments Details See Also Examples
View source: R/quantizeImage.R
Quantize image into discrete colors using the median cut algorithm
| 1 | quantize_image(image, n, ...)
 | 
| 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  | 
| n | Integer The number of discrete colors to be extracted from the image. | 
| ... | Pass any of the arguments for  | 
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.
| 1 2 3 4 | img <- jpeg::readJPEG(system.file("img", "Rlogo.jpg", package="jpeg"))
quant_img <- quantize_image(img, n=3)
display_image(img)
display_image(quant_img)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.