R Under development (unstable) (2025-07-24 r88447 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("pixmap") > > x <- read.pnm(system.file("pictures/logo.ppm", package="pixmap")[1]) > dx <- x@size > chx <- getChannels(x) > stopifnot(is(x, "pixmap"), + is(x, "pixmapRGB"), + dx == c(77, 101), + dim(chx) == c(dx, 3)) > par(mfrow = c(2,2)) > plot(x, main = "R logo pixmap") > for(j in 1:3) + plot(pixmapGrey(chx[,, j]), main=paste("channel",j)) > > > x1 <- as(x, "pixmapGrey") > z <- getChannels(x1) > stopifnot(is(z, "matrix"), + dim(z) == dx) > > x2 <- as(x1, "pixmapRGB") > z <- getChannels(x2) > stopifnot(is(z, "array"), + dim(z) == c(dx, 3)) > > proc.time() user system elapsed 0.32 0.07 0.34