ol.vips
Clojure bindings for libvips image processing library
ol.vips is a Clojure library for loading, transforming, and saving
images with libvips. Use it to
build thumbnails and responsive image variants, convert formats, crop
and resize uploads, compose images, read and write metadata, and run
image pipelines from files, byte arrays, or streams.
If you have never used libvips before: it is a native image processing
library designed for fast, memory-efficient image work. ol.vips gives
Clojure programs access to that engine with a Clojure-first API,
generated wrappers for the full libvips operation surface, and
platform-native jars so you can use libvips from the JVM without
building the native integration yourself.
ol.vips uses coffi and requires Java
22+ for FFI/FFM (Project Panama).
Project status: Experimental.
It is used in production, but needs more exercise and feedback from the community before I commit to a stable version.
Installation
Install the main library plus exactly one native jar that matches your target platform.
;; deps.edn
{:deps {com.outskirtslabs/vips {:git/url "https://github.com/outskirtslabs/vips.git"
:git/sha "46789851fa8d749517bb7e09ea4e7340e1b757ec" }
;; change the following based on your runtime platform
com.outskirtslabs/vips-native-linux-x86-64-gnu {:mvn/version "1.2.4-1" }}}
Don’t forget to run clojure -X:deps prep before first use if using the
git coord.
Choose one or more native artifacts (only the appropriate one for the runtime platform will be used):
-
com.outskirtslabs/vips-native-linux-x86-64-gnu -
com.outskirtslabs/vips-native-linux-x86-64-musl -
com.outskirtslabs/vips-native-linux-aarch64-gnu -
com.outskirtslabs/vips-native-linux-aarch64-musl -
com.outskirtslabs/vips-native-macos-x86-64 -
com.outskirtslabs/vips-native-macos-aarch64 -
com.outskirtslabs/vips-native-win32-x86-64
ol.vips requires Java 22+ and native access enabled for the JVM
process:
;; deps.edn
{:aliases
{:dev {:jvm-opts ["--enable-native-access=ALL-UNNAMED" ]}}}
To use your own libvips build, see Loading the native library.
Quick Start
(require ' [ol.vips :as v]
' [ol.vips.operations :as ops])
(v/init!)
(with-open [thumb (ops/thumbnail "dev/rabbit.jpg" 300 {:auto-rotate true })
rotated (ops/rotate thumb 90.0 )]
(v/write-to-file rotated "thumbnail.jpg" )
(v/metadata rotated))
;; => {:width 300, :height 242, :bands 3, :has-alpha? false}
The top-level ol.vips namespace provides the image loading, saving,
metadata, and convenience helpers. ol.vips.operations contains
generated wrappers for libvips operations.
Licensing
The Clojure library ol.vips is copyright © 2026 Casey Link and is
licensed under EUPL-1.2.
The platform-native companion jars under native/ redistribute upstream
sharp-libvips binary
bundles. Those redistributed native binaries are licensed separately
from the ol.vips source, principally under LGPL-3.0-or-later.