Convert an image's pixels to a vector of RGB objects.

Description

This function converts the channels of a raster image to a vector of colorspace library RGB objects. These objects can be processed using colorspace functions and vector processing functions.

Usage

1

Arguments

image

An RGB raster image

Value

A vector of colorspace RGB objects, one for each pixel in the image. Rows can be extracted from this as ranges within the vector.

Examples

1
2
3
4
5
6
library(CulturalAnalytics)
library(jpeg)
imgdir<-paste(system.file(package = "CulturalAnalytics"), "images", sep = "/")
imgs<-paste(imgdir, dir(path = imgdir, pattern = ".jpg"), sep = "/")
img<-readJPEG(imgs[1])
rgbs<-imageToRgb(img)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.