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
 Problem Palette Color in Save as PCX
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

zavf

Iran
22 Posts

Posted - Jan 23 2019 :  08:44:48  Show Profile  Reply
Hi

When Save bmp to PCX with xnShell then output file color palette its ok but when use ImageEn to Convert bmp to Pcx then color palette its not correct same as source file






Use this Code for Load

  // Don't use Windows Bitmaps
  ImageEnView1.LegacyBitmap := False;

  // Load images in native format
  ImageEnView1.IO.NativePixelFormat := true;

  with ImageEnView1.IO do
    LoadFromFileAuto( ExecuteOpenDialog());

  // if the bitmap is not 8 bit paletted then convert it
  if ImageEnView1.IEBitmap.PixelFormat <> ie8p then
    ImageEnView1.IEBitmap.PixelFormat := ie8p;

  ShowPalette;




and Save PCX

ImageEnView1.IO.Params.BitsPerSample := 8;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
ImageEnView1.IO.SaveToFilePCX('D:\image.pcx');


Thanks

xequte

38611 Posts

Posted - Jan 23 2019 :  17:23:53  Show Profile  Reply
Hi

You are downsampling the image to 256 colors if it is not 256 colors. Is the source image 256 colors? Please attach it.



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

zavf

Iran
22 Posts

Posted - Jan 24 2019 :  16:51:02  Show Profile  Reply
@xequte Thanks
attached prj and graphic bmp sample

attach/zavf/2019124165027_Palette.zip
1953.25 KB
Go to Top of Page

xequte

38611 Posts

Posted - Jan 24 2019 :  22:15:23  Show Profile  Reply
Hi

The demo works as I would expect. I load "50.100 S bahar.bmp" which has 10 colors and save to "image.pcx". When I reload "image.pcx" it still has 10 colors.


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

zavf

Iran
22 Posts

Posted - Jan 25 2019 :  05:15:37  Show Profile  Reply
Thanks
Yes Pcx file has 10 Color and similar bmp but in photoshop /XnView Color Table Show Some Colors has dont use in image but xnShell Convert PCX only output used color in pcx file and color table with source image has Equals

my problem in PCX Color Table has Show Unused Color has dont in bmp file
Go to Top of Page

zavf

Iran
22 Posts

Posted - Jan 25 2019 :  19:05:49  Show Profile  Reply
new problem with color Table

When Image Resample/Resize then color table miss , its mean image show find as source but color table index miss with source image
@xequte Please this Sample and open Teset.bmp then click button "Half Bmp" then Compare Image Color Teset.bmp with hhhalf.bmp in photoshop / xnview (Ctrl+M)

Thanks

Teset.bmp


hhhalf.bmp




attach/zavf/2019125185928_Prj.zip
3007.82 KB
Go to Top of Page

xequte

38611 Posts

Posted - Jan 27 2019 :  17:42:21  Show Profile  Reply
Hi

ImageEn does not sort colors when saving. Can you advise how you would use this functionality?



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: