changePixelColor {biopixR}R Documentation

Change the color of pixels

Description

The function allows the user to alter the color of a specified set of pixels within an image. In order to achieve this, the coordinates of the pixels in question must be provided.

Usage

changePixelColor(img, coordinates, color = "purple", visualize = FALSE)

Arguments

img

image (import by importImage)

coordinates

specifying which pixels to be colored (should be a x|y data frame).

color

color to be applied to specified pixels:

  • color from the list of colors defined by colors

  • object of class factor

visualize

if TRUE the resulting image gets plotted

Value

Object of class 'cimg' with changed colors at desired positions.

References

https://CRAN.R-project.org/package=countcolors

Examples

coordinates <-
  objectDetection(beads,
                  method = 'edge',
                  alpha = 1,
                  sigma = 0)
changePixelColor(
  beads,
  coordinates$coordinates,
  color = factor(coordinates$coordinates$value),
  visualize = TRUE
)

[Package biopixR version 1.1.0 Index]