library(rimage)
oldpar <- par(no.readonly=TRUE)
par(mfrow=c(2, 1))
data <- read.jpeg("frogs.jpg")
title <- paste("JPEG image data (", nrow(data), "x", ncol(data), ",", attr(data, "type"), ")")
plot(data, main=title)
breaks <- 100
hist(data, breaks=breaks, col=gray(0 : breaks / breaks), xlab=NULL, ylab=NULL, main=NULL)
par(oldpar)
