Browse our Products
Aspose.PSD for .NET 18.10 - Release Notes
Key | Summary | Category |
---|---|---|
PSDNET-14 | Add support of blend modes besides Normal | Feature |
PSDNET-69 | Add support of Color Overlay effect | Feature |
PSDNET-70 | Add support of Drop Shadow effect | Feature |
PSDNET-71 | Rendering for export of Color Overlay effect | Feature |
PSDNET-72 | Rendering for export of Drop Shadow effect | Feature |
PSDNET-74 | Support of the adding of Layer Effects at run-time | Feature |
PSDNET-73 | Optimizing of loading performance of resources which contain osTypeStructures | Bug |
PSDNET-79 | Refactoring and memory leaks fixes in LayerAndMaskInfo | Enhancement |
Usage examples:
PSDNET-14 Add support of blend modes besides Normal
var files = new string[]
{
"Normal",
"Dissolve",
"Darken",
"Multiply",
"ColorBurn",
"LinearBurn",
"DarkerColor",
"Lighten",
"Screen",
"ColorDodge",
"LinearDodgeAdd",
"LightenColor",
"Overlay",
"SoftLight",
"HardLight",
"VividLight",
"LinearLight",
"PinLight",
"HardMix",
"Difference",
"Exclusion",
"Subtract",
"Divide",
"Hue",
"Saturation",
"Color",
"Luminosity",
};
foreach (var fileName in files)
{
using (var im = LoadFile(fileName + ".psd"))
{
// Export to PNG
var saveOptions = new PngOptions();
saveOptions.ColorType = PngColorType.TruecolorWithAlpha;
var pngExportPath100 = "BlendMode" + fileName + "_Test100.png";
im.Save(pngExportPath100, saveOptions);
// Set opacity 50%
im.Layers[1].Opacity = 127;
var pngExportPath50 = "BlendMode" + fileName + "_Test50.png";
im.Save(pngExportPath50, saveOptions);
}
}
PSDNET-69 Add support of Color Overlay effect
// ColorOverlay effect editing
string sourceFileName = "ColorOverlay.psd";
string psdPathAfterChange = "ColorOverlayChanged.psd";
using (var im = LoadFile(sourceFileName))
{
var colorOverlay = (ColorOverlay)(im.Layers[1].BlendingOptions.Effects[0]);
Assert.AreEqual(Color.Red, colorOverlay.Color);
Assert.AreEqual(153, colorOverlay.Opacity);
colorOverlay.Color = Color.Green;
colorOverlay.Opacity = 128;
im.Save(psdPathAfterChange);
}
PSDNET-70 Add support of Drop Shadow effect
// DropShadow effect editing
string sourceFileName = "Shadow.psd";
string psdPathAfterChange = "ShadowChanged.psd";
using (var im = LoadFile(sourceFileName))
{
var shadowEffect = (DropShadowEffect)(im.Layers[1].BlendingOptions.Effects[0]);
Assert.AreEqual(Color.Black, shadowEffect.Color);
Assert.AreEqual(255, shadowEffect.Opacity);
Assert.AreEqual(3, shadowEffect.Distance);
Assert.AreEqual(7, shadowEffect.Size);
Assert.AreEqual(true, shadowEffect.UseGlobalLight);
Assert.AreEqual(90, shadowEffect.Angle);
Assert.AreEqual(0, shadowEffect.Spread);
Assert.AreEqual(0, shadowEffect.Noise);
shadowEffect.Color = Color.Green;
shadowEffect.Opacity = 128;
shadowEffect.Distance = 11;
shadowEffect.UseGlobalLight = false;
shadowEffect.Size = 9;
shadowEffect.Angle = 45;
shadowEffect.Spread = 3;
shadowEffect.Noise = 50;
im.Save(psdPathAfterChange);
}
PSDNET-71 Rendering for export of Color Overlay effect
// ColorOverlay effect editing
string sourceFileName = "ColorOverlay.psd";
string pngExportPath = "ColorOverlay.png";
using (var im = LoadFile(sourceFileName))
{
var colorOverlay = (ColorOverlayEffect)(im.Layers[1].BlendingOptions.Effects[0]);
Assert.AreEqual(Color.Red, colorOverlay.Color);
Assert.AreEqual(153, colorOverlay.Opacity);
// Save PNG
var saveOptions = new PngOptions();
saveOptions.ColorType = PngColorType.TruecolorWithAlpha;
im.Save(pngExportPath, saveOptions);
}
PSDNET-72 Rendering for export of Drop Shadow effect
// DropShadow export
string sourceFileName = "Shadow.psd";
string pngExportPath = "Shadow.png";
using (var im = LoadFile(sourceFileName))
{
var shadowEffect = (DropShadowEffect)(im.Layers[1].BlendingOptions.Effects[0]);
Assert.AreEqual(Color.Black, shadowEffect.Color);
Assert.AreEqual(255, shadowEffect.Opacity);
Assert.AreEqual(3, shadowEffect.Distance);
Assert.AreEqual(7, shadowEffect.Size);
Assert.AreEqual(true, shadowEffect.UseGlobalLight);
Assert.AreEqual(90, shadowEffect.Angle);
Assert.AreEqual(0, shadowEffect.Spread);
Assert.AreEqual(0, shadowEffect.Noise);
// Save PNG
var saveOptions = new PngOptions();
saveOptions.ColorType = PngColorType.TruecolorWithAlpha;
im.Save(pngExportPath, saveOptions);
}
PSDNET-74 Support of the adding of Layer Effects at runtime
// Add color overlay layer effect at runtime
string sourceFileName = "ThreeRegularLayersWithLayerEffect.psd";
string psdExportPath = "ThreeRegularLayersWithLayerEffectChanged.psd";
string pngExportPath = "ThreeRegularLayersWithLayerEffectChanged.psd";
var loadOptions = new PsdLoadOptions()
{
LoadEffectsResource = true
};
var testFolder = string.Empty;
var im = (PsdImage)Image.Load(testPath, loadOptions)
using (im)
{
var effect = im.Layers[1].BlendingOptions.AddColorOverlay();
effect.Opacity = 128;
effect.Color = Color.Green;
effect.BlendMode = BlendMode.Normal;
var effect = im.Layers[1].BlendingOptions.AddDropShadow();
effect.Color = Color.Red;
effect.Opacity = 128;
effect.BlendMode = BlendMode.Normal;
// Save PSD
im.Save(psdExportPath);
// Save PNG
var saveOptions = new PngOptions();
im.Save(pngExportPath, saveOptions);
}