}
else
{
- Quantum
- polarity;
-
register unsigned char
bit,
byte;
/*
Convert PseudoClass image to a PCX monochrome image.
*/
- polarity=(Quantum) (GetPixelInfoIntensity(
- &image->colormap[0]) < (QuantumRange/2) ? 1 : 0);
- if (image->colors == 2)
- polarity=(Quantum) (GetPixelInfoIntensity(&image->colormap[0]) <
- GetPixelInfoIntensity(&image->colormap[1]) ? 1 : 0);
for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetVirtualPixels(image,0,y,image->columns,1,exception);
for (x=0; x < (ssize_t) image->columns; x++)
{
byte<<=1;
- if (GetPixelIndex(image,p) == polarity)
+ if (GetPixelLuma(image,p) >= (QuantumRange/2.0))
byte|=0x01;
bit++;
if (bit == 8)