How do I change an embedded image colouring scheme from RGB to black and white or monochrome?

Q: I have one query regarding image manipulation in PDFNet. Is it
possible to change the an embedded image colouring scheme from RGB to
black and white (monochrome)?
------
A: This functionality can be implemented by replacing the old image
with a new image. Using PDFNet SDK (and specifically
pdfdoc.GetSDFDoc().Swap()) you can replace an existing PDF image (or
any other indirect object such as font or ICC color space) with
another instance of that object.

The following is a pseudocode used to replace an RGB image with a
monochrome image (under .NET):

System.Drawing.Bitmap bmp1 = pdfimage1.GetBitmap();

// convert bmp1 to monochrome ....
// for example, please see http://www.bobpowell.net/onebit.htm
// ... or open another bitmap.
System.Drawing.Bitmap bmp2 = ... ;

// Create a PDF image out of bmp2.
pdftron.PDF.Image pdfimage2 = pdftron.PDF.Image.Create(doc, bmp);

// Swap the old image with a new one...
Pdfdoc.GetSDFDoc().Swap(pdfimage1.GetObjNum(), pdfimage2.GetObjNum());

...