anchor.diff:                              (loop for i from 0 below num-bytes collect i)))))
   
   (defun generate-indexed-converter-expr (rgb-masks byte-order num-bytes)
  -  `(lambda (image-array converted-data mask-data width height inks)  
  +  `(lambda (image-array converted-data mask-data width height inks)
       (declare (optimize (speed 3)
                          (safety 0)
                          (space 0)
  
positive.code:         (let ((byte-order (xlib:display-byte-order display))
                ;; Hmm. Pixmaps are not windows, so you can't query their visual.
                ;; We'd like to draw to pixmaps as well as windows, so use the
                ;; depth and visual of the screen root, and hope this works.              
                ;(visual-info (xlib:window-visual-info drawable))
                (visual-info (xlib:visual-info display (xlib:screen-root-visual screen)))
                (depth (xlib:screen-root-depth screen))
                (*print-base* 16))
            (fill-pixmap-indexed visual-info depth byte-order array pm pm-gc mask mask-gc w h inks))
            
          (xlib:free-gcontext mask-gc)
          (xlib:free-gcontext pm-gc)
          gc))))
  
negative.code:             (xlib:put-image (pixmap-xmirror pm) pm-gc image
                              :x 0 :y 0
                              :width w :height h)))
  
          ;; Fallback for unsupported visual, plotting pixels
          (progn
            (dotimes (y h)
              (dotimes (x w)
                (let ((ink (elt inks (aref array y x))))
                  (unless (eq ink +transparent-ink+)
                    (draw-point* pm x y :ink ink)))))
            (convert-indexed->mask array mask-data w h inks)))
  
      ;; We can use image upload for the mask in either case.
      (let ((mask-image (xlib:create-image :bits-per-pixel 1 :depth 1
                                           :bit-lsb-first-p t
                                           :byte-lsb-first-p t
                                           :width w :height h
                                           :data mask-data)))
        (xlib:put-image mask mask-gc mask-image
  