Aurigma Forums
»
Graphics Mill
»
Archive - Graphics Mill
»
HOWTO: Convert from PSD to PNG Keeping Transparent Background
Rank: Member
Groups: Member
Joined: 8/22/2006(UTC) Posts: 7
Thanks: 1 times
|
I have a few hundred psd files with white backgrounds that I need to convert to png with a transparent background. Is there any example of how to do that using a win form? I don't need to show it to the user, just convert and save with the same filename and .png extension. Thanks, Eddie Edited by moderator Monday, May 28, 2012 8:24:42 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello Eddie, Thanks for contacting us. Please use this code to convert PSD files to PNG: Code:
Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap();
bitmap.ColorManagement.ColorManagementEngine = Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms;
PsdReader PSD = new PsdReader(@"C:\temp\test2.psd");
IFrame PSDFrame = PSD.LoadFrame(0);
PSDFrame.GetBitmap(bitmap);
bitmap.Channels.Transparentize(Aurigma.GraphicsMill.Color.FromRgb(255, 255, 255), 0);
bitmap.Save(@"C:\temp\test2.png");
If you have any additional questions please feel free to let me know. |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Rank: Member
Groups: Member
Joined: 8/22/2006(UTC) Posts: 7
Thanks: 1 times
|
Hi Dmitry, It works great. Below is the code you gave converted to VB in case anyone else needs it. Thanks! Eddie
Dim bitmap As New Aurigma.GraphicsMill.Bitmap bitmap.ColorManagement.ColorManagementEngine=Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms Dim PSD As New Aurigma.GraphicsMill.Codecs.PsdReader("D:\test2.psd") Dim PSDFrame As Aurigma.GraphicsMill.Codecs.IFrame PSDFrame = PSD.LoadFrame(0) PSDFrame.GetBitmap(bitmap) bitmap.Channels.Transparentize(Aurigma.GraphicsMill.Color.FromRgb(255, 255, 255), 0) bitmap.Save("D:\test2.png")
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hi Eddie,
Thanks for your comment, and VB code. |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Aurigma Forums
»
Graphics Mill
»
Archive - Graphics Mill
»
HOWTO: Convert from PSD to PNG Keeping Transparent Background
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.