library(terra)
library(supercells)
# setwd("")
<- rast(system.file("ex/logo.tif", package = "terra"))
s = supercells(s, 500, compactness = 50,transform='to_LAB')
sc = kmeans(sf::st_drop_geometry(sc[4:6]), centers = 10)
sck plot(sf::st_geometry(sc[0]), col = sck$cluster)