It is important to know the polarity or value of the foreground (1 for binary, 255 for grey scale) and background (0 for binary, 0 for grey scale) or if it is inverted; as this inverts the operator. Binary images are typically produced by thesholding a grey scale image.