corbetti <- system.file("extdata/corbetti.png", package = "recolorize")
init_fit <- recolorize(corbetti,
color_space = "Lab",
method = "k",
n = 30)
# we still have to convert to Lab color space first, since the centers are always RGB:
centers <- grDevices::convertColor(init_fit$centers, "sRGB", "Lab")
plotColorClusters(centers, init_fit$sizes,
scaling = 25,
color_space = "Lab",
xlab = "Luminance",
ylab = "a (red-green)",
zlab = "b (blue-yellow)",
cex.lab = 0.5)
Run the code above in your browser using DataLab