median_cut: The median cut algorithm

Description Usage Arguments Details Value See Also

View source: R/medianCut.R


Cut an rgb cube into two color cubes, each with as imilar number of elements.


median_cut(image, vbox, iter = 1)



List An image in list form, with three components: red, green, blue


List The output of vbox() for the given image. A list of image parameters ("min", "max", "med", "ext" and "volume")


Integer The number attached to the names of the two new images.


Represents the rgb colorspace as a cube, with side lengths based on the red, green, and blue extents (difference between maximum and minimum within-color values).

The algorithm takes the side with the largest extent (extent information is passed in via the vbox() parameter), and splits the cube along the median value.

Both halves of the cube are then returned.


Two new images in a list, each separated into rgb components

See Also

vbox image_palette

RImagePalette documentation built on May 19, 2017, 10:19 p.m.
Search within the RImagePalette package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

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

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