Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Multiple layer (PSD) placing images on top of each other

$
0
0
You should call Write on your MagickImageCollection if you want to write all the layers in a PSD file. You should also include an extra image as the first image that is the 'flattened' version of your image. You can change the layer position with the Page property of MagickImage. Below is a simplified example:
using (MagickImageCollection psd = new MagickImageCollection())
{
  // Add all the layers to your image.foreach(MagickImage image in CreateLayers())
  {
    // Set the position of the layer.
    image.Page = new MagickGeometry(6, 6, image.Width, image.Height);

    psd.Add(image);
  }

  // Create flattened image of all the layers and insert this as the first image.
  MagickImage flattened = psd.Flatten();
  psd.Insert(0, flattened);

  // Write the output image.
  psd.Write("output.psd");
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles