Skip to content
Back to formatted view

Raw Message

Message-ID: <CAHLp6SBA5uWVEEff8CSP4U1o+3dCJYrsDi3WRByD+XzUd6XScg@mail.gmail.com>
Date: 2021-03-24T17:54:37Z
From: Vivek Sutradhara
Subject: converting image formats

Hi,
I would like to have help in converting from one image format to another
(between the packages EBImage, magick and imager). The magick package has
functions for this. But the EBImage and imager packages do not have
in-built functions for the conversion. It is, of course, possible to save
the images and then open with the other packages. But I am looking for more
direct options. I do not know how to assign data to the "slots" in the
functions.

### convert image formats
library(magick)
nuc_MAG_o <- image_read(system.file("images", "nuclei.tif",
package="EBImage"))
nuc_MAG_to_EB <- as_EBImage(manMAG)
nuc_MAG_to_IMG <- magick2cimg(manMAG,alpha="flatten")

# convert from EBImage
library(EBImage)
nucEBo <-  readImage(system.file("images", "nuclei.tif", package="EBImage"))
writeImage(nucEBo, "C:/Rfiles/nuclei-3.jpg")
nucEB_to_IMG <-
nucEB_to_MAG <-

#convert from imager
library(imager)
nuc_IMG_o <- load.image("C:/Rfiles/nuclei-3.jpg")
nuc_IMG_to_EB <-
nuc_IMG_to_MAG <-

All help is appreciated.
Thanks,
Vivek

	[[alternative HTML version deleted]]