I found some bugs when exporting layers as PNG images:
- GradientOverlay rendering effect
The GradientOverlay rendering effect is poor. If you zoom in on the image, you will find many burrs on the stroke edges, which are the FillColor of the text; Aspose exports an image with the name “8_aspose. png”. Please compare the image exported from Photoshop with “8_ps. png”;
- FillOpacity is confused with Opacity
FillOpacity is confused with Opacity. The effective values of FillOpacity are only 0 and 1, and when the value of FillOpacity is in the range of 1 to 100, it is equivalent to 100. The exported images from Layers [3] become completely transparent; Aspose exports an image with the name “88_aspose. png”. Please compare it with the Photoshop exported image “88_ps. png”.
The code is here:
static void PsdTest3()
{
PsdLoadOptions loadOptions = new PsdLoadOptions() { LoadEffectsResource = true, AllowWarpRepaint = true };
var pngSaveOptions = new PngOptions()
{
ColorType = Aspose.PSD.FileFormats.Png.PngColorType.TruecolorWithAlpha
};
using (PsdImage psd = (PsdImage)Image.Load(@"8.psd", loadOptions))
{
try
{
// Faild:save layer[1] without rectangle failed.
psd.Layers[1].Save("8_aspose.png", pngSaveOptions);
Console.WriteLine($"save layer[1] without rectangle.");
}
catch (Exception err)
{
Console.Error.WriteLine(err);
}
try
{
// Sucess:save layer[1] with rectangle success.
//The GradientOverlay rendering effect is poor.
//If you zoom in on the image, you will find many burrs on the stroke edges,
//which are the FillColor of the text;
psd.Layers[1].Save("8_aspose.png", pngSaveOptions, psd.Bounds);
Console.WriteLine($"save layer[1] with rectangle.");
}
catch (Exception err)
{
Console.Error.WriteLine(err);
}
try
{
//FillOpacity is confused with Opacity. The effective values of FillOpacity are only 0 and 1,
//and when the value of FillOpacity is in the range of 1 to 100, it is equivalent to 100.
//The exported images from Layers [3] become completely transparent
psd.Layers[3].Save("88_aspose.png", pngSaveOptions);
Console.WriteLine($"save layer[3] without rectangle.");
}
catch (Exception err)
{
Console.Error.WriteLine(err);
}
}
}
Debug.zip (74.3 KB)
Additionally, saving layer [1] without rectangle will throw an exception;
Aspose.PSD.CoreExceptions.ImageSaveException: Image saving failed. ---> Aspose.PSD.CoreExceptions.ImageSaveException: Image export failed. ---> System.ArgumentException: The rectangle has no common processing area. Cannot proceed.
at Aspose.PSD.Image.GetFittingRectangle(Rectangle rectangle, Int32 width, Int32 height)
at Aspose.PSD.Image.GetFittingRectangle(Rectangle rectangle, Int32[] pixels, Int32 width, Int32 height)
at .(Rectangle , Int32[])
at ???.SaveArgb32Pixels(Rectangle , Int32[])
at ???.SavePixelsInternal(Rectangle , Int32[])
The lib version is Aspose. PSD for. NET 25.10