Identify if image inside PDF is Colored or Black and White

Contents
[ ]

A PDF file may contain Text, Image, Graph, Attachment, Annotation, etc elements and if the source PDF file contains images, we can determine image Color space and apply appropriate compression for the image to reduce PDF file size.

The following code snippet shows the steps to Identify if the image inside PDF is Colored or Black & White.