## Read and display an image
f = system.file("images", "sample-color.png", package="EBImage")
x = readImage(f)
display(x)
## Read and display a multi-frame TIFF
y = readImage(system.file("images", "nuclei.tif", package="EBImage"))
display(y)
## Read an image directly from a remote location by specifying its URL
try({
im = readImage("http://www-huber.embl.de/EBImage/ExampleImages/berlin.tif")
display(im, title = "Berlin Impressions")
})
## Convert a PNG file into JPEG
tempfile = tempfile("", , ".jpeg")
writeImage(x, tempfile, quality = 85)
cat("Converted '", f, "' into '", tempfile, "'.\n", sep="")
## Save a frame sequence
files = writeImage(y, tempfile("", , ".jpeg"), quality = 85)
cat("Files created: ", files, sep="\n")
Run the code above in your browser using DataLab