Description Usage Arguments Details Value
View source: R/color_by_density.R
I think this code is adapted from a blog post by Will R Chase. This takes an image and maps new colors by density then saves the image with the new name. This uses EBImage from Bioconductor.
1 | color_by_density(new_name, image_path, palette, mode = "grey")
|
new_name |
the new name for the file |
image_path |
the path to the source image |
palette |
the new palette to apply |
mode |
A character value specifying target mode for conversion using EBIImage See details |
Conversion Modes:
"rgb"
: Converts a Grayscale image or an array into a Color image, replicating RGB channels.
"gray" or "grey"
Converts a Color image into a Grayscale image, using uniform 1/3 RGB weights.
red, green, blue
: Extracts the red, green or blue channel from a Color image. Returns a Grayscale image.
asred, asgreen, asblue
: Converts a Grayscale image or an array into a Color image of the specified hue.
nothing
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.