Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

at

Return or set pixel value at coordinates


Description

Return or set pixel value at coordinates

Usage

at(im, x, y, z = 1, cc = 1)

at(im, x, y, z = 1, cc = 1) <- value

color.at(im, x, y, z = 1)

color.at(im, x, y, z = 1) <- value

Arguments

im

an image (cimg object)

x

x coordinate (vector)

y

y coordinate (vector)

z

z coordinate (vector, default 1)

cc

colour coordinate (vector, default 1)

value

replacement

Value

pixel values

Functions

  • at<-: set value of pixel at a location

  • color.at: return value of all colour channels at a location

  • color.at<-: set value of all colour channels at a location

Author(s)

Simon Barthelme

Examples

im <- as.cimg(function(x,y) x+y,50,50)
at(im,10,1)
at(im,10:12,1)
at(im,10:12,1:3)
at(im,1,2) <- 10
at(im,1,2)
color.at(boats,x=10,y=10)
im <- boats
color.at(im,x=10,y=10) <- c(255,0,0)
#There should now be a red dot
imsub(im, x %inr% c(1,100), y %inr% c(1,100)) %>% plot

imager

Image Processing Library Based on 'CImg'

v0.42.10
LGPL-3
Authors
Simon Barthelme [aut], David Tschumperle [ctb], Jan Wijffels [ctb], Haz Edine Assemlal [ctb], Shota Ochi [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.