quantize_image: Quantize image

Description Usage Arguments Details See Also Examples

Description

Quantize image into discrete colors using the median cut algorithm

Usage

1

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.

See Also

image_palette

Examples

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)


Search within the RImagePalette package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.