ImageEn, unit iexBitmaps

TIOParams.TIFF_PhotometInterpret

TIOParams.TIFF_PhotometInterpret

Declaration

property TIFF_PhotometInterpret: TIOTIFFPhotometInterpret;

Description

Specifies the Photometric interpretation of a TIFF image.

Note:
If you are using a TIEMultiBitmap or TImageEnMView, you can use DuplicateCompressionInfo to propagate the parameter to all frames
To save using the following: ioTIFF_WHITEISZERO, ioTIFF_BLACKISZERO, ioTIFF_RGBPALETTE, ioTIFF_TRANSPMASK, the SamplesPerPixel of the image must be 1, or the PixelFormat one of ie1g, ie8p, ie8g, ie16g, ie32f with AutoSetBitDepth enabled

Default: ioTIFF_RGB

Examples

// Save TIFF as 32bit gray-scale (ie32f)
// Note: Compression must be: ioTIFF_UNCOMPRESSED, ioTIFF_LZW, ioTIFF_PACKBITS or ioTIFF_ZIP
ImageEnView1.LegacyBitmap := false;
ImageEnView1.IEBitmap.PixelFormat := ie32f;
ImageEnView1.IO.Params.BitsPerSample := 32;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
ImageEnView1.IO.Params.TIFF_PhotometInterpret := ioTIFF_BLACKISZERO;
ImageEnView1.IO.Params.TIFF_Compression := ioTIFF_UNCOMPRESSED;
ImageEnView1.IO.SaveToFileTIFF('D:\GrayTiff32.tiff');


// Save a PNG with alpha to TIFF
ImageEnView1.IO.LoadFromFile( 'D:\Alpha.png' );
ImageEnView1.IEBitmap.PixelFormat             := ie24RGB;
ImageEnView1.IO.Params.TIFF_PhotometInterpret := ioTIFF_RGB;
ImageEnView1.IO.Params.SamplesPerPixel        := 4;
ImageEnView1.IO.Params.BitsPerSample          := 8;
ImageEnView1.IO.Params.TIFF_Compression       := ioTIFF_UNCOMPRESSED;
ImageEnView1.IO.SaveToFile( 'D:\Alpha.TIFF' );


ImageEnView1.IO.Params.TIFF_Compression := ioTIFF_UNCOMPRESSED;
ImageEnView1.IO.Params.BitsPerSample    := 1;
ImageEnView1.IO.Params.SamplesPerPixel  := 1;
ImageEnView1.IO.Params.TIFF_PhotometInterpret := ioTIFF_BLACKISZERO;
ImageEnView1.IO.SaveToFile('D:\output.tif');

// Which is the same as...
IEGlobalSettings().AutoSetBitDepth := True;
ImageEnView1.IEBitmap.PixelFormat := ie1g;
ImageEnView1.IO.Params.TIFF_Compression := ioTIFF_UNCOMPRESSED;
ImageEnView1.IO.Params.TIFF_PhotometInterpret := ioTIFF_BLACKISZERO;
ImageEnView1.IO.SaveToFile('D:\output.tif');

See Also

PixelFormat
SamplesPerPixel
BitsPerSample
JPEG_ColorSpace
J2000_ColorSpace
TIFF_JPEGColorSpace
AutoSetBitDepth