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
 Color management question
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Andy_Bell

United Kingdom
37 Posts

Posted - Feb 28 2021 :  17:38:20  Show Profile  Reply
Hi

I have an image, in ppm format, held in a stream. It has no built in ICC profile but I know that it was originally created with the ProPhoto profile.

I want to get it to display properly so I'm trying this:

IEGlobalSettings()->EnableCMS = true;
IEGlobalSettings()->ApplyColorProfileOnRendering = true;
IE->IO->Params->DefaultICCProfile->LoadFromFile("ProPhoto_RGB.icc");
IE->IO->NativePixelFormat = false;
IE->IO->LoadFromStreamPXM(stream);

However, the profile is not applied and

IE->IO->Params->InputICCProfile->IsApplied

returns false.

Maybe I'm reading the helpfile wrongly, but shouldn't the above code cause the profile to be applied? Commenting out the line IE->IO->NativePixelFormat = false;
or changing the value to true makes no difference...

Andy


Andy

xequte

39053 Posts

Posted - Mar 19 2021 :  19:02:32  Show Profile  Reply
Hi Andy

At this time color profiles can only be applied to JPEG (RGB and CMYK) and TIFF images.

Otherwise you can manually apply profiles as follows:

// Apply InputICCProfile (AdobeRGB1998.icc) color profile to image and output as OutputICCProfile (Defaults to sRGB)
// Note: This permanently changes the colors of the image
ImageEnView1.IO.LoadFromFile('C:\out.ppm');
ImageEnView1.IO.Params.InputICCProfile.LoadFromFile('C:\AdobeRGB1998.icc');
ImageEnView1.IO.Params.InputICCProfile.ConvertBitmap( ImageEnView1.IEBitmap, ie24RGB, ImageEnView1.IO.Params.OutputICCProfile );


Note: "ProPhoto_RGB.icc" is not recognised as valid by the Windows CMS.

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

Andy_Bell

United Kingdom
37 Posts

Posted - Mar 22 2021 :  19:54:35  Show Profile  Reply
Thanks

Andy

Andy
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: