views:

1404

answers:

4

How does one convert an image from one color profile to another (screen to printer, or scanner to screen). In Visual C++ you would use the function in ICM.h, is there a managed way to do this with GDI+?

I need to use GDI+, not WPF. I'd prefer to have a managed solution, but if it is not available, I guess PInkvoke will have to suffice.

+2  A: 

There are a number of solutions.

1) For GDI+, check out this article at MSDN.
2) For WPF (.NET 3.0), see the System.Windows.Media
namespace. There are a number of different classes, such as the BitmapEncoder, that have the concept of a ColorContext, which "Represents the International Color Consortium (ICC) or Image Color Management (ICM) color profile that is associated with a bitmap image."

Both of these seem pretty complex, so there's always the option of buying somebody else's code. Atalasoft's DotImage Photo Pro has ICC profile setting capabilities built in. The code is expensive; a dev license is almost 2k. But based on their participation in the dotnet community, I'd give them a whirl.

Will
+1  A: 

You should take a look at Lcms. Its a colour management system, fairly complete, but written in C. you can use pinvoke, but I would recommend Managed C++ wrapper. I am actually currently working on a managed wrapper around the engine (just the basics, colour profile conversion, lab readings). I can post a link to the code after i am complete. It may be a week or so though.

mattlant
Please do send a link as soon as you are finished! That sounds perfect.
Kris Erickson
A: 

Did this managed wrapper ever get written?

A: 

Graphics Mill .NET imaging SDK supports Little CMS as one of color management engines.

sfedor