This project has moved. For the latest updates, please go here.

How to get "icc:model" of an image

Mar 4, 2015 at 8:04 AM
I get null trying to get "icc:model" attribute from my Image.

But it's working for "description". When I do image.GetAttribute("icc:description"), it's not null

When I use Identify -verbose myimage.jpg, in Properties section I see both icc:model and icc:description.

I create MagickImage object this way

byte[] data = new byte[file.ContentLength];
file.InputStream.Read(data, 0, file.ContentLength);
MagickImage image = new MagickImage(data);

InputStream isn't null.
data isn't null. Even converted it to String to look what's happening there :)

What can I do wrong?
Coordinator
Mar 4, 2015 at 8:27 AM
Can you add a link to the image you are using? Feel free to contact me through CodePlex if you don't want to publicly share your image.
Mar 4, 2015 at 8:33 AM
Edited Mar 4, 2015 at 8:35 AM
I'm Sorry. Seems it was a Visual Studio issue. Now it's all working fine. Thank you for answering
Mar 4, 2015 at 10:35 AM
Edited Mar 4, 2015 at 10:48 AM
But still. How to know color model of an image? Is there a 100% true way? I tried to do this by icc:model, but it seems like bmp files can't have such properties, and png files don't have icc:model for sRGB.
I converted bmp and png files to sRGB and Adobe RGB color models using photoshop and online converter. Photoshop defines them as sRGB or Adobe RGB, But using "identify" I can't find any property to define my pic

What is the right way to know is my pic is sRGB or anyOther RGB using Magick.net?

Thank you for your patience.

Here are links to my pics if they are needed

1_srgb.bmp: https://drive.google.com/open?id=0B4yo-MaegHW6MjViV0QxcHJ2X0U&authuser=0

2_srgb.png https://drive.google.com/open?id=0B4yo-MaegHW6QVJ3UmlMZjlmUjA&authuser=0

2_AdobeRgb.png https://drive.google.com/open?id=0B4yo-MaegHW6ZnRjUUYzM3lCNzQ&authuser=0
Coordinator
Mar 4, 2015 at 11:09 AM
I am not sure if Magick.NET will be the right tool for you if you need a "100% true way". Look at this part from the documentation (http://www.imagemagick.org/script/color-management.php):

ImageMagick supports color profiles, however, for images without a profile or a declaration of colorspace, ImageMagick assumes non-linear sRGB.

image.GetAttribute("icc:model") looks at the color profile and returns the name from an embedded profile if it exists.
Mar 5, 2015 at 2:10 AM
Thank you) This information can be very helpful for me!