# Import Integer images using ImageImportExportDumpImageReadTIFF

I can import 70000 x 2MB TIFF images (~140GB) using

ImageImportExportDumpImageReadTIFF

in about 3 minutes based on @Szabolcs solution to this question by @Kagaratsch which is fantastic.

However, the image data is converted to floating point numbers <1.

Is there an option for ImageImportExportDumpImageReadTIFF which will preserve the original integer image data?

I tried using the options "Data", "Bit16", "Automatic" which returned \$Failed.

• Hard to help without the actual file. Can you upload your image somewhere and post a link? – M.R. Oct 30 '18 at 17:15
• Please try to put a TIFF file somewhere we can access it, then include code that shows what you expect to get back and what you actually get back. – Jason B. Oct 30 '18 at 18:26
• @DrBubbles you posted a PNG not a TIFF – M.R. Oct 30 '18 at 18:34
• Sorry, I will generate one inline when I get back to my desk – DrBubbles Oct 30 '18 at 18:37
• @DrBubbles - if you solved your problem, consider moving the Update section to a self-answer if you think this will help someone in the future. – Jason B. Oct 30 '18 at 19:18

Update: Just found the problem was my use of ImageData[]. I thought I needed to export the data with "Bit16", I didn't realize (or forgot) I needed to use it with ImageData[] too. Now I get the expected 16 bit integers in import using ImageImportExportDumpImageReadTIFF :

SetDirectory[NotebookDirectory[]];
im1 = Image[RandomInteger[{0, 65535}, {512, 512}], "Bit16"];
Export["im1.tiff", im1];
im2 = ImageImportExportDumpImageReadTIFF[
AbsoluteFileName["im1.tiff"]][[1]];
ImageData[im1, "Bit16"][[1, 1]]
ImageData[im2, "Bit16"][[1, 1]]