Lucaaas
Lucaaas

Reputation: 1

Write TIFF float images using CImg

I'm using CImg and I have noticed that I cant write TIFF images with float data. CImg wrotes them as 1byte/per pixel integer images.

¿Does anyone know if it is possible to write float images? Or, do you know other lib to do it.

Upvotes: 0

Views: 2788

Answers (1)

Anne O' Nymous
Anne O' Nymous

Reputation: 31

CImg has probably one of the best tiff support of all image processing libraires out there, and is perfect to read/write float-valued multi-spectral images. But, you have to link your code with the libtiff library to allow it, by defining the macro 'cimg_use_tiff' as a compilation variable :

 #define cimg_use_tiff
 #include "CImg.h"

 ..

 CImg<float> img(..);
 img.save_tiff("file_float.tiff");

Upvotes: 3

Related Questions