Description Usage Arguments Value See Also Examples
A wrapper for countColors
that finds every image (JPEG or PNG) in a #' folder and counts colors in each image.
1 2 3 4 |
folder |
Path to a folder containing images. |
color.range |
Type of range being specified. Must be either "spherical" or "rectangular". |
center |
A vector or n x 3 matrix of color centers (RGB triplets) around which to search using spherical color range. RGB range 0-1 (not 0-255). See details. |
radius |
Values between 0 and 1 specifying the size of the area around
|
lower |
RGB triplet(s) specifying the bounds of color space to search. Must be the same length. See details. |
upper |
RGB triplet(s) specifying the bounds of color space to search. Must be the same length. See details. |
bg.lower |
RGB triplets specifying the bounds of color space to
ignore as background, or |
bg.upper |
RGB triplets specifying the bounds of color space to
ignore as background, or |
target.color |
If an indicator image is created, the color with which to
replace specified pixels. Can be either an RGB triplet or one of the
colors listed by |
plotting |
Logical. Should output be plotted in the plot window? |
save.indicator |
Logical OR path for saving indicator image. If TRUE, saves image to the same directory as the original image as 'originalimagename_masked.png'; if a path is provided, saves it to that directory/name instead. |
dpi |
Resolution (dots per image) for saving indicator image. |
return.indicator |
Logical. Should an indicator image (RGB array with targeted pixels changed to indicator color) be returned? |
A list of countColors
lists, one for each image.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
folder <- system.file("extdata", package = "countcolors")
# Screen out white in both the flower image and the pelican image
upper <- c(1, 1, 1)
lower <- c(0.8, 0.8, 0.8)
white.screen <- countcolors::countColorsInDirectory(folder, color.range =
"rectangular", upper = upper, lower = lower, bg.lower = NULL, plotting =
TRUE, target.color = "turquoise")
## End(Not run)
|
5 images
Using rectangular bound(s):
R: 0.8-1; G: 0.8-1; B: 0.8-1
Image: bat_wing.png
Image: flowers.jpg
Image: pelicans.jpg
Image: photoshop.png
Image: white_bg.png
Warning messages:
1: In removeBackground(img, lower = lower, upper = upper, quietly = alpha.message, :
No transparent pixels in image
2: In removeBackground(img, lower = lower, upper = upper, quietly = alpha.message, :
No transparent pixels in image
3: In removeBackground(img, lower = lower, upper = upper, quietly = alpha.message, :
No transparent pixels in image
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.