Image processing library for Clojure
Clojure Java
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src Caching for Long component values Mar 7, 2018
.gitignore updates Jun 10, 2015
.travis.yml Remove failing JDK9 build Mar 8, 2018 format status Jun 16, 2015
pom.xml Update deps Mar 2, 2018
project.clj Update project.clj deps Mar 2, 2018


Image processing library for Clojure

Contains various utility functions for handling colours and bitmap images.

Clojars Project

Build Status


(use 'mikera.image.core)
(require '[mikera.image.filters :as filt])

;; load an image from a resource file
(def ant (load-image-resource "mikera/image/samples/Ant.png"))

;; show the iamge, after applying an "invert" filter
(show (filter-image ant (filt/invert)))

Inverted ant


Features so far:

  • Creating new images
  • Scaling / zooming images
  • Loading images - from ordinary files, resource files, filesystem paths and streams
  • Getting and setting pixels in bulk using primitive arrays
  • Getting and setting individual pixels
  • Filtering images (blur, contrast, brightness etc.)
  • Various colour handling functions
  • Progressive encoding and controlling the quality of output images.

Imagez is a new library, so the API is being refined. Expect changes / additions on a regular basis.

Using Imagez

Simply add the dependency via Clojars:

Imagez requires Clojure 1.4 and above.

More Examples

(use 'mikera.image.core)
(use 'mikera.image.colours)

;; create a new image
(def bi (new-image 32 32))

;; gets the pixels of the image, as an int array
(def pixels (get-pixels bi))

;; fill some random pixels with colours
(dotimes [i 1024]
  (aset pixels i (rand-colour)))

;; update the image with the newly changed pixel values
(set-pixels bi pixels)

;; view our new work of art
;; the zoom function will automatically interpolate the pixel values
(show bi :zoom 10.0 :title "Isn't it beautiful?")

For more examples including image filtering, see the demo namespace:


LGPL version 3.0.