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

New Post: Combining two multi-page TIFF images

$
0
0
Hi I have to do the same thing so here is how I solved this:
public static void stackImages(string firstImagePath, string secondImagePath, string multiPagedImagePath)
{          
   using (MagickImageCollection multiPagedImage = new MagickImageCollection(firstImagePath))
   {
      multiPagedImage.Add(secondImagePath);
      multiPagedImage.write(multiPagedImagePath);
   }
}
You need only one collection which in this case represents one multi paged image.

I think you can also do this:
public static void stackImages(string[] imagePathsToInsert, string multiPagedImagePath)
{
     using (MagickImageCollection multiPagedImage = new MagickImageCollection())
     {
         foreach ( string imagePath in imagePathsToInsert)
         {
            multiPagedImage.Add(imagePath);
         }
     
         multiPagedImage.write(multiPagedImagePath);
    }
}
Make sure that the multiPagedImagePath extension is ".tif" because not every image format supports multi layer/page.

Viewing all articles
Browse latest Browse all 3693

Trending Articles