// Separate image into separate images for each channel.
ImGearChannelRef[] igChannelRef = ImGearRasterProcessing.SeparateChannels(igRasterPage);
// Remove the alpha channel from an RGBA image.
ImGearRasterProcessing.RemoveChannel(igRasterPage, 3);
// Save the page out without the alpha channel.
using (FileStream localFile = new FileStream("withoutalpha.jpg", FileMode.Create))
{
ImGearFileFormats.SavePage(igRasterPage,localFile, 0, ImGearSavingModes.OVERWRITE, ImGearSavingFormats.JPG);
}
//Set the colorspace to RGBA again.
ImGearRasterProcessing.ConvertColorSpace(
igRasterPage, new ImGearColorSpace(ImGearColorSpaceIDs.RGBA));
// Add the alpha channel back to the image.
ImGearRasterProcessing.InsertChannel(igRasterPage, 3, igChannelRef[3]);
// Remove the alpha channel added by the colorspace conversion.
ImGearRasterProcessing.RemoveChannel(igRasterPage, 4);