Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
camelord  
#1 Posted : Wednesday, May 31, 2006 5:22:27 PM(UTC)
camelord

Rank: Member

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

Hi,

Is it possible to do the this:

I have 2 CMYK (32bit) Tiff Images and a text.

I want to melt these 2 Image (lets say A.tif and B.tif) to one new CMYK Tiff Image (C.tif).

The Images A.tif and B.tif have to have the same cmyk values like they had before melting them to the new Image C.tif.

Additionally i want to draw a text on Image C.tif. This text has to have given cmyk color.

So if i get the CMYK Values: 10,40,10,5 the drawn text has to have this Color on Image C.tif

Is it possible to do this with GraphicMill 3.5 for .NET?

Regards

Christian

Dmitry  
#2 Posted : Thursday, June 1, 2006 8:55:37 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

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

You can easily perform your task using Graphics Mill for .NET. Unfortunately Graphics Mill for .NET doesn't support drawing on CMYK pixel formats. So we have to draw text onto RGB pixel format and then convert it to CMYK. Also we should make all image with text as transparent with the exception of text pixels.

Here is small code sample which blends two CMYK images with text.

Code:
// Alpha channel for text.
Aurigma.GraphicsMill.Bitmap alpha = new Aurigma.GraphicsMill.Bitmap(Aurigma.GraphicsMill.RgbColor.Black, 300, 100, Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);

// Image for text rendering.
Aurigma.GraphicsMill.Bitmap bmp1 = new Aurigma.GraphicsMill.Bitmap(300, 100, Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);

// Two source CMYK images.
Aurigma.GraphicsMill.Bitmap bmp2 = new Aurigma.GraphicsMill.Bitmap(@"d:/images/test/cmyk1.jpg");
Aurigma.GraphicsMill.Bitmap bmp3 = new Aurigma.GraphicsMill.Bitmap(@"d:/images/test/cmyk2.jpg");

// Font and graphics instances.
Aurigma.GraphicsMill.Drawing.GdiGraphics graphics = null;
Aurigma.GraphicsMill.Drawing.Font font = new Aurigma.GraphicsMill.Drawing.Font("Times New Roman", 20);

// Draw text on image.
graphics = bmp1.GetGdiGraphics();
try
{
	graphics.DrawString("Aurigma Graphics Mill for .NET", font, new Aurigma.GraphicsMill.Drawing.SolidBrush(Aurigma.GraphicsMill.RgbColor.Blue), 10, 10);
}
finally
{
	graphics.Dispose();
}

// Burn text on alpha.
graphics = alpha.GetGdiGraphics();
try
{
	graphics.DrawString("Aurigma Graphics Mill for .NET", font, new Aurigma.GraphicsMill.Drawing.SolidBrush(Aurigma.GraphicsMill.RgbColor.White), 10, 10);
}
finally
{
	graphics.Dispose();
}

font.Dispose();

// Add alpha channel to image with text.
alpha.ColorManagement.Convert(Aurigma.GraphicsMill.PixelFormat.Format8bppGrayScale);
bmp1.Channels.AddAlpha(0.0f);
bmp1.Channels[bmp1.Channels.AlphaChannelIndex] = alpha;

// Convert image with text to Acmyk40.
bmp1.ColorManagement.ConvertToContinuous(Aurigma.GraphicsMill.ColorSpace.Cmyk, true, false);

// Combine two source images and image with text.
Aurigma.GraphicsMill.Transforms.Combiner combiner = new Aurigma.GraphicsMill.Transforms.Combiner();
combiner.InterpolationMode = Aurigma.GraphicsMill.Transforms.InterpolationMode.MediumQuality;
combiner.CombineMode = Aurigma.GraphicsMill.Transforms.CombineMode.Alpha;
try
{
	combiner.DestinationRectangle = new System.Drawing.RectangleF(100, 100, 200, 200);
	combiner.SourceBitmap = bmp2;
	combiner.ApplyTransform(bmp3);

	combiner.DestinationRectangle = System.Drawing.RectangleF.Empty;
	combiner.SourceBitmap = bmp1;
	combiner.ApplyTransform(bmp3);
}
finally
{
	combiner.Dispose();
}

// Save the result into file.
bmp3.Save(@"c:/1.tiff");

Edited by user Tuesday, December 18, 2007 7:20:40 PM(UTC)  | Reason: Not specified

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

camelord  
#3 Posted : Sunday, June 11, 2006 8:32:16 PM(UTC)
camelord

Rank: Member

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

Hi Dmitry,

thx for the response.

How about drawing a text in a given CMYK Color? Is this possible too?

e.g. i get a CMYK Color: C:8 M:67 Y:134 K:230

What do i have to do, if i want the a text on the created tif image, that has exactly the same CMYK Color.

Can you also deal with CMYK in RAW and Percent? Photoshop displays the CMYK Values in Percent. My example above are RAW Values.

A Code Example wold be great.

Regards Christian

Dmitry  
#4 Posted : Tuesday, June 13, 2006 6:43:58 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

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

Unfortunately, Graphics Mill for .NET doesn't support drawing on CMYK pixel formats. The only way to draw text on CMYK images is to use temporary RGB bitmaps. Also at this moment we doesn't support RAW format - support of this format will be available with future versions of our product.

According to color accurracy - you can use color management to minimize negative effect of converting colors from CMYK to RGB and back. To perform that you can use method PixelFormatConverter.ConvertColor. To get more information about color management, please, read Color Conversion.

Edited by user Wednesday, October 29, 2008 12:09:21 PM(UTC)  | Reason: Not specified

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

vandna  
#5 Posted : Friday, January 5, 2007 9:51:07 PM(UTC)
vandna

Rank: Member

Groups: Member
Joined: 1/4/2007(UTC)
Posts: 23

Please give a sample code on how to use PixelFormatConverter.ConvertColor Method (Color, ColorProfile) method.
Dmitry  
#6 Posted : Friday, January 5, 2007 11:01:24 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

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

Here is code sample which converts CMYK color value to RGB one using color management:

Code:
Aurigma.GraphicsMill.CmykColor cmykColor = Aurigma.GraphicsMill.CmykColor.FromCmyk(100, 60, 0, 0);
Aurigma.GraphicsMill.Color rgbColor = null;
Aurigma.GraphicsMill.ColorProfile cmykProfile = new Aurigma.GraphicsMill.ColorProfile(@"d:/temp/testimages/USWebCoatedSWOP.icc");
	
Aurigma.GraphicsMill.Transforms.PixelFormatConverter converter = new Aurigma.GraphicsMill.Transforms.PixelFormatConverter();
converter.DestinationPixelFormat = Aurigma.GraphicsMill.PixelFormat.Format24bppRgb;
converter.RgbColorProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb();
rgbColor = converter.ConvertColor(cmykColor, cmykProfile);
Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
Guest
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.