Layers inside LayerGroup is ignoring the visibility of the parent LayerGroup.
e.g. Layers is still visible even when container group is invisible.
Result can be observed from output image or the returned image from ToBitmap().
From sample code below. Notice that the apple is still visible even the group holding the apple layers are invisible.
Sample PSD:
input.zip (62.9 KB)
Sample Code:
class TurnOffGroupTest
{
public static void Run()
{
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_PSD();
// make changes in layer names and save it
using (var image = (PsdImage)Image.Load(dataDir +"/input.psd"))
{
for (int i = 0; i < image.Layers.Length; i++)
{
var layer = image.Layers[i];
// Turn off everything inside a group
if (layer is FileFormats.Psd.Layers.LayerGroup)
{
layer.IsVisible = false;
}
}
image.Save(dataDir +" /output.psd");
}
//ExEnd:ExtractLayerName
}
}
P.S. just plug the code and sample PSD to your provided sample project to test.