ImGearPage igPage;
// Load an image into a ImGearPage object.
using (FileStream localFile = new FileStream(localFilePath, FileMode.Open))
igPage = ImGearFileFormats.LoadPage(localFile, 0);
// Build and apply palette if image is indexed.
if (igPage.DIB.ColorSpace.Value == ImGearColorSpaceIDs.I)
{
// Create a simple palette of red colors
ImGearRGBQuad[] igRGBQuad = new ImGearRGBQuad[256];
for (int i = 0; i < 256; ++i)
igRGBQuad[i].Red = (byte)i;
// Assign the new Palette
igPage.DIB.Palette = igRGBQuad;
}