ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIFF - LZW compression - 16 bit
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

graphman

259 Posts

Posted - Oct 12 2011 :  02:51:17  Show Profile  Reply
Is there a way to save file to TIFF format with LZW compression and 16 bit color depth?

How?

fab

1310 Posts

Posted - Oct 12 2011 :  03:04:59  Show Profile  Reply
You have to set BitsPerSample=16 and set the compression.
This example converts input file to 16 bit per channel and compress it using LZW:

  // load input.jpg
  ImageEnView1.IO.LoadFromFile('input.jpg');

  // convert image to 48 bit RGB
  ImageEnView1.LegacyBitmap := false;
  ImageEnView1.IEBitmap.PixelFormat := ie48RGB;
  
  // save as LZW, 16 bit per channel
  ImageEnView1.IO.Params.TIFF_Compression := IoTIFF_LZW;
  ImageEnView1.IO.Params.TIFF_PhotometInterpret := ioTIFF_RGB;
  ImageEnView1.IO.Params.BitsPerSample := 16;
  ImageEnView1.IO.Params.SamplesPerPixel := 3;
  ImageEnView1.IO.SaveToFile('output.tif');

Go to Top of Page

graphman

259 Posts

Posted - Oct 12 2011 :  03:51:26  Show Profile  Reply
Thanks.

BUT

What these strings for?

// convert image to 48 bit RGB
ImageEnView1.LegacyBitmap := false;
ImageEnView1.IEBitmap.PixelFormat := ie48RGB;
Go to Top of Page

fab

1310 Posts

Posted - Oct 12 2011 :  04:28:02  Show Profile  Reply
quote:
ImageEnView1.LegacyBitmap := false;

It tells ImageEn to use TIEBitmap instead of TBitmap. TIEBitmap can handle 16 bit per channel RGB images, while TBitmap cannot.

quote:
ImageEnView1.IEBitmap.PixelFormat := ie48RGB;

It converts current image (8 bit per channel RGB) to 16 bit per channel RGB.
Go to Top of Page

graphman

259 Posts

Posted - Oct 12 2011 :  06:56:00  Show Profile  Reply
Thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: