diff --git a/coders/miff.c b/coders/miff.c
index fcfa21f..c53d8d8 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -1209,7 +1209,7 @@
packet_size=(size_t) (quantum_info->depth/8);
if (image->storage_class == DirectClass)
packet_size=(size_t) (3*quantum_info->depth/8);
- if (image->type == GrayscaleType)
+ if ((image->type == BilevelType) || (image->type == GrayscaleType))
packet_size=quantum_info->depth/8;
if (image->matte != MagickFalse)
packet_size+=quantum_info->depth/8;
@@ -1243,7 +1243,7 @@
if (image->matte != MagickFalse)
quantum_type=IndexAlphaQuantum;
}
- if (image->type == GrayscaleType)
+ if ((image->type == BilevelType) || (image->type == GrayscaleType))
{
quantum_type=GrayQuantum;
if (image->matte != MagickFalse)