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

Notification

Icon
Error

Options
Go to last post Go to first unread
vandna  
#1 Posted : Friday, January 05, 2007 1:24:27 PM(UTC)
vandna

Rank: Member

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

Hi,
I want to apply shadow to a CMYK image and also, want to give a blending option - Multiply (as in Photoshop). How can I acheive it through Aurigma?
Thanks
vandna  
#2 Posted : Sunday, January 07, 2007 7:25:23 PM(UTC)
vandna

Rank: Member

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

Please let me know if it is acheivable using Aurigma?

Dmitry  
#3 Posted : Sunday, January 07, 2007 11:11:32 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,

The both of features are available with Graphics Mill for .NET. Here are the code snippets which illustrates how to perform these actions:
  • Draw one image on another using "multiply" combine mode:
    Code:
    // CMYK image
    Aurigma.GraphicsMill.Bitmap bitmap1 = new Aurigma.GraphicsMill.Bitmap(@"d:/temp/testimages/sourse_image(CMYK).jpg");
    // RGB image
    Aurigma.GraphicsMill.Bitmap bitmap2 = new Aurigma.GraphicsMill.Bitmap(@"d:/temp/wizard.jpg");
    	
    // Images should have the same pixel format, so convert bitmap2 to CMYK.
    bitmap2.ColorManagement.ConvertToContinuous(Aurigma.GraphicsMill.ColorSpace.Cmyk, false, false);
    	
    // Draw bitmap 2 onto bitmap1 using multiply combine mode.
    bitmap2.Draw(bitmap1, 0, 0, 100, 100, Aurigma.GraphicsMill.Transforms.CombineMode.Multiply, 1.0f, Aurigma.GraphicsMill.Transforms.InterpolationMode.MediumQuality);
    	
    // Save the result.
    bitmap1.Save(@"d:/temp/multiply.jpg");
  • Draw black shadow on CMYK image:
    Code:
    Aurigma.GraphicsMill.Bitmap srcBitmap = new Aurigma.GraphicsMill.Bitmap(@"d:/temp/testimages/sourse_image(CMYK).jpg");
    srcBitmap.Transforms.Shadow(Aurigma.GraphicsMill.CmykColor.FromCmyk(0, 0, 0, 255), 50, 50);
    srcBitmap.Save(@"d:/temp/shadow.tif");
  • Edited by user Tuesday, December 18, 2007 5:35:10 PM(UTC)  | Reason: Not specified

    Sincerely yours,
    Dmitry Sevostyanov

    UserPostedImage Follow Aurigma on Twitter!
    vandna  
    #4 Posted : Monday, January 08, 2007 1:40:23 AM(UTC)
    vandna

    Rank: Member

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

    Hi,
    This is not what I want.Please understand that I want to create a shadow on the image but the shoadow blending option should be multipy (as in Photoshop).Currently, the shadow is in Normal mode.

    Dmitry  
    #5 Posted : Monday, January 08, 2007 7:13:14 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,

    To perform your task you should:
    1. Add shadow to your bitmap,
    2. Draw shadowed bitmap on result one using "multiply" combine mode,
    3. Draw original bitmap on result bitmap with combine mode "alpha".

    Here is code sample which illustrates this approach:
    Code:
    // Source bitmap
    Aurigma.GraphicsMill.Bitmap srcBitmap = new Aurigma.GraphicsMill.Bitmap(@"d:/images/test/transptest.png");
    	
    // Bitmap with shadow
    Aurigma.GraphicsMill.Bitmap shadowBitmap = (Aurigma.GraphicsMill.Bitmap)srcBitmap.Clone();
    shadowBitmap.Transforms.Shadow(Aurigma.GraphicsMill.RgbColor.Green, 50, 50, 5, false);
    	
    // Result bitmap
    Aurigma.GraphicsMill.Bitmap resultBitmap = new Aurigma.GraphicsMill.Bitmap(Aurigma.GraphicsMill.RgbColor.White,  
        shadowBitmap.Width, shadowBitmap.Height, shadowBitmap.PixelFormat);
    	
    // Draw bitmap with shadows onto result bitmap using combine mode "multiply"
    shadowBitmap.Draw(resultBitmap, 0, 0, shadowBitmap.Width, shadowBitmap.Height,  
        Aurigma.GraphicsMill.Transforms.CombineMode.Multiply, 1.0f, 
        Aurigma.GraphicsMill.Transforms.InterpolationMode.LowQuality);
    	
    // Draw source bitmap onto result one with combine mode "alpha"
    srcBitmap.Draw(resultBitmap, 0, 0, srcBitmap.Width, srcBitmap.Height, 
        Aurigma.GraphicsMill.Transforms.CombineMode.Alpha, 1.0f, 
        Aurigma.GraphicsMill.Transforms.InterpolationMode.LowQuality);
    
    resultBitmap.Save(@"d:/shadow.png");

    Edited by user Tuesday, December 18, 2007 5:35:24 PM(UTC)  | Reason: Not specified

    Sincerely yours,
    Dmitry Sevostyanov

    UserPostedImage Follow Aurigma on Twitter!
    vandna  
    #6 Posted : Tuesday, January 09, 2007 1:05:03 PM(UTC)
    vandna

    Rank: Member

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

    Hi,
    Thanks for your prompt reply. This is wonderful.
    Aurigma rocks and so do you.
    vandna  
    #7 Posted : Wednesday, January 10, 2007 4:34:19 PM(UTC)
    vandna

    Rank: Member

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

    Hi,
    I was able to acheive the desired effect in case of png. But how to acheive it when the background is in CMYK format and I want to draw a CMYK image over it with the shadow blended in Multiply mode. Please provide with a code sample to acheive the same.
    Dmitry  
    #8 Posted : Thursday, January 11, 2007 2:32:57 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 "multiply" combine mode is not available for CMYK images. If you really need for this feature, contact us on sales@aurigma.com.

    Edited by user Thursday, May 22, 2008 9:24:59 PM(UTC)  | Reason: Not specified

    Sincerely yours,
    Dmitry Sevostyanov

    UserPostedImage Follow Aurigma on Twitter!
    Users browsing this topic
    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.