[vtkusers] exporting TIFF and JPEG images : one work the other not

Mathieu Malaterre mathieu.malaterre at kitware.com
Tue Feb 17 09:57:11 EST 2004


Sébastien MARAUX wrote:
> Hello,
> 
>  
> 
> Here is the issue :
> 
> I Read a tiff file  (guessed to be RGBA as it has 4 components ?) with 
> vtkTiffReader
> 
> I clip this image and export it :
> 
> If I export the vtkImageData to a tif file : it is OK. With vtkTIFFWriter
> 
> If I do the same with a vtkJPEGwriter, then it produce a black image of 
> the correct size. What is wrong ?

Sébastien,

What is the type of your image (unsigned char, char, float, double...) ? 
What is the scalar range of your image ?

vtkImageData *im = JPEGWriter->GetInput();
cout << im->GetScalarRange()[0] << "," << im->GetScalarRange()[1];

Thanks
Mathieu





More information about the vtkusers mailing list