# NOT RUN {
# Change a rectangle in the center to black
flowers <- jpeg::readJPEG(system.file("extdata", "flowers.jpg", package =
"countcolors"))
sinister.object <- expand.grid(c(114:314), c(170:470))
countcolors::changePixelColor(flowers, sinister.object, target.color = "black")
# }
# NOT RUN {
# Change all the white flowers to magenta
indicator.img <- countcolors::sphericalRange(flowers, center = c(1, 1, 1),
radius = 0.1, color.pixels = TRUE, plotting = FALSE)
countcolors::changePixelColor(flowers, indicator.img$pixel.idx,
target.color="magenta")
# }
Run the code above in your browser using DataLab