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
 The problem while saving a file with 256 colors.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

graph_man

326 Posts

Posted - Feb 01 2022 :  18:59:58  Show Profile  Reply
The problem while saving a TIFF file with 256 colors.
The resulting file is greater than when saving 24 bits.
I can send a file to Nigel.

graph_man

326 Posts

Posted - Feb 01 2022 :  19:10:03  Show Profile  Reply
Although the Advanced dialog box shows a completely different file size.
Go to Top of Page

xequte

38222 Posts

Posted - Feb 01 2022 :  19:42:10  Show Profile  Reply
Hi

Some compression types, like JPEG, cannot be used with 256 colors, so an alternative compression is substituted. This can make the file size larger.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

graph_man

326 Posts

Posted - Feb 02 2022 :  03:52:54  Show Profile  Reply
Compression is the same for all tested colors - LZW.

Try saving your file in 16, 256 and 24k colors and you will see the problem.
Go to Top of Page

graph_man

326 Posts

Posted - Feb 02 2022 :  07:06:27  Show Profile  Reply
I sent you my file.
Go to Top of Page

xequte

38222 Posts

Posted - Feb 02 2022 :  20:52:41  Show Profile  Reply
Hi

What is your code? The following gave me expected results:

  ImageEnView1.IO.LoadFromFile('d:\KM num-bw.tif');
  ImageEnView1.IO.Params.TIFF_Compression := ioTIFF_LZW;
  IEGlobalSettings().AutoSetBitDepth := true;
  ImageEnView1.IEBitmap.PixelFormat := ie24RGB;
  ImageEnView1.IO.SaveToFile('d:\KM num-bw_24bit.tif');         // 707 KB

  ImageEnView1.IO.LoadFromFile('d:\KM num-bw.tif');
  ImageEnView1.IO.Params.TIFF_Compression := ioTIFF_LZW;
  IEGlobalSettings().AutoSetBitDepth := true;
  ImageEnView1.IEBitmap.PixelFormat := ie8g;
  ImageEnView1.IO.SaveToFile('d:\KM num-bw_8bit.tif');          // 325 KB

  ImageEnView1.IO.LoadFromFile('d:\KM num-bw.tif');
  ImageEnView1.IO.Params.TIFF_Compression := ioTIFF_LZW;
  IEGlobalSettings().AutoSetBitDepth := true;
  ImageEnView1.IEBitmap.PixelFormat := ie1g;
  ImageEnView1.IO.SaveToFile('d:\KM num-bw_1bit.tif');          // 100 KB


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

graph_man

326 Posts

Posted - Feb 03 2022 :  04:09:24  Show Profile  Reply
My code is

ImageEnView1.IO.LoadFromFile('d:\KM num-bw.tif');
Imageendialog - colors = 8bit - save
ImageEnView1.IO.SaveToFile('d:\KM num-bw_8bit.tif');
Go to Top of Page

xequte

38222 Posts

Posted - Feb 06 2022 :  21:18:13  Show Profile  Reply
Hi

The image (KM num-bw.tif) contains an unused Alpha channel, so ImageEn auto-fixes your TIFF properties to ensure it is compatible.

You can prevent this by removing the unused alpha channel (which we will do automatically in the next update).

If ImageEnView1.IEBitmap.HasAlphaChannel(True) = False then
  ImageEnView1.IEBitmap.RemoveAlphaChannel();


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

graph_man

326 Posts

Posted - Feb 07 2022 :  04:36:52  Show Profile  Reply
Thank you
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: