image: magick image object returned by image_read() or image_graph()
brightness: modulation of brightness as percentage of the current value (100 for no change)
saturation: modulation of saturation as percentage of the current value (100 for no change)
hue: modulation of hue is an absolute rotation of -180 degrees to +180 degrees from the current position corresponding to an argument range of 0 to 200 (100 for no change)
max: preferred number of colors in the image. The actual number of colors in the image may be less than your request, but never more.
from colorspace_types for example "gray", "rgb" or "cmyk"
dither: a boolean (defaults to TRUE) specifying whether to apply Floyd/Steinberg error diffusion to the image: averages intensities of several neighboring pixels
treedepth: depth of the quantization color classification tree. Values of 0 or 1 allow selection of the optimal tree depth for the color reduction algorithm. Values between 2 and 8 may be used to manually adjust the tree depth.
image_modulate adjusts brightness, saturation and hue of image relative to current.
image_quantize reduces number of unique colors in the image.
image_ordered_dither reduces number of unique colors using a dithering threshold map.
image_map replaces colors of image with the closest color from a reference image.
image_channel extracts a single channel from an image and returns as grayscale.
image_transparent sets pixels approximately matching given color to transparent.
image_background sets background color. When image is flattened, transparent pixels get background color.
image_colorize overlays a solid color frame using specified opacity.
image_contrast enhances intensity differences in image
image_normalize increases contrast by normalizing the pixel values to span the full range of colors
image_enhance tries to minimize noise
image_equalize equalizes using histogram equalization
image_median replaces each pixel with the median color in a circular neighborhood
Note that colors are also determined by image properties imagetype and colorspace
which can be modified via image_convert().
Examples
# manually adjust colorslogo <- image_read("logo:")image_modulate(logo, brightness =200)image_modulate(logo, saturation =150)image_modulate(logo, hue =200)# Reduce image to 10 different colors using various spacesimage_quantize(logo, max =10, colorspace ='gray')image_quantize(logo, max =10, colorspace ='rgb')image_quantize(logo, max =10, colorspace ='cmyk')image_ordered_dither(logo,'o8x8')# Change background colortranslogo <- image_transparent(logo,'white')image_background(translogo,"pink", flatten =TRUE)# Compare to flood-fill method:image_fill(logo,"pink", fuzz =20)# Other color tweaksimage_colorize(logo,50,"red")image_contrast(logo)image_normalize(logo)image_enhance(logo)image_equalize(logo)image_median(logo)# Alternate way to convert into black-whiteimage_convert(logo, type ='grayscale')