View source: R/find_dominant_colour.R
find_dominant_colour | R Documentation |
This function finds the dominant colour in an image. This is used when the option
"remove_dominant_colour" argument in
pairwise_comparison()
is TRUE.
find_dominant_colour(image)
image |
The image in which the dominant colour must be determined |
Dominant colour
This is part of a suite of functions required to compare images.
Kurinchi Gurusamy
https://sites.google.com/view/equal-group/home
pairwise_comparison()
# Create a plot and save this as file
filename <- tempfile(fileext = ".png")
png(filename)
plot.new()
hist(rnorm(100))
recordPlot()
dev.off()
# Read image
library(magick)
image <- image_read(filename)
# Perform the function
results <- find_dominant_colour(image)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.