Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert tiff image to jpeg using r [closed]

Tags:

r

image

jpeg

tiff

I have a hundred image that are in TIFF format, I want to convert them to JPEG format. I use the R language. could you please tell me what function or what package should I use to make this conversion in r. Thank you in advance.

like image 476
user3793982 Avatar asked Dec 12 '14 08:12

user3793982


1 Answers

An indirect way to convert tiff to jpeg image is to read TIFF image and then write JPEG using package tiff and jpeg. For example:

#Load
library("jpeg")
library("tiff")

img <- readTIFF("origin.tiff", native=TRUE)
writeJPEG(img, target = "Converted.jpeg", quality = 1)
like image 188
Tĩnh Trần Avatar answered Oct 09 '22 21:10

Tĩnh Trần