Write Extra Channel
View as MarkdownCreates a TIFF image with an extra channel.
Code Snippet
using (var reader = new TiffReader("Copenhagen_Resized.tif"))
using (var writer = new TiffWriter("CopenhagenWithExtraChannel.tif"))
{
// Load bitmap for the extra channel.
// Note: image for extra channel must be grayscale and have the same dimensions and DPI as the source one.
using (var extraBitmap = new Bitmap("Copenhagen_Extra.tif"))
{
// Create extra channel options based on extraBitmap.
var extraChannel = new TiffExtraChannelEntry(extraBitmap, TiffChannelType.Alpha);
writer.ExtraChannels.Add(extraChannel);
Pipeline.Run(reader + writer);
}
}
Input
Copenhagen_Resized.tif
DownloadCopenhagen_Extra.tif
DownloadOutput
CopenhagenWithExtraChannel.tif
Download