anchor.diff:  ;; Load the image processing library
   (load "quicklisp/setup.lisp")
   (ql:quickload "opticl")
  +(ql:quickload "jsown")
   
   ;; Define packages to use
   (use-package 'opticl)
  +(use-package 'jsown)
   
   (defparameter *edge-kernel* #2A((0 1 0) (1 -4 1) (0 1 0)))
   (defparameter *dilate* #2A((0 1 0) (1 -4 1) (0 1 0)))
  
positive.code:                            (pixel source i j)
                             (declare (type (unsigned-byte 8) r1 g1 b1))
                             (setf grey (floor (/ (+ r g b) 3)))
                             (if (< grey 120) ;; 80 used for now, needs to be something later
                                (setf (pixel source i j)
                                   (values r1 g1 b1))
                                (setf (pixel source i j)
                                   (values r g b))))))))))))
  
  ;; unused
  (defun colourise-components (img)
  	(setf comp (label-components img))
  	(setf c 0)
  	(setf l 0)
  	(setf col (list (random 255) (random 255) (random 255)))
  	(typecase img
  		(8-bit-rgb-image
  			(locally (declare (type 8-bit-rgb-image img))
  				(with-image-bounds (height width) img
  					(loop for i below height do
  						(loop for j below width do
  							(setf c (nth i (nth j comp)))
  							(multiple-value-bind (r g b)
  								(pixel img i j)
  								(declare (type (unsigned-byte 8) r g b))
  								(if (and (not (eq l ))))
  								(setf (pixel img i j)
  									(values (first col) (second col) (third col))))
  							(setf l c)
  							(if (and (not (eq c l)) (not (eq c 0)))
  								(setf col (list (random 255) (random 255) (random 255)))))))))))
  
  ;; Sums an array
  ; https://faculty.washington.edu/ikalet/courses/lisp/code/arrays.cl
  
negative.code: (defun sum-l (l)
     (apply '+ l))
  
  (defun sum-r (L)
     (if L
        (+ (car L) (sum-r (cdr L)))
        0))
  
  (defun avg-l (l)
     (float (/ (sum-r l) (length l))))
  
  (defun max-l (l)
     (apply 'max l))
  
  (defun min-l (l)
     (apply 'min l))
  
  ;; MODE
  ;; Rosner 14
  ;; returns two values: a list of the modes and the number of times they
  ;; occur.   Rob St. Amant <stamant@csc.ncsu.edu> suggested using a hash
  ;; table instead of an alist, and Lee Ayres <ayres@acm.org> noted that
  ;; my revision failed to handle multiple modes properly.
  
  (defun mode-l (sequence)
     (test-variables (sequence :numseq))
     (let ((count-table (make-hash-table :test #'eql))
        (modes nil)
        (mode-count 0))
        (map nil (lambda (elt) (incf (gethash elt count-table 0))) sequence)
        (maphash (lambda (key value)
           (cond ((> value mode-count)
              (setf modes (list key)
                 mode-count value))
              ((= value mode-count)
                 (push key modes))))
        count-table)
        (values modes mode-count)))
  
  (defun label (image)
  	(setf img (load-painting image))
  