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

New Post: How to combine multiple images into one

$
0
0
I am not sure if the example below is the most efficient way but it produces the result you want.
using (MagickImageCollection images = new MagickImageCollection("snow.gif"))
{
  using (MagickImage background = new MagickImage("background.jpg"))
  {
    // You only need this when your background image is not the same size.
    background.Resize(images[0].Width, images[0].Height); 

    foreach (MagickImage image in images)
    {
      image.Composite(background, Gravity.Center, CompositeOperator.DstOver);
    }
  }

  images.Optimize();
  images.Write("snow-background.gif");
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles