img_write: Write an image

View source: R/img_write.R

img_writeR Documentation

Write an image

Description

Write an image

Usage

img_write(x, file, quality = 0.9)

Arguments

x

an image, of type imager::cimg().

file

path to the output file; the extension determines the format.

quality

image quality, for JPG output only.

Value

The path to the written file, invisibly (assign it to a variable to capture it).

Examples

path <- system.file("extdata", "blob.jpg", package="morphr")
x <- img_read(path)
out <- img_write(x, file=tempfile(fileext=".jpg"))
out
out <- img_write(x, file=tempfile(fileext=".png"))
out

jiho/morphr documentation built on May 11, 2024, 9:32 p.m.