Page 1 of 1

Trouble retrieving information from an Embedded Profile

Posted: 2012-09-04T13:35:56-07:00
by colortheorydeveloper
I am currently attempting to get ahold of an embedded profile from within an image using the MagickWand API, but to no avail. I am not even sure if it is seeing the profiles there at all. They definately show up in the images when they are loaded up in any standard image processing application such as GIMP. First I get a hold of the image. The following gets the image from a src path and the embeddedProfileImage has properties in it such as the correct width, height, etc.

Image *embeddedProfileImage;
MagickBooleanType status;

status = MagickReadImage(magick_wand, [pathToProfiledImage cStringUsingEncoding:NSUTF8StringEncoding]);
embeddedProfileImage = GetImageFromMagickWand(magick_wand);
return [_renderer createFragmentShaderForEmbeddedImage:embeddedProfileImage destinationProfilePath:dstPath];

...

Then, I attempt to get information about the profile from the (Image *)embeddedProfileImage, however, it always returns a null/empty value. The documentation does not seem helpful and I can't find examples of extracting embedded profile data from source code.

...

const StringInfo *profileInfo;
size_t *profileLength;
profileInfo = GetImageProfile(embeddedProfileImage, profileData);
profileInfo = RemoveImageProfile(embeddedProfileImage, "ICC");

???

Something that I am not doing correctly? I have attempted several different approaches to no avail.

Re: Trouble retrieving information from an Embedded Profile

Posted: 2012-09-06T09:09:49-07:00
by colortheorydeveloper
I haven't been able to make any progress on this. I had to make sure that I was indeed using an image with a color profile. One thought that came up was that perhaps if there was only an AdobeRGB or sRGB profile in there that it wouldn't show up in the variable as a profile. Perhaps it would just be a tag that let us know that it was using that default profile. So I assigned a display profile to the image and embedded it. This also results in the profile fields being empty. If there is something that I am not understanding in regards to pulling embedded profile info out of an image, it would be of great help here if someone even had some hints as to what might be wrong and why ImageMagick doesn't detect one present.

Re: Trouble retrieving information from an Embedded Profile

Posted: 2012-09-06T09:55:48-07:00
by fmw42
see http://www.imagemagick.org/script/comma ... hp#profile

write the file to the appropriate type of profile as an image suffix.

Re: Trouble retrieving information from an Embedded Profile

Posted: 2012-09-07T11:20:51-07:00
by colortheorydeveloper
Not really sure what you are getting at with that suggestion. I believe that the ImageMagick library will be capable of pulling out a profile at the command line at the PC level, but I can't get it to remove a profile at the Mobile operating system on iOS. I have been trying to use the MagickWand API for doing this. But the...

Image *embeddedProfileImage;

...doesn't even recognize that there is a color profile inside of it after successfully returning from a "MagickReadImage( )". The rest of the data is there such as ImageType, width, height, etc. I was hoping that someone had experience using the API to pull an embedded profile out. Or perhaps it currently isn't capable on the mobile side yet.

Re: Trouble retrieving information from an Embedded Profile

Posted: 2012-09-11T09:34:06-07:00
by colortheorydeveloper
Some of the built-in CImage libraries have capabilities it seems to pull an embedded profile out of a TIFF, but not JPEG. At least not directly. As previous hinted at, I could do a conversion and pull a profile out, but in real-time swiping between images, doing conversions all the time from image to image doesn't sound all that feasible of a solution.

I prefer the simplicity of the ImageMagick library for handling images that I have experienced thus far. One last hope that someone has extracted a profile with MagickWand out there somewhere.

Re: Trouble retrieving information from an Embedded Profile

Posted: 2012-09-11T10:43:16-07:00
by fmw42
see http://www.imagemagick.org/script/comma ... hp#profile

I believe all you have to do is write the output to a file with suffix=type of profile, e.g profile.icm or profile.icc, etc

convert image.jpg profile.icm

convert image.jpg profile.icc

I have never tried this, so just going by what the docs say.