       (when (<= MIN-ZOOM (:zoom child))
         (propagate-tile tile-map-atom child parent)
         (recur (child-indices child) child)))))
+
+;; CONTRAST
+
+(defn apply-contrast
+  "Setup contrast values by using the min and max of a given tile."
+  [screen-state [tile-index tile-proc]]
+  (update-in screen-state
+             [:channels (:nc tile-index)]
+             merge
+             (intensity-range tile-proc)))
 
 ;; OVERLAY
 

    (load-visible-only screen-state memory-tiles
                       overlay-tiles acquired-images)
    (repaint-on-change panel [screen-state memory-tiles overlay-tiles])
    [panel screen-state]))

(defn set-position! [screen-state-atom position-map]

        [slide-explorer.paint :only (enable-anti-aliasing repaint
                                     draw-image repaint-on-change)]
        [slide-explorer.tiles :only (center-tile floor-int)]
        [slide-explorer.image :only (crop insert-half-tile overlay intensity-range)]
        [slide-explorer.user-controls :only (make-view-controllable
                                              handle-resize
                                              setup-fullscreen)]))
