Rank: Newbie
Groups: Guest
Joined: 5/10/2017(UTC) Posts: 4
|
Hi, I tried to convert PSD file to PNG directly it works fine, but i try to iterate through frame and convert to png image is not proper is merged. some of the pattern in PSD file is missing after PNG conversion Working code: Code:using (var psdReader = new PsdReader(@"C:\temp\photooverlay_5.psd"))
var bitmap = psdReader.MergedImageFrame.GetBitmap();
bitmap.Save(@"C:\temp\photooverlay_01.png");
photooverlay_5.zip (2,143kb) downloaded 5 time(s).Non-working code: ********************** Code:using (var psdReader = new PsdReader(@"C:\temp\photooverlay_5.psd"))
using (var bitmap = new Bitmap(psdReader.Width, psdReader.Height, psdReader.PixelFormat)
{
DpiX = psdReader.DpiX,
DpiY = psdReader.DpiY
})
{
//read layers and save raster layers in PNG files
for (int i = 0; i < psdReader.Frames.Count; i++)
{
using (var frame = psdReader.Frames[i])
{
using (var bitmap1 = frame.GetBitmap())
{
bitmap1.Save(@"C:\temp\frame_" + frame.Name + ".png");
var rect = new System.Drawing.Rectangle()
{
X = frame.X,
Y = frame.Y,
Width = frame.Width,
Height = frame.Height
};
bitmap.Draw(bitmap1, rect, Aurigma.GraphicsMill.Transforms.CombineMode.Alpha, 1.0f,
Aurigma.GraphicsMill.Transforms.ResizeInterpolationMode.High);
}
}
}
bitmap.Save(@"C:\temp\photooverlay_03.png");
}
Edited by user Wednesday, May 10, 2017 9:24:05 AM(UTC)
| Reason: code formatting
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Could you post a sample PSD file? It should help to understand the problem better. |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 5/10/2017(UTC) Posts: 4
|
I have attached *.psd file. Please check the post
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Graphics Mill supports a limited subset of PSD blending options. For example, we don't support the Pattern Overlay style. That's why we recommend to rasterize a layer style to get a correct result.
|
Best regards, Fedor Skvortsov
|
|
|
|
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.