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

Notification

Icon
Error

Options
Go to last post Go to first unread
Nikolai DK  
#1 Posted : Thursday, November 25, 2010 2:48:03 AM(UTC)
Nikolai DK

Rank: Newbie

Groups: Member
Joined: 11/25/2010(UTC)
Posts: 6

Thanks: 1 times
Below is an example of a picture I've run through Graphics Mill

UserPostedImage

As you can see the picture on the left is not quite as nicely as the right picture.

Can I do anything about it?

I have used the following code to create the image

Code:

Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap();

GlobalSettings.MultiProcessorSupport = true;

bitmap.ColorManagement.ColorManagementEngine = Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms;

PsdReader PSD = new PsdReader(@"C:\test.psd");
IFrame PSDFrame = PSD.LoadFrame(0);
PSDFrame.GetBitmap(bitmap);

bitmap.Transforms.Resize(144, 100, Aurigma.GraphicsMill.Transforms.ResizeMode.Shrink, Aurigma.GraphicsMill.Transforms.InterpolationMode.Anisotropic9);

bitmap.HorizontalResolution = 72;
bitmap.VerticalResolution = 72;

bitmap.ColorManagement.RgbColorProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb();

bitmap.ColorManagement.ConvertToContinuous(Aurigma.GraphicsMill.ColorSpace.Rgb, bitmap.HasAlpha, bitmap.IsExtended);

bitmap.Save(@"C:\test.bmp");
Dmitry.Obukhov  
#2 Posted : Thursday, November 25, 2010 9:36:53 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

Could you please provide me with a sample of PSD file? I need to test it.

Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

Nikolai DK  
#3 Posted : Friday, November 26, 2010 3:05:54 AM(UTC)
Nikolai DK

Rank: Newbie

Groups: Member
Joined: 11/25/2010(UTC)
Posts: 6

Thanks: 1 times
Of course you can download the file on the following link

nikostine.dk/materiale/udveksling/tl0003_prod_1.psd

Dmitry.Obukhov  
#4 Posted : Friday, November 26, 2010 5:38:13 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Nikolai,

Thanks for your image.

You use image with transparent background. To save it with antialiasing, you will need to use PNG format, which support transparency. In this case, you can use your code you listed above.

In case you need BMP format only, which does not support transparency, you should place your image on the white bitmap.

We re-made your code snippet a bit. It allows converting PSD to BMP with antialiasing.

Here is the code:

Code:
Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap();

GlobalSettings.MultiProcessorSupport = true;

bitmap.ColorManagement.ColorManagementEngine = Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms;

PsdReader PSD = new PsdReader(@"C:\test.psd");
IFrame PSDFrame = PSD.LoadFrame(0);
PSDFrame.GetBitmap(bitmap);

bitmap.Transforms.Resize(144, 100, Aurigma.GraphicsMill.Transforms.ResizeMode.Shrink, Aurigma.GraphicsMill.Transforms.InterpolationMode.Lanczos3Filter);

bitmap.HorizontalResolution = 72;
bitmap.VerticalResolution = 72;

bitmap.ColorManagement.RgbColorProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb();
bitmap.ColorManagement.ConvertToContinuous(Aurigma.GraphicsMill.ColorSpace.Rgb, bitmap.HasAlpha, false);

Aurigma.GraphicsMill.Bitmap blendedBmp = new Aurigma.GraphicsMill.Bitmap(Aurigma.GraphicsMill.RgbColor.White, bitmap.Width, bitmap.Height, PixelFormat.Format24bppRgb);
bitmap.Draw(blendedBmp, 0, 0, Aurigma.GraphicsMill.Transforms.CombineMode.Alpha);
            
blendedBmp.Save(@"C:\test.bmp");

You will find test.bmp file we got using this script.

If you have any additional questions or problems, please feel free to let me know.

Edited by user Friday, November 26, 2010 5:40:38 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov attached the following image(s):
test.bmp
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

thanks 1 user thanked Dmitry.Obukhov for this useful post.
Nikolai DK on 11/29/2010(UTC)
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.