- bits, bob_width, bob_height,
- 8, 0);
- fp->image->byte_order = LSBFirst;
- fp->image->bitmap_bit_order = LSBFirst;
+ 0, im->width, im->height, 8, 0);
+ fp->image->data = malloc (fp->image->bytes_per_line * fp->image->height);
+
+ /* Convert deep image to 1 bit */
+ for (y = 0; y < im->height; y++)
+ {
+ for (x = 0; x < im->width; x++)
+ {
+ unsigned long p = XGetPixel (im, x, im->height-y-1);
+ if (! (p & 0xFF000000)) p = ~0; /* alpha -> white */
+ p = (p >> 16) & 0xFF; /* red */
+ XPutPixel (fp->image, x, y, p > 0x7F ? 0 : 1);
+ }
+ }
+ XDestroyImage (im);