* Creates a bilevel image from any grayscale (or RGB) image
* that has been checked to be bilevel.
*/
private void createBilevelFromGrayOrRgb(IntegerImage in)
{
MemoryBilevelImage out = new MemoryBilevelImage(in.getWidth(), in.getHeight());
out.clear(BilevelImage.BLACK);
for (int y = 0; y < in.getHeight(); y++)
{
for (int x = 0; x < in.getWidth(); x++)
{
if (in.getSample(0, x, y) != 0)
{
out.putWhite(x, y);
}
}
setProgress(y, in.getHeight());
}
outputImage = out;