Learn R Programming

imager (version 0.14)

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

Description

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

Usage

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

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

Value

  • an image object (class cimg)

Examples

Run this code
imfill(20,20) %>% plot #Blank image of size 20x20
imfill(20,20,val=c(1,0,0)) %>% plot #All red image

Run the code above in your browser using DataLab