i have a few RGB Images. Some have a Color Profile assigned, some don´t have. Now i want to draw those Images onto another "base" Image. How do i have to draw such an image (lets call it image1) onto the base Image, to keep the Colors of image1 like they would look like with the assigned Color Profile. So no printing with "Raw Colors", but with the Raw Colors + the assigned Color Profile.
If you need to draw some image1 onto base_image using color management you should walk through these steps:
Make sure that the both of images have color profiles;
Convert image1 to base_image pixel format using color management where destionation profile is one of base_image. You should perform this action even through images have the same pixel format. This step can be skipped if the images have the same color profile;
Could you explain which profile do you want to assign to destination image: sRGB or color profile of theBitmap? Also your code has the issue: you set destination profile of theBitmap to profile which has already been assigned to theBitmap
This Image will be populated with different other Images, that has an assigned Color Profile or not. That can be a Photo with the ColorProfile of the Camera, that can be a downloaded Image from the Internet.. and so on. No matter what Image will be drawn on the base Image, each has to be drawn, like it looks originally.
I tried this with the Code that you see above. Can you help me with a code example how i can keep the Colors of the Images, drawn onto the base Image.
Tha main idea is to convert colors of the both of images (background and original image) to the same destination color profile. The following code sample illustartes how to perform this task:
int width = 100;
int height = 100;
// Create background.
Aurigma.GraphicsMill.Bitmap theTiffImage = new Aurigma.GraphicsMill.Bitmap();
theTiffImage.Unit = Aurigma.GraphicsMill.Unit.Mm;
theTiffImage.HorizontalResolution = 300;
theTiffImage.VerticalResolution = 300;
theTiffImage.Create(width, height, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb);
using(Aurigma.GraphicsMill.Drawing.GdiGraphics g = theTiffImage.GetGdiGraphics())
{
g.Clear(Aurigma.GraphicsMill.RgbColor.Transparent);
}
// Set destination color profile for background.
theTiffImage.ColorProfile = new Aurigma.GraphicsMill.ColorProfile(@"y:/colorconversion/rgbconvert.icm");
// Load image and convert it using destination color profile.
Aurigma.GraphicsMill.Bitmap theBitmap = new Aurigma.GraphicsMill.Bitmap();
theBitmap.Load( @"y:/colorconversion/rgb24.jpg");
theBitmap.ColorManagement.ColorManagementEnabled = true;
theBitmap.ColorManagement.RgbColorProfile = new Aurigma.GraphicsMill.ColorProfile(@"y:/colorconversion/rgbconvert.icm");
theBitmap.ColorManagement.Convert( theTiffImage.PixelFormat );
// Draw image on background.
theBitmap.Draw(theTiffImage, 10, 10, theBitmap.Width, theBitmap.Height, Aurigma.GraphicsMill.Transforms.CombineMode.Copy, 1f, Aurigma.GraphicsMill.Transforms.InterpolationMode.HighSpeed);
// Save the result.
theTiffImage.Save(@"d:/temp/temp.tif");
ok, i understood this. Thx. But what if, i have to draw two Images on the Background Image, that have different Color Profiles? The first Image, drawn onto the Background Image, looks different after the second has been drawn onto the Background, because of the other Color Profile.
Or won´t the second draw effekt the look of the first Image?