ImageEn, unit iesettings

TIEImageEnGlobalSettings.AutoSetBitDepth

TIEImageEnGlobalSettings.AutoSetBitDepth


Declaration

property AutoSetBitDepth: Boolean;


Description

When enabled, PixelFormat is used as the authoritative source of bit depth, and sets SamplesPerPixel/BitsPerSample where they are not valid for that PixelFormat.
If enabled, it is suggested to set following properties:
  ImageEnView1.LegacyBitmap := False; // Do not use TBitmap (this is the default)
  ImageEnView1.IO.NativePixelFormat := True; // Use the original pixel format

The following properties may be affected by AutoSetBitDepth:
- SamplesPerPixel
- BitsPerSample
- JPEG_ColorSpace
- J2000_ColorSpace
- TIFF_PhotometInterpret
- TIFF_JPEGColorSpace

Default: False


Example

// load a PNG and save a JPEG: don't care about pixel formats incompatibilities between file formats,
// for example when input.png is a 256 colors palette image, it will be converted to true RGB jpeg image.
IEGlobalSettings().AutoSetBitDepth := True;
ImageEnView.IO.LoadFromFile('input.png');
ImageEnView.IO.SaveToFile('output.jpeg');