This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
camelord  
#1 Posted : Wednesday, September 27, 2006 10:31:02 PM(UTC)
camelord

Rank: Member

Groups: Guest
Joined: 5/31/2006(UTC)
Posts: 20

Hi,

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.

I hope you know what i mean

regards

Christian

Dmitry  
#2 Posted : Thursday, September 28, 2006 8:45:14 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Guest
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

If you need to draw some image1 onto base_image using color management you should walk through these steps:

  1. Make sure that the both of images have color profiles;

  2. 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;

  3. Draw image1 onto base_image.
That is all.
Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

camelord  
#3 Posted : Thursday, September 28, 2006 11:05:43 PM(UTC)
camelord

Rank: Member

Groups: Guest
Joined: 5/31/2006(UTC)
Posts: 20

hi dmitry,

i dont get the Colors like Photoshop gets them.

Here is the Code

Code:
Aurigma.GraphicsMill.Bitmap theTiffImage = new Aurigma.GraphicsMill.Bitmap();
            theTiffImage.Unit = Aurigma.GraphicsMill.Unit.Mm;
            theTiffImage.HorizontalResolution = 300;
            theTiffImage.VerticalResolution = 300;
            theTiffImage.ColorManagement.ColorManagementEnabled = true;
            theTiffImage.Create(myTiffImageSize[0], myTiffImageSize[1], Aurigma.GraphicsMill.PixelFormat.Format32bppArgb);
            theTiffImage.ColorProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb();
            Aurigma.GraphicsMill.Drawing.GdiGraphics g = theTiffImage.GetGdiGraphics();
            g.Clear(Aurigma.GraphicsMill.RgbColor.Transparent);

 Aurigma.GraphicsMill.Bitmap theBitmap = new Aurigma.GraphicsMill.Bitmap();
                theBitmap.ColorManagement.ColorManagementEnabled = true;
                theBitmap.Load( thePicturePath );
                theBitmap.ColorManagement.RgbColorProfile = theBitmap.ColorProfile;
                theBitmap.ColorManagement.Convert( theTiffImage.PixelFormat );
                theBitmap.Draw(theTiffImage, 10, 10,
                theBitmap.Width, theBitmap.Height,
                Aurigma.GraphicsMill.Transforms.CombineMode.Copy, 1f,
                Aurigma.GraphicsMill.Transforms.InterpolationMode.HighSpeed);

What do i wrong?

Edited by user Wednesday, December 19, 2007 3:49:08 AM(UTC)  | Reason: Not specified

Dmitry  
#4 Posted : Sunday, October 1, 2006 2:47:29 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Guest
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

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

Code:
theBitmap.ColorManagement.RgbColorProfile = theBitmap.ColorProfile.
Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

camelord  
#5 Posted : Sunday, October 1, 2006 9:43:12 PM(UTC)
camelord

Rank: Member

Groups: Guest
Joined: 5/31/2006(UTC)
Posts: 20

Hi Dmitry,

i think we can forget the Code above.

Here is what i want to achiev:

i need a base Image wich has a fix size.

Code:
Aurigma.GraphicsMill.Bitmap theTiffImage = new Aurigma.GraphicsMill.Bitmap();
theTiffImage.Unit = Aurigma.GraphicsMill.Unit.Mm;
theTiffImage.HorizontalResolution = 300;
theTiffImage.VerticalResolution = 300;
theTiffImage.ColorManagement.ColorManagementEnabled = true;
theTiffImage.Create(myTiffImageSize[0], myTiffImageSize[1], Aurigma.GraphicsMill.PixelFormat.Format32bppArgb);
Aurigma.GraphicsMill.Drawing.GdiGraphics g = theTiffImage.GetGdiGraphics();
g.Clear(Aurigma.GraphicsMill.RgbColor.Transparent);

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.

thx

regards

Christian

Edited by user Wednesday, December 19, 2007 3:49:36 AM(UTC)  | Reason: Not specified

Dmitry  
#6 Posted : Monday, October 2, 2006 9:19:33 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Guest
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello,

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:

Code:
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");

Edited by user Wednesday, December 19, 2007 3:50:01 AM(UTC)  | Reason: Not specified

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

camelord  
#7 Posted : Tuesday, October 3, 2006 4:27:16 PM(UTC)
camelord

Rank: Member

Groups: Guest
Joined: 5/31/2006(UTC)
Posts: 20

Hi Dmitry,

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?

regards

Christian

Dmitry  
#8 Posted : Tuesday, October 3, 2006 8:26:16 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Guest
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello Christian,

You should convert the both images to pixel format of background using background color profile as destination one.

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

camelord  
#9 Posted : Tuesday, October 3, 2006 11:55:18 PM(UTC)
camelord

Rank: Member

Groups: Guest
Joined: 5/31/2006(UTC)
Posts: 20

Hi Dmitry,

i guess it works now.

I was a little confused, because of the different Color Profiles..

I set the Color Profile of the base Image to

Code:
Aurigma.GraphicsMill.ColorProfile.FromSrgb();

The Colors really look like the ones in Photoshop..

Thx!

regards

Christian

Edited by user Wednesday, December 19, 2007 3:50:19 AM(UTC)  | Reason: Not specified

Users browsing this topic
Guest (6)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.