Open sihanwusean opened 1 year ago
I figure it out now:
Basically, just turn the cimg into an object, then use the raster() in the raster package and writeRaster() for the output. I wish this feature can be built into the save.image() in the future though.
library(imager)
library(raster)
red = raster(cimg2im(red))
writeRaster(red, "red.tiff", options = "COMPRESS=LZW")
Hi, Do you know how to save a cimg class as tiff with LZW compression? Currently, the save.image() function can only output uncompressed tiff. I wonder if there's another way to get around it. Thank you!