Learn R Programming

qoi (version 0.1.0)

writeQOI: Write an QOI image from an RGB(A) raster array or matrix

Description

Write an QOI image from an RGB(A) raster array or matrix

Usage

writeQOI(image, target = raw())

Value

The result is either stored in a file (if target is a file name), in a raw vector (if target is a raw vector) or sent to a binary connection.

Arguments

image

matrix (required): Image represented by a integer matrix or array with values in the range of 0 to 255.

target

character or connections or raw: Either name of the file to write, a binary connection or a raw vector (raw() - the default - is good enough) indicating that the output should be a raw vector.

Author

Johannes Friedrich

Examples

Run this code
## (1) Write to raw() -> see bytes
bin <- writeQOI(Rlogo_RGBA)
rawToChar(head(bin)) ## qoif

if (FALSE) {
## (2) Write to a *.qoi file
writeQOI(Rlogo_RGBA, "Rlogo_RGBA.qoi")
}

Run the code above in your browser using DataLab