imfill: Create an image of custom size by filling in repeated values

Description Usage Arguments Value Author(s) Examples

Description

This is a convenience function for quickly creating blank images, or images filled with a specific colour. See examples.

Usage

1
imfill(x = 1, y = 1, z = 1, val = 0, dim = NULL)

Arguments

x

width (default 1)

y

height (default 1)

z

depth (default 1)

val

fill-in values. Either a single value (for grayscale), or RGB values for colour, or a character string for a colour (e.g. "blue")

dim

dimension vector (optional, alternative to specifying x,y,z)

Value

an image object (class cimg)

Author(s)

Simon Barthelme

Examples

1
2
3
4
imfill(20,20) %>% plot #Blank image of size 20x20
imfill(20,20,val=c(1,0,0)) %>% plot #All red image
imfill(20,20,val="red") %>% plot #Same, using R colour name
imfill(dim=dim(boats)) #Blank image of the same size as the boats image


Search within the imager package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.