# ol.vips next Clojure bindings for libvips image processing library ## ol.vips.codegen # ol.vips.codegen Generate the introspected wrapper namespaces for `ol.vips`. This namespace queries the live libvips runtime through [`ol.vips`](api/ol-vips.adoc) and `ol.vips.impl.introspect`, then writes the generated public wrapper files: * `src/ol/vips/enums.clj` * `src/ol/vips/operations.clj` The generated files are derived from the currently loaded libvips build, so run this from a development environment where `ol.vips` can initialize its native libraries. Usage: ```clojure (require '[ol.vips.codegen :as codegen]) (codegen/generate!) ;;=> {:enum-count 42 ;; :operation-count 233 ;; :skipped-count 57 ;; :paths ["src/ol/vips/enums.clj" ;; "src/ol/vips/operations.clj"]} ``` In the ol.vips code repo the babashka task `bb codegen` is the normal project entry point for this namespace. ## generate! ```clojure (generate!) ``` Generates `ol.vips.enums` and `ol.vips.operations` from live libvips introspection. Initializes the runtime if needed, discovers the supported operations and enums from the current libvips build, writes the generated source files, and returns a summary map describing what was emitted. Example: ```clojure (generate!) ;;=> {:enum-count ... ;; :operation-count ... ;; :skipped-count ... ;; :paths ["src/ol/vips/enums.clj" "src/ol/vips/operations.clj"]} ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/codegen.clj#L441-L481) --- ## -main ```clojure (-main & _args) ``` Runs [`generate!`](#generate!) and prints a short CLI summary. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/codegen.clj#L483-L490) ## ol.vips.enums # ol.vips.enums Generated enum descriptors for normalized libvips enum ids. Use [`registry`](#registry) or the generated enum vars to inspect enum metadata. Use [`ol.vips/encode-enum`](api/ol-vips.adoc#encode-enum) and [`ol.vips/decode-enum`](api/ol-vips.adoc#decode-enum) to convert between keywords and the underlying libvips integer values. ## registry Generated registry of libvips enum descriptors keyed by normalized enum id. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L11-L54) --- ## access Generated enum descriptor for `VipsAccess`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:random` - `:sequential` - `:sequential-unbuffered` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L56-L65) --- ## align Generated enum descriptor for `VipsAlign`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:centre` - `:high` - `:low` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L67-L76) --- ## angle Generated enum descriptor for `VipsAngle`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:d0` - `:d180` - `:d270` - `:d90` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L78-L88) --- ## angle45 Generated enum descriptor for `VipsAngle45`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:d0` - `:d135` - `:d180` - `:d225` - `:d270` - `:d315` - `:d45` - `:d90` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L90-L104) --- ## band-format Generated enum descriptor for `VipsBandFormat`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:char` - `:complex` - `:double` - `:dpcomplex` - `:float` - `:int` - `:notset` - `:short` - `:uchar` - `:uint` - `:ushort` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L106-L123) --- ## blend-mode Generated enum descriptor for `VipsBlendMode`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:add` - `:atop` - `:clear` - `:colour-burn` - `:colour-dodge` - `:darken` - `:dest` - `:dest-atop` - `:dest-in` - `:dest-out` - `:dest-over` - `:difference` - `:exclusion` - `:hard-light` - `:in` - `:lighten` - `:multiply` - `:out` - `:over` - `:overlay` - `:saturate` - `:screen` - `:soft-light` - `:source` - `:xor` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L125-L156) --- ## coding Generated enum descriptor for `VipsCoding`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:error` - `:labq` - `:none` - `:rad` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L158-L168) --- ## combine Generated enum descriptor for `VipsCombine`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:max` - `:min` - `:sum` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L170-L179) --- ## combine-mode Generated enum descriptor for `VipsCombineMode`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:add` - `:set` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L181-L189) --- ## compass-direction Generated enum descriptor for `VipsCompassDirection`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:centre` - `:east` - `:north` - `:north-east` - `:north-west` - `:south` - `:south-east` - `:south-west` - `:west` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L191-L206) --- ## direction Generated enum descriptor for `VipsDirection`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:horizontal` - `:vertical` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L208-L216) --- ## extend Generated enum descriptor for `VipsExtend`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:background` - `:black` - `:copy` - `:mirror` - `:repeat` - `:white` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L218-L230) --- ## fail-on Generated enum descriptor for `VipsFailOn`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:error` - `:none` - `:truncated` - `:warning` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L232-L242) --- ## foreign-dz-container Generated enum descriptor for `VipsForeignDzContainer`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:fs` - `:szi` - `:zip` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L244-L253) --- ## foreign-dz-depth Generated enum descriptor for `VipsForeignDzDepth`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:one` - `:onepixel` - `:onetile` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L255-L264) --- ## foreign-dz-layout Generated enum descriptor for `VipsForeignDzLayout`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:dz` - `:google` - `:iiif` - `:iiif3` - `:zoomify` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L266-L277) --- ## foreign-heif-compression Generated enum descriptor for `VipsForeignHeifCompression`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:av1` - `:avc` - `:hevc` - `:jpeg` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L279-L289) --- ## foreign-heif-encoder Generated enum descriptor for `VipsForeignHeifEncoder`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:aom` - `:auto` - `:rav1e` - `:svt` - `:x265` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L291-L302) --- ## foreign-subsample Generated enum descriptor for `VipsForeignSubsample`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:auto` - `:off` - `:on` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L304-L313) --- ## foreign-tiff-compression Generated enum descriptor for `VipsForeignTiffCompression`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:ccittfax4` - `:deflate` - `:jp2k` - `:jpeg` - `:lzw` - `:none` - `:packbits` - `:webp` - `:zstd` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L315-L330) --- ## foreign-tiff-predictor Generated enum descriptor for `VipsForeignTiffPredictor`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:float` - `:horizontal` - `:none` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L332-L341) --- ## foreign-tiff-resunit Generated enum descriptor for `VipsForeignTiffResunit`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:cm` - `:inch` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L343-L351) --- ## foreign-webp-preset Generated enum descriptor for `VipsForeignWebpPreset`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:default` - `:drawing` - `:icon` - `:photo` - `:picture` - `:text` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L353-L365) --- ## intent Generated enum descriptor for `VipsIntent`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:absolute` - `:auto` - `:perceptual` - `:relative` - `:saturation` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L367-L378) --- ## interesting Generated enum descriptor for `VipsInteresting`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:all` - `:attention` - `:centre` - `:entropy` - `:high` - `:low` - `:none` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L380-L393) --- ## interpretation Generated enum descriptor for `VipsInterpretation`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:b-w` - `:cmc` - `:cmyk` - `:error` - `:fourier` - `:grey16` - `:histogram` - `:hsv` - `:lab` - `:labq` - `:labs` - `:lch` - `:matrix` - `:multiband` - `:rgb` - `:rgb16` - `:scrgb` - `:srgb` - `:xyz` - `:yxy` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L395-L421) --- ## kernel Generated enum descriptor for `VipsKernel`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:cubic` - `:lanczos2` - `:lanczos3` - `:linear` - `:mitchell` - `:mks2013` - `:mks2021` - `:nearest` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L423-L437) --- ## operation-boolean Generated enum descriptor for `VipsOperationBoolean`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:and` - `:eor` - `:lshift` - `:or` - `:rshift` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L439-L450) --- ## operation-complex Generated enum descriptor for `VipsOperationComplex`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:conj` - `:polar` - `:rect` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L452-L461) --- ## operation-complex2 Generated enum descriptor for `VipsOperationComplex2`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:cross-phase` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L463-L470) --- ## operation-complexget Generated enum descriptor for `VipsOperationComplexget`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:imag` - `:real` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L472-L480) --- ## operation-math Generated enum descriptor for `VipsOperationMath`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:acos` - `:acosh` - `:asin` - `:asinh` - `:atan` - `:atanh` - `:cos` - `:cosh` - `:exp` - `:exp10` - `:log` - `:log10` - `:sin` - `:sinh` - `:tan` - `:tanh` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L482-L504) --- ## operation-math2 Generated enum descriptor for `VipsOperationMath2`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:atan2` - `:pow` - `:wop` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L506-L515) --- ## operation-morphology Generated enum descriptor for `VipsOperationMorphology`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:dilate` - `:erode` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L517-L525) --- ## operation-relational Generated enum descriptor for `VipsOperationRelational`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:equal` - `:less` - `:lesseq` - `:more` - `:moreeq` - `:noteq` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L527-L539) --- ## operation-round Generated enum descriptor for `VipsOperationRound`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:ceil` - `:floor` - `:rint` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L541-L550) --- ## pcs Generated enum descriptor for `VipsPCS`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:lab` - `:xyz` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L552-L560) --- ## precision Generated enum descriptor for `VipsPrecision`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:approximate` - `:float` - `:integer` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L562-L571) --- ## region-shrink Generated enum descriptor for `VipsRegionShrink`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:max` - `:mean` - `:median` - `:min` - `:mode` - `:nearest` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L573-L585) --- ## sdf-shape Generated enum descriptor for `VipsSdfShape`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:box` - `:circle` - `:line` - `:rounded-box` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L587-L597) --- ## size Generated enum descriptor for `VipsSize`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:both` - `:down` - `:force` - `:up` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L599-L609) --- ## text-wrap Generated enum descriptor for `VipsTextWrap`. Use this value directly or look it up in [`registry`](#registry) when you want the generated enum map. Known values: - `:char` - `:none` - `:word` - `:word-char` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L611-L621) --- ## enums ```clojure (enums) ``` Lists the generated libvips enum ids. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/enums.clj#L623-L623) ## ol.vips.operations # ol.vips.operations Generated libvips operation wrappers keyed by normalized operation id. Inspect [`registry`](#registry) directly for generated operation metadata, then call the generated wrapper vars directly for typed access to supported libvips operations. ## registry [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L12-L245) --- ## abs ```clojure (abs input) ``` absolute value of an image Operation name: `abs`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L247-L263) --- ## add ```clojure (add left right) ``` add two images Operation name: `add`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L265-L282) --- ## addalpha ```clojure (addalpha input) ``` append an alpha channel Operation name: `addalpha`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L284-L300) --- ## affine ```clojure (affine input matrix) (affine input matrix opts) ``` affine transform of an image Operation name: `affine`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `matrix` -> `:matrix` (seqable of number): Transformation matrix Optional inputs: - `odx` -> `:odx` (float): Horizontal output displacement - `ody` -> `:ody` (float): Vertical output displacement - `idx` -> `:idx` (float): Horizontal input displacement - `idy` -> `:idy` (float): Vertical input displacement - `background` -> `:background` (seqable of number): Background value - `premultiplied` -> `:premultiplied` (boolean): Images have premultiplied alpha - `extend` -> `:extend` (keyword, see `ol.vips.enums/extend`): How to generate the extra pixels Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L302-L326) --- ## arrayjoin ```clojure (arrayjoin input) (arrayjoin input opts) ``` join an array of images Operation name: `arrayjoin`. Returns an image handle. Required inputs: - `input` -> `:in` (seqable of image): Array of input images Optional inputs: - `across` -> `:across` (integer): Number of images across grid - `shim` -> `:shim` (integer): Pixels between images - `background` -> `:background` (seqable of number): Colour for new pixels - `halign` -> `:halign` (keyword, see `ol.vips.enums/align`): Align on the left, centre or right - `valign` -> `:valign` (keyword, see `ol.vips.enums/align`): Align on the top, centre or bottom - `hspacing` -> `:hspacing` (integer): Horizontal spacing between images - `vspacing` -> `:vspacing` (integer): Vertical spacing between images Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L328-L351) --- ## autorot ```clojure (autorot input) ``` autorotate image by exif tag Operation name: `autorot`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image - `angle` -> `:angle` (keyword, see `ol.vips.enums/angle`): Angle image was rotated by - `flip` -> `:flip` (boolean): Whether the image was flipped or not [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L353-L371) --- ## avg ```clojure (avg input) ``` find image average Operation name: `avg`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (float): Output value [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L373-L389) --- ## bandbool ```clojure (bandbool input boolean) ``` boolean operation across image bands Operation name: `bandbool`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `boolean` -> `:boolean` (keyword, see `ol.vips.enums/operation-boolean`): Boolean to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L391-L408) --- ## bandfold ```clojure (bandfold input) (bandfold input opts) ``` fold up x axis into bands Operation name: `bandfold`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `factor` -> `:factor` (integer): Fold by this factor Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L410-L427) --- ## bandjoin ```clojure (bandjoin input) ``` bandwise join a set of images Operation name: `bandjoin`. Returns an image handle. Required inputs: - `input` -> `:in` (seqable of image): Array of input images Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L429-L445) --- ## bandjoin-const ```clojure (bandjoin-const input c) ``` append a constant band to an image Operation name: `bandjoin_const`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `c` -> `:c` (seqable of number): Array of constants to add Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L447-L464) --- ## bandmean ```clojure (bandmean input) ``` band-wise average Operation name: `bandmean`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L466-L482) --- ## bandrank ```clojure (bandrank input) (bandrank input opts) ``` band-wise rank of a set of images Operation name: `bandrank`. Returns an image handle. Required inputs: - `input` -> `:in` (seqable of image): Array of input images Optional inputs: - `index` -> `:index` (integer): Select this band element from sorted list Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L484-L501) --- ## bandunfold ```clojure (bandunfold input) (bandunfold input opts) ``` unfold image bands into x axis Operation name: `bandunfold`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `factor` -> `:factor` (integer): Unfold by this factor Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L503-L520) --- ## black ```clojure (black width height) (black width height opts) ``` make a black image Operation name: `black`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `bands` -> `:bands` (integer): Number of bands in image Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L522-L540) --- ## boolean ```clojure (boolean left right boolean) ``` boolean operation on two images Operation name: `boolean`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument - `boolean` -> `:boolean` (keyword, see `ol.vips.enums/operation-boolean`): Boolean to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L542-L560) --- ## boolean-const ```clojure (boolean-const input boolean c) ``` boolean operations against a constant Operation name: `boolean_const`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `boolean` -> `:boolean` (keyword, see `ol.vips.enums/operation-boolean`): Boolean to perform - `c` -> `:c` (seqable of number): Array of constants Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L562-L580) --- ## buildlut ```clojure (buildlut input) ``` build a look-up table Operation name: `buildlut`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Matrix of XY coordinates Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L582-L598) --- ## byteswap ```clojure (byteswap input) ``` byteswap an image Operation name: `byteswap`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L600-L616) --- ## cache ```clojure (cache input) (cache input opts) ``` cache an image Operation name: `cache`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `max-tiles` -> `:max-tiles` (integer): Maximum number of tiles to cache - `tile-height` -> `:tile-height` (integer): Tile height in pixels - `tile-width` -> `:tile-width` (integer): Tile width in pixels Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L618-L637) --- ## canny ```clojure (canny input) (canny input opts) ``` Canny edge detector Operation name: `canny`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `sigma` -> `:sigma` (float): Sigma of Gaussian - `precision` -> `:precision` (keyword, see `ol.vips.enums/precision`): Convolve with this precision Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L639-L657) --- ## case ```clojure (case index cases) ``` use pixel values to pick cases from an array of images Operation name: `case`. Returns an image handle. Required inputs: - `index` -> `:index` (image): Index image - `cases` -> `:cases` (seqable of image): Array of case images Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L659-L676) --- ## cast ```clojure (cast input format) (cast input format opts) ``` cast an image Operation name: `cast`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `format` -> `:format` (keyword, see `ol.vips.enums/band-format`): Format to cast to Optional inputs: - `shift` -> `:shift` (boolean): Shift integer values up and down Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L678-L696) --- ## clamp ```clojure (clamp input) (clamp input opts) ``` clamp values of an image Operation name: `clamp`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `min` -> `:min` (float): Minimum value - `max` -> `:max` (float): Maximum value Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L698-L716) --- ## cmc2-lch ```clojure (cmc2-lch input) ``` transform LCh to CMC Operation name: `CMC2LCh`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L718-L734) --- ## cmyk2-xyz ```clojure (cmyk2-xyz input) ``` transform CMYK to XYZ Operation name: `CMYK2XYZ`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L736-L752) --- ## colourspace ```clojure (colourspace input space) (colourspace input space opts) ``` convert to a new colorspace Operation name: `colourspace`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `space` -> `:space` (keyword, see `ol.vips.enums/interpretation`): Destination color space Optional inputs: - `source-space` -> `:source-space` (keyword, see `ol.vips.enums/interpretation`): Source color space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L754-L772) --- ## compass ```clojure (compass input mask) (compass input mask opts) ``` convolve with rotating mask Operation name: `compass`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `mask` -> `:mask` (image): Input matrix image Optional inputs: - `times` -> `:times` (integer): Rotate and convolve this many times - `angle` -> `:angle` (keyword, see `ol.vips.enums/angle45`): Rotate mask by this much between convolutions - `combine` -> `:combine` (keyword, see `ol.vips.enums/combine`): Combine convolution results like this - `precision` -> `:precision` (keyword, see `ol.vips.enums/precision`): Convolve with this precision - `layers` -> `:layers` (integer): Use this many layers in approximation - `cluster` -> `:cluster` (integer): Cluster lines closer than this in approximation Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L774-L797) --- ## complex ```clojure (complex input cmplx) ``` perform a complex operation on an image Operation name: `complex`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `cmplx` -> `:cmplx` (keyword, see `ol.vips.enums/operation-complex`): Complex to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L799-L816) --- ## complex2 ```clojure (complex2 left right cmplx) ``` complex binary operations on two images Operation name: `complex2`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument - `cmplx` -> `:cmplx` (keyword, see `ol.vips.enums/operation-complex2`): Binary complex operation to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L818-L836) --- ## complexform ```clojure (complexform left right) ``` form a complex image from two real images Operation name: `complexform`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L838-L855) --- ## complexget ```clojure (complexget input get) ``` get a component from a complex image Operation name: `complexget`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `get` -> `:get` (keyword, see `ol.vips.enums/operation-complexget`): Complex to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L857-L874) --- ## composite2 ```clojure (composite2 base overlay mode) (composite2 base overlay mode opts) ``` blend a pair of images with a blend mode Operation name: `composite2`. Returns an image handle. Required inputs: - `base` -> `:base` (image): Base image - `overlay` -> `:overlay` (image): Overlay image - `mode` -> `:mode` (keyword, see `ol.vips.enums/blend-mode`): VipsBlendMode to join with Optional inputs: - `x` -> `:x` (integer): x position of overlay - `y` -> `:y` (integer): y position of overlay - `compositing-space` -> `:compositing-space` (keyword, see `ol.vips.enums/interpretation`): Composite images in this colour space - `premultiplied` -> `:premultiplied` (boolean): Images have premultiplied alpha Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L876-L898) --- ## conv ```clojure (conv input mask) (conv input mask opts) ``` convolution operation Operation name: `conv`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `mask` -> `:mask` (image): Input matrix image Optional inputs: - `precision` -> `:precision` (keyword, see `ol.vips.enums/precision`): Convolve with this precision - `layers` -> `:layers` (integer): Use this many layers in approximation - `cluster` -> `:cluster` (integer): Cluster lines closer than this in approximation Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L900-L920) --- ## conva ```clojure (conva input mask) (conva input mask opts) ``` approximate integer convolution Operation name: `conva`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `mask` -> `:mask` (image): Input matrix image Optional inputs: - `layers` -> `:layers` (integer): Use this many layers in approximation - `cluster` -> `:cluster` (integer): Cluster lines closer than this in approximation Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L922-L941) --- ## convasep ```clojure (convasep input mask) (convasep input mask opts) ``` approximate separable integer convolution Operation name: `convasep`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `mask` -> `:mask` (image): Input matrix image Optional inputs: - `layers` -> `:layers` (integer): Use this many layers in approximation Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L943-L961) --- ## convf ```clojure (convf input mask) ``` float convolution operation Operation name: `convf`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `mask` -> `:mask` (image): Input matrix image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L963-L980) --- ## convi ```clojure (convi input mask) ``` int convolution operation Operation name: `convi`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `mask` -> `:mask` (image): Input matrix image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L982-L999) --- ## convsep ```clojure (convsep input mask) (convsep input mask opts) ``` separable convolution operation Operation name: `convsep`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `mask` -> `:mask` (image): Input matrix image Optional inputs: - `precision` -> `:precision` (keyword, see `ol.vips.enums/precision`): Convolve with this precision - `layers` -> `:layers` (integer): Use this many layers in approximation - `cluster` -> `:cluster` (integer): Cluster lines closer than this in approximation Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1001-L1021) --- ## copy ```clojure (copy input) (copy input opts) ``` copy an image Operation name: `copy`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `swap` -> `:swap` (boolean): Swap bytes in image between little and big-endian - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `bands` -> `:bands` (integer): Number of bands in image - `format` -> `:format` (keyword, see `ol.vips.enums/band-format`): Pixel format in image - `coding` -> `:coding` (keyword, see `ol.vips.enums/coding`): Pixel coding - `interpretation` -> `:interpretation` (keyword, see `ol.vips.enums/interpretation`): Pixel interpretation - `xres` -> `:xres` (float): Horizontal resolution in pixels/mm - `yres` -> `:yres` (float): Vertical resolution in pixels/mm - `xoffset` -> `:xoffset` (integer): Horizontal offset of origin - `yoffset` -> `:yoffset` (integer): Vertical offset of origin Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1023-L1050) --- ## countlines ```clojure (countlines input direction) ``` count lines in an image Operation name: `countlines`. Returns a result map. Required inputs: - `input` -> `:in` (image): Input image argument - `direction` -> `:direction` (keyword, see `ol.vips.enums/direction`): Countlines left-right or up-down Optional inputs: - none Outputs: - `nolines` -> `:nolines` (float): Number of lines [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1052-L1069) --- ## csvload ```clojure (csvload filename) (csvload filename opts) ``` load csv Operation name: `csvload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `skip` -> `:skip` (integer): Skip this many lines at the start of the file - `lines` -> `:lines` (integer): Read this many lines from the file - `whitespace` -> `:whitespace` (string): Set of whitespace characters - `separator` -> `:separator` (string): Set of separator characters - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1071-L1099) --- ## csvsave ```clojure (csvsave input filename) (csvsave input filename opts) ``` save image to csv Operation name: `csvsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `separator` -> `:separator` (string): Separator characters - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1101-L1124) --- ## d-e00 ```clojure (d-e00 left right) ``` calculate dE00 Operation name: `dE00`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand input image - `right` -> `:right` (image): Right-hand input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1126-L1143) --- ## d-e76 ```clojure (d-e76 left right) ``` calculate dE76 Operation name: `dE76`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand input image - `right` -> `:right` (image): Right-hand input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1145-L1162) --- ## d-ecmc ```clojure (d-ecmc left right) ``` calculate dECMC Operation name: `dECMC`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand input image - `right` -> `:right` (image): Right-hand input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1164-L1181) --- ## deviate ```clojure (deviate input) ``` find image standard deviation Operation name: `deviate`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (float): Output value [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1183-L1199) --- ## divide ```clojure (divide left right) ``` divide two images Operation name: `divide`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1201-L1218) --- ## draw-circle ```clojure (draw-circle image ink cx cy radius) (draw-circle image ink cx cy radius opts) ``` draw a circle on an image Operation name: `draw_circle`. Returns a result map. Required inputs: - `image` -> `:image` (image): Image to draw on - `ink` -> `:ink` (seqable of number): Color for pixels - `cx` -> `:cx` (integer): Centre of draw_circle - `cy` -> `:cy` (integer): Centre of draw_circle - `radius` -> `:radius` (integer): Radius in pixels Optional inputs: - `fill` -> `:fill` (boolean): Draw a solid object Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1220-L1241) --- ## draw-flood ```clojure (draw-flood image ink x y) (draw-flood image ink x y opts) ``` flood-fill an area Operation name: `draw_flood`. Returns a result map. Required inputs: - `image` -> `:image` (image): Image to draw on - `ink` -> `:ink` (seqable of number): Color for pixels - `x` -> `:x` (integer): DrawFlood start point - `y` -> `:y` (integer): DrawFlood start point Optional inputs: - `test` -> `:test` (image): Test pixels in this image - `equal` -> `:equal` (boolean): DrawFlood while equal to edge Outputs: - `left` -> `:left` (integer): Left edge of modified area - `top` -> `:top` (integer): Top edge of modified area - `width` -> `:width` (integer): Width of modified area - `height` -> `:height` (integer): Height of modified area [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1243-L1267) --- ## draw-image ```clojure (draw-image image sub x y) (draw-image image sub x y opts) ``` paint an image into another image Operation name: `draw_image`. Returns a result map. Required inputs: - `image` -> `:image` (image): Image to draw on - `sub` -> `:sub` (image): Sub-image to insert into main image - `x` -> `:x` (integer): Draw image here - `y` -> `:y` (integer): Draw image here Optional inputs: - `mode` -> `:mode` (keyword, see `ol.vips.enums/combine-mode`): Combining mode Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1269-L1289) --- ## draw-line ```clojure (draw-line image ink x1 y1 x2 y2) ``` draw a line on an image Operation name: `draw_line`. Returns a result map. Required inputs: - `image` -> `:image` (image): Image to draw on - `ink` -> `:ink` (seqable of number): Color for pixels - `x1` -> `:x1` (integer): Start of draw_line - `y1` -> `:y1` (integer): Start of draw_line - `x2` -> `:x2` (integer): End of draw_line - `y2` -> `:y2` (integer): End of draw_line Optional inputs: - none Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1291-L1312) --- ## draw-mask ```clojure (draw-mask image ink mask x y) ``` draw a mask on an image Operation name: `draw_mask`. Returns a result map. Required inputs: - `image` -> `:image` (image): Image to draw on - `ink` -> `:ink` (seqable of number): Color for pixels - `mask` -> `:mask` (image): Mask of pixels to draw - `x` -> `:x` (integer): Draw mask here - `y` -> `:y` (integer): Draw mask here Optional inputs: - none Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1314-L1334) --- ## draw-rect ```clojure (draw-rect image ink left top width height) (draw-rect image ink left top width height opts) ``` paint a rectangle on an image Operation name: `draw_rect`. Returns a result map. Required inputs: - `image` -> `:image` (image): Image to draw on - `ink` -> `:ink` (seqable of number): Color for pixels - `left` -> `:left` (integer): Rect to fill - `top` -> `:top` (integer): Rect to fill - `width` -> `:width` (integer): Rect to fill - `height` -> `:height` (integer): Rect to fill Optional inputs: - `fill` -> `:fill` (boolean): Draw a solid object Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1336-L1358) --- ## draw-smudge ```clojure (draw-smudge image left top width height) ``` blur a rectangle on an image Operation name: `draw_smudge`. Returns a result map. Required inputs: - `image` -> `:image` (image): Image to draw on - `left` -> `:left` (integer): Rect to fill - `top` -> `:top` (integer): Rect to fill - `width` -> `:width` (integer): Rect to fill - `height` -> `:height` (integer): Rect to fill Optional inputs: - none Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1360-L1380) --- ## dzsave ```clojure (dzsave input filename) (dzsave input filename opts) ``` save image to deepzoom file Operation name: `dzsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `dirname` -> `:dirname` (string): Directory name to save to - `imagename` -> `:imagename` (string): Image name - `layout` -> `:layout` (keyword, see `ol.vips.enums/foreign-dz-layout`): Directory layout - `suffix` -> `:suffix` (string): Filename suffix for tiles - `overlap` -> `:overlap` (integer): Tile overlap in pixels - `tile-size` -> `:tile-size` (integer): Tile size in pixels - `tile-height` -> `:tile-height` (integer): Tile height in pixels - `tile-width` -> `:tile-width` (integer): Tile width in pixels - `centre` -> `:centre` (boolean): Center image in tile - `depth` -> `:depth` (keyword, see `ol.vips.enums/foreign-dz-depth`): Pyramid depth - `angle` -> `:angle` (keyword, see `ol.vips.enums/angle`): Rotate image during save - `container` -> `:container` (keyword, see `ol.vips.enums/foreign-dz-container`): Pyramid container type - `properties` -> `:properties` (boolean): Write a properties file to the output directory - `compression` -> `:compression` (integer): ZIP deflate compression level - `region-shrink` -> `:region-shrink` (keyword, see `ol.vips.enums/region-shrink`): Method to shrink regions - `skip-blanks` -> `:skip-blanks` (integer): Skip tiles which are nearly equal to the background - `id` -> `:id` (string): Resource ID - `q` -> `:Q` (integer): Q factor - `no-strip` -> `:no-strip` (boolean): Don’t strip tile metadata - `basename` -> `:basename` (string): Base name to save to - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1382-L1424) --- ## embed ```clojure (embed input x y width height) (embed input x y width height opts) ``` embed an image in a larger image Operation name: `embed`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `x` -> `:x` (integer): Left edge of input in output - `y` -> `:y` (integer): Top edge of input in output - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `extend` -> `:extend` (keyword, see `ol.vips.enums/extend`): How to generate the extra pixels - `background` -> `:background` (seqable of number): Color for background pixels Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1426-L1448) --- ## extract-area ```clojure (extract-area input left top width height) ``` extract an area from an image Operation name: `extract_area`. Returns an image handle. Required inputs: - `input` -> `:input` (image): Input image - `left` -> `:left` (integer): Left edge of extract area - `top` -> `:top` (integer): Top edge of extract area - `width` -> `:width` (integer): Width of extract area - `height` -> `:height` (integer): Height of extract area Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1450-L1470) --- ## extract-band ```clojure (extract-band input band) (extract-band input band opts) ``` extract band from an image Operation name: `extract_band`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `band` -> `:band` (integer): Band to extract Optional inputs: - `n` -> `:n` (integer): Number of bands to extract Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1472-L1490) --- ## eye ```clojure (eye width height) (eye width height opts) ``` make an image showing the eye’s spatial response Operation name: `eye`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `factor` -> `:factor` (float): Maximum spatial frequency Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1492-L1511) --- ## falsecolour ```clojure (falsecolour input) ``` false-color an image Operation name: `falsecolour`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1513-L1529) --- ## fastcor ```clojure (fastcor input ref) ``` fast correlation Operation name: `fastcor`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `ref` -> `:ref` (image): Input reference image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1531-L1548) --- ## fill-nearest ```clojure (fill-nearest input) ``` fill image zeros with nearest non-zero pixel Operation name: `fill_nearest`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `input` -> `:in` (image): Input image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Value of nearest non-zero pixel - `distance` -> `:distance` (image): Distance to nearest non-zero pixel [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1550-L1567) --- ## find-trim ```clojure (find-trim input) (find-trim input opts) ``` search an image for non-edge areas Operation name: `find_trim`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to find_trim Optional inputs: - `threshold` -> `:threshold` (float): Object threshold - `background` -> `:background` (seqable of number): Color for background pixels - `line-art` -> `:line-art` (boolean): Enable line art mode Outputs: - `left` -> `:left` (integer): Left edge of image - `top` -> `:top` (integer): Top edge of extract area - `width` -> `:width` (integer): Width of extract area - `height` -> `:height` (integer): Height of extract area [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1569-L1591) --- ## flatten ```clojure (flatten input) (flatten input opts) ``` flatten alpha out of an image Operation name: `flatten`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `background` -> `:background` (seqable of number): Background value - `max-alpha` -> `:max-alpha` (float): Maximum value of alpha channel Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1593-L1611) --- ## flip ```clojure (flip input direction) ``` flip an image Operation name: `flip`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `direction` -> `:direction` (keyword, see `ol.vips.enums/direction`): Direction to flip image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1613-L1630) --- ## float2rad ```clojure (float2rad input) ``` transform float RGB to Radiance coding Operation name: `float2rad`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1632-L1648) --- ## fractsurf ```clojure (fractsurf width height fractal-dimension) ``` make a fractal surface Operation name: `fractsurf`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `fractal-dimension` -> `:fractal-dimension` (float): Fractal dimension Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1650-L1668) --- ## freqmult ```clojure (freqmult input mask) ``` frequency-domain filtering Operation name: `freqmult`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `mask` -> `:mask` (image): Input mask image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1670-L1687) --- ## gamma ```clojure (gamma input) (gamma input opts) ``` gamma an image Operation name: `gamma`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `exponent` -> `:exponent` (float): Gamma factor Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1689-L1706) --- ## gaussblur ```clojure (gaussblur input sigma) (gaussblur input sigma opts) ``` gaussian blur Operation name: `gaussblur`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `sigma` -> `:sigma` (float): Sigma of Gaussian Optional inputs: - `min-ampl` -> `:min-ampl` (float): Minimum amplitude of Gaussian - `precision` -> `:precision` (keyword, see `ol.vips.enums/precision`): Convolve with this precision Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1708-L1727) --- ## gaussmat ```clojure (gaussmat sigma min-ampl) (gaussmat sigma min-ampl opts) ``` make a gaussian image Operation name: `gaussmat`. Returns an image handle. Required inputs: - `sigma` -> `:sigma` (float): Sigma of Gaussian - `min-ampl` -> `:min-ampl` (float): Minimum amplitude of Gaussian Optional inputs: - `separable` -> `:separable` (boolean): Generate separable Gaussian - `integer` -> `:integer` (boolean): Generate integer Gaussian - `precision` -> `:precision` (keyword, see `ol.vips.enums/precision`): Generate with this precision Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1729-L1749) --- ## gaussnoise ```clojure (gaussnoise width height) (gaussnoise width height opts) ``` make a gaussnoise image Operation name: `gaussnoise`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `sigma` -> `:sigma` (float): Standard deviation of pixels in generated image - `mean` -> `:mean` (float): Mean of pixels in generated image - `seed` -> `:seed` (integer): Random number seed Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1751-L1771) --- ## gifload ```clojure (gifload filename) (gifload filename opts) ``` load GIF with libnsgif Operation name: `gifload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `n` -> `:n` (integer): Number of pages to load, -1 for all - `page` -> `:page` (integer): First page to load - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1773-L1799) --- ## gifsave ```clojure (gifsave input filename) (gifsave input filename opts) ``` save as gif Operation name: `gifsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `dither` -> `:dither` (float): Amount of dithering - `effort` -> `:effort` (integer): Quantisation effort - `bitdepth` -> `:bitdepth` (integer): Number of bits per pixel - `interframe-maxerror` -> `:interframe-maxerror` (float): Maximum inter-frame error for transparency - `reuse` -> `:reuse` (boolean): Reuse palette from input - `interpalette-maxerror` -> `:interpalette-maxerror` (float): Maximum inter-palette error for palette reusage - `interlace` -> `:interlace` (boolean): Generate an interlaced (progressive) GIF - `reoptimise` -> `:reoptimise` (boolean): Reoptimise colour palettes - `keep-duplicate-frames` -> `:keep-duplicate-frames` (boolean): Keep duplicate frames in the output instead of combining them - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1801-L1832) --- ## globalbalance ```clojure (globalbalance input) (globalbalance input opts) ``` global balance an image mosaic Operation name: `globalbalance`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `gamma` -> `:gamma` (float): Image gamma - `int-output` -> `:int-output` (boolean): Integer output Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1834-L1852) --- ## gravity ```clojure (gravity input direction width height) (gravity input direction width height opts) ``` place an image within a larger image with a certain gravity Operation name: `gravity`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `direction` -> `:direction` (keyword, see `ol.vips.enums/compass-direction`): Direction to place image within width/height - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `extend` -> `:extend` (keyword, see `ol.vips.enums/extend`): How to generate the extra pixels - `background` -> `:background` (seqable of number): Color for background pixels Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1854-L1875) --- ## grey ```clojure (grey width height) (grey width height opts) ``` make a grey ramp image Operation name: `grey`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1877-L1895) --- ## grid ```clojure (grid input tile-height across down) ``` grid an image Operation name: `grid`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `tile-height` -> `:tile-height` (integer): Chop into tiles this high - `across` -> `:across` (integer): Number of tiles across - `down` -> `:down` (integer): Number of tiles down Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1897-L1916) --- ## heifload ```clojure (heifload filename) (heifload filename opts) ``` load a HEIF image Operation name: `heifload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `page` -> `:page` (integer): First page to load - `n` -> `:n` (integer): Number of pages to load, -1 for all - `thumbnail` -> `:thumbnail` (boolean): Fetch thumbnail image - `autorotate` -> `:autorotate` (boolean): Rotate image using exif orientation - `unlimited` -> `:unlimited` (boolean): Remove all denial of service limits - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1918-L1947) --- ## heifsave ```clojure (heifsave input filename) (heifsave input filename opts) ``` save image in HEIF format Operation name: `heifsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `q` -> `:Q` (integer): Q factor - `bitdepth` -> `:bitdepth` (integer): Number of bits per pixel - `lossless` -> `:lossless` (boolean): Enable lossless compression - `compression` -> `:compression` (keyword, see `ol.vips.enums/foreign-heif-compression`): Compression format - `effort` -> `:effort` (integer): CPU effort - `subsample-mode` -> `:subsample-mode` (keyword, see `ol.vips.enums/foreign-subsample`): Select chroma subsample operation mode - `speed` -> `:speed` (integer): CPU effort - `encoder` -> `:encoder` (keyword, see `ol.vips.enums/foreign-heif-encoder`): Select encoder to use - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1949-L1979) --- ## hist-cum ```clojure (hist-cum input) ``` form cumulative histogram Operation name: `hist_cum`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1981-L1997) --- ## hist-entropy ```clojure (hist-entropy input) ``` estimate image entropy Operation name: `hist_entropy`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `input` -> `:in` (image): Input histogram image Optional inputs: - none Outputs: - `out` -> `:out` (float): Output value [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L1999-L2015) --- ## hist-equal ```clojure (hist-equal input) (hist-equal input opts) ``` histogram equalisation Operation name: `hist_equal`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `band` -> `:band` (integer): Equalise with this band Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2017-L2034) --- ## hist-find ```clojure (hist-find input) (hist-find input opts) ``` find image histogram Operation name: `hist_find`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `band` -> `:band` (integer): Find histogram of band Outputs: - `out` -> `:out` (image): Output histogram [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2036-L2053) --- ## hist-find-indexed ```clojure (hist-find-indexed input index) (hist-find-indexed input index opts) ``` find indexed image histogram Operation name: `hist_find_indexed`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `index` -> `:index` (image): Index image Optional inputs: - `combine` -> `:combine` (keyword, see `ol.vips.enums/combine`): Combine bins like this Outputs: - `out` -> `:out` (image): Output histogram [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2055-L2073) --- ## hist-find-ndim ```clojure (hist-find-ndim input) (hist-find-ndim input opts) ``` find n-dimensional image histogram Operation name: `hist_find_ndim`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `bins` -> `:bins` (integer): Number of bins in each dimension Outputs: - `out` -> `:out` (image): Output histogram [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2075-L2092) --- ## hist-ismonotonic ```clojure (hist-ismonotonic input) ``` test for monotonicity Operation name: `hist_ismonotonic`. Returns a result map. Required inputs: - `input` -> `:in` (image): Input histogram image Optional inputs: - none Outputs: - `monotonic` -> `:monotonic` (boolean): true if in is monotonic [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2094-L2110) --- ## hist-local ```clojure (hist-local input width height) (hist-local input width height opts) ``` local histogram equalisation Operation name: `hist_local`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `width` -> `:width` (integer): Window width in pixels - `height` -> `:height` (integer): Window height in pixels Optional inputs: - `max-slope` -> `:max-slope` (integer): Maximum slope (CLAHE) Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2112-L2131) --- ## hist-match ```clojure (hist-match input ref) ``` match two histograms Operation name: `hist_match`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input histogram - `ref` -> `:ref` (image): Reference histogram Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2133-L2150) --- ## hist-norm ```clojure (hist-norm input) ``` normalise histogram Operation name: `hist_norm`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2152-L2168) --- ## hist-plot ```clojure (hist-plot input) ``` plot histogram Operation name: `hist_plot`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2170-L2186) --- ## hough-circle ```clojure (hough-circle input) (hough-circle input opts) ``` find hough circle transform Operation name: `hough_circle`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `scale` -> `:scale` (integer): Scale down dimensions by this factor - `min-radius` -> `:min-radius` (integer): Smallest radius to search for - `max-radius` -> `:max-radius` (integer): Largest radius to search for Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2188-L2207) --- ## hough-line ```clojure (hough-line input) (hough-line input opts) ``` find hough line transform Operation name: `hough_line`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `width` -> `:width` (integer): Horizontal size of parameter space - `height` -> `:height` (integer): Vertical size of parameter space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2209-L2227) --- ## hsv2s-rgb ```clojure (hsv2s-rgb input) ``` transform HSV to sRGB Operation name: `HSV2sRGB`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2229-L2245) --- ## icc-export ```clojure (icc-export input) (icc-export input opts) ``` output to device with ICC profile Operation name: `icc_export`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `pcs` -> `:pcs` (keyword, see `ol.vips.enums/pcs`): Set Profile Connection Space - `intent` -> `:intent` (keyword, see `ol.vips.enums/intent`): Rendering intent - `black-point-compensation` -> `:black-point-compensation` (boolean): Enable black point compensation - `output-profile` -> `:output-profile` (string): Filename to load output profile from - `depth` -> `:depth` (integer): Output device space depth in bits Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2247-L2268) --- ## icc-import ```clojure (icc-import input) (icc-import input opts) ``` import from device with ICC profile Operation name: `icc_import`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `pcs` -> `:pcs` (keyword, see `ol.vips.enums/pcs`): Set Profile Connection Space - `intent` -> `:intent` (keyword, see `ol.vips.enums/intent`): Rendering intent - `black-point-compensation` -> `:black-point-compensation` (boolean): Enable black point compensation - `embedded` -> `:embedded` (boolean): Use embedded input profile, if available - `input-profile` -> `:input-profile` (string): Filename to load input profile from Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2270-L2291) --- ## icc-transform ```clojure (icc-transform input output-profile) (icc-transform input output-profile opts) ``` transform between devices with ICC profiles Operation name: `icc_transform`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `output-profile` -> `:output-profile` (string): Filename to load output profile from Optional inputs: - `pcs` -> `:pcs` (keyword, see `ol.vips.enums/pcs`): Set Profile Connection Space - `intent` -> `:intent` (keyword, see `ol.vips.enums/intent`): Rendering intent - `black-point-compensation` -> `:black-point-compensation` (boolean): Enable black point compensation - `embedded` -> `:embedded` (boolean): Use embedded input profile, if available - `input-profile` -> `:input-profile` (string): Filename to load input profile from - `depth` -> `:depth` (integer): Output device space depth in bits Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2293-L2316) --- ## identity ```clojure (identity) (identity opts) ``` make a 1D image where pixel values are indexes Operation name: `identity`. Returns an image handle. Required inputs: - none Optional inputs: - `bands` -> `:bands` (integer): Number of bands in LUT - `ushort` -> `:ushort` (boolean): Create a 16-bit LUT - `size` -> `:size` (integer): Size of 16-bit LUT Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2318-L2337) --- ## ifthenelse ```clojure (ifthenelse cond in1 in2) (ifthenelse cond in1 in2 opts) ``` ifthenelse an image Operation name: `ifthenelse`. Returns an image handle. Required inputs: - `cond` -> `:cond` (image): Condition input image - `in1` -> `:in1` (image): Source for TRUE pixels - `in2` -> `:in2` (image): Source for FALSE pixels Optional inputs: - `blend` -> `:blend` (boolean): Blend smoothly between then and else parts Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2339-L2358) --- ## insert ```clojure (insert main sub x y) (insert main sub x y opts) ``` insert image @sub into @main at @x, @y Operation name: `insert`. Returns an image handle. Required inputs: - `main` -> `:main` (image): Main input image - `sub` -> `:sub` (image): Sub-image to insert into main image - `x` -> `:x` (integer): Left edge of sub in main - `y` -> `:y` (integer): Top edge of sub in main Optional inputs: - `expand` -> `:expand` (boolean): Expand output to hold all of both inputs - `background` -> `:background` (seqable of number): Color for new pixels Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2360-L2381) --- ## invert ```clojure (invert input) ``` invert an image Operation name: `invert`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2383-L2399) --- ## invertlut ```clojure (invertlut input) (invertlut input opts) ``` build an inverted look-up table Operation name: `invertlut`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Matrix of XY coordinates Optional inputs: - `size` -> `:size` (integer): LUT size to generate Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2401-L2418) --- ## join ```clojure (join in1 in2 direction) (join in1 in2 direction opts) ``` join a pair of images Operation name: `join`. Returns an image handle. Required inputs: - `in1` -> `:in1` (image): First input image - `in2` -> `:in2` (image): Second input image - `direction` -> `:direction` (keyword, see `ol.vips.enums/direction`): Join left-right or up-down Optional inputs: - `expand` -> `:expand` (boolean): Expand output to hold all of both inputs - `shim` -> `:shim` (integer): Pixels between images - `background` -> `:background` (seqable of number): Colour for new pixels - `align` -> `:align` (keyword, see `ol.vips.enums/align`): Align on the low, centre or high coordinate edge Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2420-L2442) --- ## jpegload ```clojure (jpegload filename) (jpegload filename opts) ``` load jpeg from file Operation name: `jpegload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `shrink` -> `:shrink` (integer): Shrink factor on load - `autorotate` -> `:autorotate` (boolean): Rotate image using exif orientation - `unlimited` -> `:unlimited` (boolean): Remove all denial of service limits - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2444-L2471) --- ## jpegsave ```clojure (jpegsave input filename) (jpegsave input filename opts) ``` save image to jpeg file Operation name: `jpegsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `q` -> `:Q` (integer): Q factor - `optimize-coding` -> `:optimize-coding` (boolean): Compute optimal Huffman coding tables - `interlace` -> `:interlace` (boolean): Generate an interlaced (progressive) jpeg - `no-subsample` -> `:no-subsample` (boolean): Disable chroma subsample - `trellis-quant` -> `:trellis-quant` (boolean): Apply trellis quantisation to each 8x8 block - `overshoot-deringing` -> `:overshoot-deringing` (boolean): Apply overshooting to samples with extreme values - `optimize-scans` -> `:optimize-scans` (boolean): Split spectrum of DCT coefficients into separate scans - `quant-table` -> `:quant-table` (integer): Use predefined quantization table with given index - `subsample-mode` -> `:subsample-mode` (keyword, see `ol.vips.enums/foreign-subsample`): Select chroma subsample operation mode - `restart-interval` -> `:restart-interval` (integer): Add restart markers every specified number of mcu - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2473-L2505) --- ## jpegsave-mime ```clojure (jpegsave-mime input) (jpegsave-mime input opts) ``` save image to jpeg mime Operation name: `jpegsave_mime`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save Optional inputs: - `q` -> `:Q` (integer): Q factor - `optimize-coding` -> `:optimize-coding` (boolean): Compute optimal Huffman coding tables - `interlace` -> `:interlace` (boolean): Generate an interlaced (progressive) jpeg - `no-subsample` -> `:no-subsample` (boolean): Disable chroma subsample - `trellis-quant` -> `:trellis-quant` (boolean): Apply trellis quantisation to each 8x8 block - `overshoot-deringing` -> `:overshoot-deringing` (boolean): Apply overshooting to samples with extreme values - `optimize-scans` -> `:optimize-scans` (boolean): Split spectrum of DCT coefficients into separate scans - `quant-table` -> `:quant-table` (integer): Use predefined quantization table with given index - `subsample-mode` -> `:subsample-mode` (keyword, see `ol.vips.enums/foreign-subsample`): Select chroma subsample operation mode - `restart-interval` -> `:restart-interval` (integer): Add restart markers every specified number of mcu - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2507-L2538) --- ## lab-q2-lab ```clojure (lab-q2-lab input) ``` unpack a LabQ image to float Lab Operation name: `LabQ2Lab`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2540-L2556) --- ## lab-q2-lab-s ```clojure (lab-q2-lab-s input) ``` unpack a LabQ image to short Lab Operation name: `LabQ2LabS`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2558-L2574) --- ## lab-q2s-rgb ```clojure (lab-q2s-rgb input) ``` convert a LabQ image to sRGB Operation name: `LabQ2sRGB`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2576-L2592) --- ## lab-s2-lab ```clojure (lab-s2-lab input) ``` transform signed short Lab to float Operation name: `LabS2Lab`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2594-L2610) --- ## lab-s2-lab-q ```clojure (lab-s2-lab-q input) ``` transform short Lab to LabQ coding Operation name: `LabS2LabQ`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2612-L2628) --- ## lab2-lab-q ```clojure (lab2-lab-q input) ``` transform float Lab to LabQ coding Operation name: `Lab2LabQ`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2630-L2646) --- ## lab2-lab-s ```clojure (lab2-lab-s input) ``` transform float Lab to signed short Operation name: `Lab2LabS`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2648-L2664) --- ## lab2-lch ```clojure (lab2-lch input) ``` transform Lab to LCh Operation name: `Lab2LCh`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2666-L2682) --- ## lab2-xyz ```clojure (lab2-xyz input) (lab2-xyz input opts) ``` transform CIELAB to XYZ Operation name: `Lab2XYZ`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `temp` -> `:temp` (seqable of number): Color temperature Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2684-L2701) --- ## labelregions ```clojure (labelregions input) ``` label regions in an image Operation name: `labelregions`. Returns a result map. Required inputs: - `input` -> `:in` (image): Input image argument Optional inputs: - none Outputs: - `mask` -> `:mask` (image): Mask of region labels - `segments` -> `:segments` (integer): Number of discrete contiguous regions [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2703-L2720) --- ## lch2-cmc ```clojure (lch2-cmc input) ``` transform LCh to CMC Operation name: `LCh2CMC`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2722-L2738) --- ## lch2-lab ```clojure (lch2-lab input) ``` transform LCh to Lab Operation name: `LCh2Lab`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2740-L2756) --- ## linear ```clojure (linear input a b) (linear input a b opts) ``` calculate (a * in + b) Operation name: `linear`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `a` -> `:a` (seqable of number): Multiply by this - `b` -> `:b` (seqable of number): Add this Optional inputs: - `uchar` -> `:uchar` (boolean): Output should be uchar Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2758-L2777) --- ## linecache ```clojure (linecache input) (linecache input opts) ``` cache an image as a set of lines Operation name: `linecache`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `tile-height` -> `:tile-height` (integer): Tile height in pixels - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Expected access pattern - `threaded` -> `:threaded` (boolean): Allow threaded access - `persistent` -> `:persistent` (boolean): Keep cache between evaluations Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2779-L2799) --- ## logmat ```clojure (logmat sigma min-ampl) (logmat sigma min-ampl opts) ``` make a Laplacian of Gaussian image Operation name: `logmat`. Returns an image handle. Required inputs: - `sigma` -> `:sigma` (float): Radius of Gaussian - `min-ampl` -> `:min-ampl` (float): Minimum amplitude of Gaussian Optional inputs: - `separable` -> `:separable` (boolean): Generate separable Gaussian - `integer` -> `:integer` (boolean): Generate integer Gaussian - `precision` -> `:precision` (keyword, see `ol.vips.enums/precision`): Generate with this precision Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2801-L2821) --- ## mapim ```clojure (mapim input index) (mapim input index opts) ``` resample with a map image Operation name: `mapim`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `index` -> `:index` (image): Index pixels with this Optional inputs: - `background` -> `:background` (seqable of number): Background value - `premultiplied` -> `:premultiplied` (boolean): Images have premultiplied alpha - `extend` -> `:extend` (keyword, see `ol.vips.enums/extend`): How to generate the extra pixels Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2823-L2843) --- ## maplut ```clojure (maplut input lut) (maplut input lut opts) ``` map an image though a lut Operation name: `maplut`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `lut` -> `:lut` (image): Look-up table image Optional inputs: - `band` -> `:band` (integer): Apply one-band lut to this band of in Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2845-L2863) --- ## mask-butterworth ```clojure (mask-butterworth width height order frequency-cutoff amplitude-cutoff) (mask-butterworth width height order frequency-cutoff amplitude-cutoff opts) ``` make a butterworth filter Operation name: `mask_butterworth`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `order` -> `:order` (float): Filter order - `frequency-cutoff` -> `:frequency-cutoff` (float): Frequency cutoff - `amplitude-cutoff` -> `:amplitude-cutoff` (float): Amplitude cutoff Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2865-L2889) --- ## mask-butterworth-band ```clojure (mask-butterworth-band width height order frequency-cutoff-x frequency-cutoff-y radius amplitude-cutoff) (mask-butterworth-band width height order frequency-cutoff-x frequency-cutoff-y radius amplitude-cutoff opts) ``` make a butterworth_band filter Operation name: `mask_butterworth_band`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `order` -> `:order` (float): Filter order - `frequency-cutoff-x` -> `:frequency-cutoff-x` (float): Frequency cutoff x - `frequency-cutoff-y` -> `:frequency-cutoff-y` (float): Frequency cutoff y - `radius` -> `:radius` (float): Radius of circle - `amplitude-cutoff` -> `:amplitude-cutoff` (float): Amplitude cutoff Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2891-L2917) --- ## mask-butterworth-ring ```clojure (mask-butterworth-ring width height order frequency-cutoff amplitude-cutoff ringwidth) (mask-butterworth-ring width height order frequency-cutoff amplitude-cutoff ringwidth opts) ``` make a butterworth ring filter Operation name: `mask_butterworth_ring`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `order` -> `:order` (float): Filter order - `frequency-cutoff` -> `:frequency-cutoff` (float): Frequency cutoff - `amplitude-cutoff` -> `:amplitude-cutoff` (float): Amplitude cutoff - `ringwidth` -> `:ringwidth` (float): Ringwidth Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2919-L2944) --- ## mask-fractal ```clojure (mask-fractal width height fractal-dimension) (mask-fractal width height fractal-dimension opts) ``` make fractal filter Operation name: `mask_fractal`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `fractal-dimension` -> `:fractal-dimension` (float): Fractal dimension Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2946-L2968) --- ## mask-gaussian ```clojure (mask-gaussian width height frequency-cutoff amplitude-cutoff) (mask-gaussian width height frequency-cutoff amplitude-cutoff opts) ``` make a gaussian filter Operation name: `mask_gaussian`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `frequency-cutoff` -> `:frequency-cutoff` (float): Frequency cutoff - `amplitude-cutoff` -> `:amplitude-cutoff` (float): Amplitude cutoff Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2970-L2993) --- ## mask-gaussian-band ```clojure (mask-gaussian-band width height frequency-cutoff-x frequency-cutoff-y radius amplitude-cutoff) (mask-gaussian-band width height frequency-cutoff-x frequency-cutoff-y radius amplitude-cutoff opts) ``` make a gaussian filter Operation name: `mask_gaussian_band`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `frequency-cutoff-x` -> `:frequency-cutoff-x` (float): Frequency cutoff x - `frequency-cutoff-y` -> `:frequency-cutoff-y` (float): Frequency cutoff y - `radius` -> `:radius` (float): Radius of circle - `amplitude-cutoff` -> `:amplitude-cutoff` (float): Amplitude cutoff Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L2995-L3020) --- ## mask-gaussian-ring ```clojure (mask-gaussian-ring width height frequency-cutoff amplitude-cutoff ringwidth) (mask-gaussian-ring width height frequency-cutoff amplitude-cutoff ringwidth opts) ``` make a gaussian ring filter Operation name: `mask_gaussian_ring`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `frequency-cutoff` -> `:frequency-cutoff` (float): Frequency cutoff - `amplitude-cutoff` -> `:amplitude-cutoff` (float): Amplitude cutoff - `ringwidth` -> `:ringwidth` (float): Ringwidth Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3022-L3046) --- ## mask-ideal ```clojure (mask-ideal width height frequency-cutoff) (mask-ideal width height frequency-cutoff opts) ``` make an ideal filter Operation name: `mask_ideal`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `frequency-cutoff` -> `:frequency-cutoff` (float): Frequency cutoff Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3048-L3070) --- ## mask-ideal-band ```clojure (mask-ideal-band width height frequency-cutoff-x frequency-cutoff-y radius) (mask-ideal-band width height frequency-cutoff-x frequency-cutoff-y radius opts) ``` make an ideal band filter Operation name: `mask_ideal_band`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `frequency-cutoff-x` -> `:frequency-cutoff-x` (float): Frequency cutoff x - `frequency-cutoff-y` -> `:frequency-cutoff-y` (float): Frequency cutoff y - `radius` -> `:radius` (float): Radius of circle Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3072-L3096) --- ## mask-ideal-ring ```clojure (mask-ideal-ring width height frequency-cutoff ringwidth) (mask-ideal-ring width height frequency-cutoff ringwidth opts) ``` make an ideal ring filter Operation name: `mask_ideal_ring`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `frequency-cutoff` -> `:frequency-cutoff` (float): Frequency cutoff - `ringwidth` -> `:ringwidth` (float): Ringwidth Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `nodc` -> `:nodc` (boolean): Remove DC component - `reject` -> `:reject` (boolean): Invert the sense of the filter - `optical` -> `:optical` (boolean): Rotate quadrants to optical space Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3098-L3121) --- ## match ```clojure (match ref sec xr1 yr1 xs1 ys1 xr2 yr2 xs2 ys2) (match ref sec xr1 yr1 xs1 ys1 xr2 yr2 xs2 ys2 opts) ``` first-order match of two images Operation name: `match`. Returns an image handle. Required inputs: - `ref` -> `:ref` (image): Reference image - `sec` -> `:sec` (image): Secondary image - `xr1` -> `:xr1` (integer): Position of first reference tie-point - `yr1` -> `:yr1` (integer): Position of first reference tie-point - `xs1` -> `:xs1` (integer): Position of first secondary tie-point - `ys1` -> `:ys1` (integer): Position of first secondary tie-point - `xr2` -> `:xr2` (integer): Position of second reference tie-point - `yr2` -> `:yr2` (integer): Position of second reference tie-point - `xs2` -> `:xs2` (integer): Position of second secondary tie-point - `ys2` -> `:ys2` (integer): Position of second secondary tie-point Optional inputs: - `hwindow` -> `:hwindow` (integer): Half window size - `harea` -> `:harea` (integer): Half area size - `search` -> `:search` (boolean): Search to improve tie-points Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3123-L3151) --- ## math ```clojure (math input math) ``` apply a math operation to an image Operation name: `math`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `math` -> `:math` (keyword, see `ol.vips.enums/operation-math`): Math to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3153-L3170) --- ## math2 ```clojure (math2 left right math2) ``` binary math operations Operation name: `math2`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument - `math2` -> `:math2` (keyword, see `ol.vips.enums/operation-math2`): Math to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3172-L3190) --- ## math2-const ```clojure (math2-const input math2 c) ``` binary math operations with a constant Operation name: `math2_const`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `math2` -> `:math2` (keyword, see `ol.vips.enums/operation-math2`): Math to perform - `c` -> `:c` (seqable of number): Array of constants Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3192-L3210) --- ## matrixinvert ```clojure (matrixinvert input) ``` invert a matrix Operation name: `matrixinvert`. Returns an image handle. Required inputs: - `input` -> `:in` (image): An square matrix Optional inputs: - none Outputs: - `out` -> `:out` (image): Output matrix [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3212-L3228) --- ## matrixload ```clojure (matrixload filename) (matrixload filename opts) ``` load matrix Operation name: `matrixload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3230-L3254) --- ## matrixmultiply ```clojure (matrixmultiply left right) ``` multiply two matrices Operation name: `matrixmultiply`. Returns an image handle. Required inputs: - `left` -> `:left` (image): First matrix to multiply - `right` -> `:right` (image): Second matrix to multiply Optional inputs: - none Outputs: - `out` -> `:out` (image): Output matrix [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3256-L3273) --- ## matrixprint ```clojure (matrixprint input) (matrixprint input opts) ``` print matrix Operation name: `matrixprint`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save Optional inputs: - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3275-L3296) --- ## matrixsave ```clojure (matrixsave input filename) (matrixsave input filename opts) ``` save image to matrix Operation name: `matrixsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3298-L3320) --- ## maxpair ```clojure (maxpair left right) ``` maximum of a pair of images Operation name: `maxpair`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3322-L3339) --- ## measure ```clojure (measure input h v) (measure input h v opts) ``` measure a set of patches on a color chart Operation name: `measure`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Image to measure - `h` -> `:h` (integer): Number of patches across chart - `v` -> `:v` (integer): Number of patches down chart Optional inputs: - `left` -> `:left` (integer): Left edge of extract area - `top` -> `:top` (integer): Top edge of extract area - `width` -> `:width` (integer): Width of extract area - `height` -> `:height` (integer): Height of extract area Outputs: - `out` -> `:out` (image): Output array of statistics [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3341-L3363) --- ## merge ```clojure (merge ref sec direction dx dy) (merge ref sec direction dx dy opts) ``` merge two images Operation name: `merge`. Returns an image handle. Required inputs: - `ref` -> `:ref` (image): Reference image - `sec` -> `:sec` (image): Secondary image - `direction` -> `:direction` (keyword, see `ol.vips.enums/direction`): Horizontal or vertical merge - `dx` -> `:dx` (integer): Horizontal displacement from sec to ref - `dy` -> `:dy` (integer): Vertical displacement from sec to ref Optional inputs: - `mblend` -> `:mblend` (integer): Maximum blend size Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3365-L3386) --- ## minpair ```clojure (minpair left right) ``` minimum of a pair of images Operation name: `minpair`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3388-L3405) --- ## morph ```clojure (morph input mask morph) ``` morphology operation Operation name: `morph`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `mask` -> `:mask` (image): Input matrix image - `morph` -> `:morph` (keyword, see `ol.vips.enums/operation-morphology`): Morphological operation to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3407-L3425) --- ## mosaic ```clojure (mosaic ref sec direction xref yref xsec ysec) (mosaic ref sec direction xref yref xsec ysec opts) ``` mosaic two images Operation name: `mosaic`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `ref` -> `:ref` (image): Reference image - `sec` -> `:sec` (image): Secondary image - `direction` -> `:direction` (keyword, see `ol.vips.enums/direction`): Horizontal or vertical mosaic - `xref` -> `:xref` (integer): Position of reference tie-point - `yref` -> `:yref` (integer): Position of reference tie-point - `xsec` -> `:xsec` (integer): Position of secondary tie-point - `ysec` -> `:ysec` (integer): Position of secondary tie-point Optional inputs: - `hwindow` -> `:hwindow` (integer): Half window size - `harea` -> `:harea` (integer): Half area size - `mblend` -> `:mblend` (integer): Maximum blend size - `bandno` -> `:bandno` (integer): Band to search for features on Outputs: - `out` -> `:out` (image): Output image - `dx0` -> `:dx0` (integer): Detected integer offset - `dy0` -> `:dy0` (integer): Detected integer offset - `scale1` -> `:scale1` (float): Detected scale - `angle1` -> `:angle1` (float): Detected rotation - `dy1` -> `:dy1` (float): Detected first-order displacement - `dx1` -> `:dx1` (float): Detected first-order displacement [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3427-L3459) --- ## mosaic1 ```clojure (mosaic1 ref sec direction xr1 yr1 xs1 ys1 xr2 yr2 xs2 ys2) (mosaic1 ref sec direction xr1 yr1 xs1 ys1 xr2 yr2 xs2 ys2 opts) ``` first-order mosaic of two images Operation name: `mosaic1`. Returns an image handle. Required inputs: - `ref` -> `:ref` (image): Reference image - `sec` -> `:sec` (image): Secondary image - `direction` -> `:direction` (keyword, see `ol.vips.enums/direction`): Horizontal or vertical mosaic - `xr1` -> `:xr1` (integer): Position of first reference tie-point - `yr1` -> `:yr1` (integer): Position of first reference tie-point - `xs1` -> `:xs1` (integer): Position of first secondary tie-point - `ys1` -> `:ys1` (integer): Position of first secondary tie-point - `xr2` -> `:xr2` (integer): Position of second reference tie-point - `yr2` -> `:yr2` (integer): Position of second reference tie-point - `xs2` -> `:xs2` (integer): Position of second secondary tie-point - `ys2` -> `:ys2` (integer): Position of second secondary tie-point Optional inputs: - `hwindow` -> `:hwindow` (integer): Half window size - `harea` -> `:harea` (integer): Half area size - `search` -> `:search` (boolean): Search to improve tie-points - `mblend` -> `:mblend` (integer): Maximum blend size - `bandno` -> `:bandno` (integer): Band to search for features on Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3461-L3492) --- ## msb ```clojure (msb input) (msb input opts) ``` pick most-significant byte from an image Operation name: `msb`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `band` -> `:band` (integer): Band to msb Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3494-L3511) --- ## multiply ```clojure (multiply left right) ``` multiply two images Operation name: `multiply`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3513-L3530) --- ## percent ```clojure (percent input percent) ``` find threshold for percent of pixels Operation name: `percent`. Returns a result map. Required inputs: - `input` -> `:in` (image): Input image - `percent` -> `:percent` (float): Percent of pixels Optional inputs: - none Outputs: - `threshold` -> `:threshold` (integer): Threshold above which lie percent of pixels [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3532-L3549) --- ## perlin ```clojure (perlin width height) (perlin width height opts) ``` make a perlin noise image Operation name: `perlin`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `cell-size` -> `:cell-size` (integer): Size of Perlin cells - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `seed` -> `:seed` (integer): Random number seed Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3551-L3571) --- ## phasecor ```clojure (phasecor input in2) ``` calculate phase correlation Operation name: `phasecor`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `in2` -> `:in2` (image): Second input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3573-L3590) --- ## pngload ```clojure (pngload filename) (pngload filename opts) ``` load png from file Operation name: `pngload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `unlimited` -> `:unlimited` (boolean): Remove all denial of service limits - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3592-L3617) --- ## pngsave ```clojure (pngsave input filename) (pngsave input filename opts) ``` save image to file as PNG Operation name: `pngsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `compression` -> `:compression` (integer): Compression factor - `interlace` -> `:interlace` (boolean): Interlace image - `filter` -> `:filter` (integer flags): libspng row filter flag(s) - `palette` -> `:palette` (boolean): Quantise to 8bpp palette - `colours` -> `:colours` (integer): Max number of palette colours - `q` -> `:Q` (integer): Quantisation quality - `dither` -> `:dither` (float): Amount of dithering - `bitdepth` -> `:bitdepth` (integer): Write as a 1, 2, 4, 8 or 16 bit image - `effort` -> `:effort` (integer): Quantisation CPU effort - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3619-L3650) --- ## premultiply ```clojure (premultiply input) (premultiply input opts) ``` premultiply image alpha Operation name: `premultiply`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `max-alpha` -> `:max-alpha` (float): Maximum value of alpha channel Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3652-L3669) --- ## prewitt ```clojure (prewitt input) ``` Prewitt edge detector Operation name: `prewitt`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3671-L3687) --- ## profile ```clojure (profile input) ``` find image profiles Operation name: `profile`. Returns a result map. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `columns` -> `:columns` (image): First non-zero pixel in column - `rows` -> `:rows` (image): First non-zero pixel in row [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3689-L3706) --- ## project ```clojure (project input) ``` find image projections Operation name: `project`. Returns a result map. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `columns` -> `:columns` (image): Sums of columns - `rows` -> `:rows` (image): Sums of rows [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3708-L3725) --- ## quadratic ```clojure (quadratic input coeff) ``` resample an image with a quadratic transform Operation name: `quadratic`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `coeff` -> `:coeff` (image): Coefficient matrix Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3727-L3744) --- ## rad2float ```clojure (rad2float input) ``` unpack Radiance coding to float RGB Operation name: `rad2float`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3746-L3762) --- ## rank ```clojure (rank input width height index) ``` rank filter Operation name: `rank`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `width` -> `:width` (integer): Window width in pixels - `height` -> `:height` (integer): Window height in pixels - `index` -> `:index` (integer): Select pixel at index Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3764-L3783) --- ## rawload ```clojure (rawload filename width height bands) (rawload filename width height bands opts) ``` load raw data from a file Operation name: `rawload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `bands` -> `:bands` (integer): Number of bands in image Optional inputs: - `offset` -> `:offset` (integer): Offset in bytes from start of file - `format` -> `:format` (keyword, see `ol.vips.enums/band-format`): Pixel format in image - `interpretation` -> `:interpretation` (keyword, see `ol.vips.enums/interpretation`): Pixel interpretation - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3785-L3815) --- ## rawsave ```clojure (rawsave input filename) (rawsave input filename opts) ``` save image to raw file Operation name: `rawsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3817-L3839) --- ## recomb ```clojure (recomb input m) ``` linear recombination with matrix Operation name: `recomb`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `m` -> `:m` (image): Matrix of coefficients Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3841-L3858) --- ## reduce ```clojure (reduce input xshrink hshrink yshrink vshrink) (reduce input xshrink hshrink yshrink vshrink opts) ``` reduce an image Operation name: `reduce`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `xshrink` -> `:xshrink` (float): Horizontal shrink factor - `hshrink` -> `:hshrink` (float): Horizontal shrink factor - `yshrink` -> `:yshrink` (float): Vertical shrink factor - `vshrink` -> `:vshrink` (float): Vertical shrink factor Optional inputs: - `kernel` -> `:kernel` (keyword, see `ol.vips.enums/kernel`): Resampling kernel - `gap` -> `:gap` (float): Reducing gap - `centre` -> `:centre` (boolean): Use centre sampling convention Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3860-L3883) --- ## reduceh ```clojure (reduceh input xshrink hshrink) (reduceh input xshrink hshrink opts) ``` shrink an image horizontally Operation name: `reduceh`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `xshrink` -> `:xshrink` (float): Horizontal shrink factor - `hshrink` -> `:hshrink` (float): Horizontal shrink factor Optional inputs: - `kernel` -> `:kernel` (keyword, see `ol.vips.enums/kernel`): Resampling kernel - `gap` -> `:gap` (float): Reducing gap - `centre` -> `:centre` (boolean): Use centre sampling convention Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3885-L3906) --- ## reducev ```clojure (reducev input yshrink vshrink) (reducev input yshrink vshrink opts) ``` shrink an image vertically Operation name: `reducev`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `yshrink` -> `:yshrink` (float): Vertical shrink factor - `vshrink` -> `:vshrink` (float): Vertical shrink factor Optional inputs: - `kernel` -> `:kernel` (keyword, see `ol.vips.enums/kernel`): Resampling kernel - `gap` -> `:gap` (float): Reducing gap - `centre` -> `:centre` (boolean): Use centre sampling convention Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3908-L3929) --- ## relational ```clojure (relational left right relational) ``` relational operation on two images Operation name: `relational`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument - `relational` -> `:relational` (keyword, see `ol.vips.enums/operation-relational`): Relational to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3931-L3949) --- ## relational-const ```clojure (relational-const input relational c) ``` relational operations against a constant Operation name: `relational_const`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `relational` -> `:relational` (keyword, see `ol.vips.enums/operation-relational`): Relational to perform - `c` -> `:c` (seqable of number): Array of constants Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3951-L3969) --- ## remainder ```clojure (remainder left right) ``` remainder after integer division of two images Operation name: `remainder`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3971-L3988) --- ## remainder-const ```clojure (remainder-const input c) ``` remainder after integer division of an image and a constant Operation name: `remainder_const`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `c` -> `:c` (seqable of number): Array of constants Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L3990-L4007) --- ## remosaic ```clojure (remosaic input old-str new-str) ``` rebuild an mosaiced image Operation name: `remosaic`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `old-str` -> `:old-str` (string): Search for this string - `new-str` -> `:new-str` (string): And swap for this string Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4009-L4027) --- ## replicate ```clojure (replicate input across down) ``` replicate an image Operation name: `replicate`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `across` -> `:across` (integer): Repeat this many times horizontally - `down` -> `:down` (integer): Repeat this many times vertically Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4029-L4047) --- ## resize ```clojure (resize input scale) (resize input scale opts) ``` resize an image Operation name: `resize`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `scale` -> `:scale` (float): Scale image by this factor Optional inputs: - `kernel` -> `:kernel` (keyword, see `ol.vips.enums/kernel`): Resampling kernel - `gap` -> `:gap` (float): Reducing gap - `centre` -> `:centre` (boolean): Use centre sampling convention - `vscale` -> `:vscale` (float): Vertical scale image by this factor - `idx` -> `:idx` (float): Horizontal input displacement - `idy` -> `:idy` (float): Vertical input displacement Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4049-L4072) --- ## rot ```clojure (rot input angle) ``` rotate an image Operation name: `rot`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `angle` -> `:angle` (keyword, see `ol.vips.enums/angle`): Angle to rotate image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4074-L4091) --- ## rot45 ```clojure (rot45 input) (rot45 input opts) ``` rotate an image Operation name: `rot45`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `angle` -> `:angle` (keyword, see `ol.vips.enums/angle45`): Angle to rotate image Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4093-L4110) --- ## rotate ```clojure (rotate input angle) (rotate input angle opts) ``` rotate an image by a number of degrees Operation name: `rotate`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `angle` -> `:angle` (float): Rotate clockwise by this many degrees Optional inputs: - `background` -> `:background` (seqable of number): Background value - `odx` -> `:odx` (float): Horizontal output displacement - `ody` -> `:ody` (float): Vertical output displacement - `idx` -> `:idx` (float): Horizontal input displacement - `idy` -> `:idy` (float): Vertical input displacement Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4112-L4134) --- ## round ```clojure (round input round) ``` perform a round function on an image Operation name: `round`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `round` -> `:round` (keyword, see `ol.vips.enums/operation-round`): Rounding operation to perform Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4136-L4153) --- ## s-rgb2-hsv ```clojure (s-rgb2-hsv input) ``` transform sRGB to HSV Operation name: `sRGB2HSV`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4155-L4171) --- ## s-rgb2sc-rgb ```clojure (s-rgb2sc-rgb input) ``` convert an sRGB image to scRGB Operation name: `sRGB2scRGB`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4173-L4189) --- ## sc-rgb2-bw ```clojure (sc-rgb2-bw input) (sc-rgb2-bw input opts) ``` convert scRGB to BW Operation name: `scRGB2BW`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `depth` -> `:depth` (integer): Output device space depth in bits Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4191-L4208) --- ## sc-rgb2-xyz ```clojure (sc-rgb2-xyz input) ``` transform scRGB to XYZ Operation name: `scRGB2XYZ`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4210-L4226) --- ## sc-rgb2s-rgb ```clojure (sc-rgb2s-rgb input) (sc-rgb2s-rgb input opts) ``` convert scRGB to sRGB Operation name: `scRGB2sRGB`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `depth` -> `:depth` (integer): Output device space depth in bits Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4228-L4245) --- ## scale ```clojure (scale input) (scale input opts) ``` scale an image to uchar Operation name: `scale`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `exp` -> `:exp` (float): Exponent for log scale - `log` -> `:log` (boolean): Log scale Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4247-L4265) --- ## scharr ```clojure (scharr input) ``` Scharr edge detector Operation name: `scharr`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4267-L4283) --- ## sdf ```clojure (sdf width height shape) (sdf width height shape opts) ``` create an SDF image Operation name: `sdf`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels - `shape` -> `:shape` (keyword, see `ol.vips.enums/sdf-shape`): SDF shape to create Optional inputs: - `r` -> `:r` (float): Radius - `a` -> `:a` (seqable of number): Point a - `b` -> `:b` (seqable of number): Point b - `corners` -> `:corners` (seqable of number): Corner radii Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4285-L4307) --- ## sequential ```clojure (sequential input) (sequential input opts) ``` check sequential access Operation name: `sequential`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `trace` -> `:trace` (boolean): Trace pixel requests - `tile-height` -> `:tile-height` (integer): Tile height in pixels - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Expected access pattern Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4309-L4328) --- ## sharpen ```clojure (sharpen input) (sharpen input opts) ``` unsharp masking for print Operation name: `sharpen`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `radius` -> `:radius` (integer): Radius of Gaussian - `sigma` -> `:sigma` (float): Sigma of Gaussian - `x1` -> `:x1` (float): Flat/jaggy threshold - `y2` -> `:y2` (float): Maximum brightening - `y3` -> `:y3` (float): Maximum darkening - `m1` -> `:m1` (float): Slope for flat areas - `m2` -> `:m2` (float): Slope for jaggy areas Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4330-L4353) --- ## shrink ```clojure (shrink input xshrink hshrink yshrink vshrink) (shrink input xshrink hshrink yshrink vshrink opts) ``` shrink an image Operation name: `shrink`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `xshrink` -> `:xshrink` (float): Horizontal shrink factor - `hshrink` -> `:hshrink` (float): Horizontal shrink factor - `yshrink` -> `:yshrink` (float): Vertical shrink factor - `vshrink` -> `:vshrink` (float): Vertical shrink factor Optional inputs: - `ceil` -> `:ceil` (boolean): Round-up output dimensions Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4355-L4376) --- ## shrinkh ```clojure (shrinkh input xshrink hshrink) (shrinkh input xshrink hshrink opts) ``` shrink an image horizontally Operation name: `shrinkh`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `xshrink` -> `:xshrink` (integer): Horizontal shrink factor - `hshrink` -> `:hshrink` (integer): Horizontal shrink factor Optional inputs: - `ceil` -> `:ceil` (boolean): Round-up output dimensions Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4378-L4397) --- ## shrinkv ```clojure (shrinkv input yshrink vshrink) (shrinkv input yshrink vshrink opts) ``` shrink an image vertically Operation name: `shrinkv`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `yshrink` -> `:yshrink` (integer): Vertical shrink factor - `vshrink` -> `:vshrink` (integer): Vertical shrink factor Optional inputs: - `ceil` -> `:ceil` (boolean): Round-up output dimensions Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4399-L4418) --- ## sign ```clojure (sign input) ``` unit vector of pixel Operation name: `sign`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4420-L4436) --- ## similarity ```clojure (similarity input) (similarity input opts) ``` similarity transform of an image Operation name: `similarity`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument Optional inputs: - `scale` -> `:scale` (float): Scale by this factor - `angle` -> `:angle` (float): Rotate clockwise by this many degrees - `background` -> `:background` (seqable of number): Background value - `odx` -> `:odx` (float): Horizontal output displacement - `ody` -> `:ody` (float): Vertical output displacement - `idx` -> `:idx` (float): Horizontal input displacement - `idy` -> `:idy` (float): Vertical input displacement Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4438-L4461) --- ## sines ```clojure (sines width height) (sines width height opts) ``` make a 2D sine wave Operation name: `sines`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image - `hfreq` -> `:hfreq` (float): Horizontal spatial frequency - `vfreq` -> `:vfreq` (float): Vertical spatial frequency Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4463-L4483) --- ## smartcrop ```clojure (smartcrop input width height) (smartcrop input width height opts) ``` extract an area from an image Operation name: `smartcrop`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `input` -> `:input` (image): Input image - `width` -> `:width` (integer): Width of extract area - `height` -> `:height` (integer): Height of extract area Optional inputs: - `interesting` -> `:interesting` (keyword, see `ol.vips.enums/interesting`): How to measure interestingness - `premultiplied` -> `:premultiplied` (boolean): Input image already has premultiplied alpha Outputs: - `out` -> `:out` (image): Output image - `attention-x` -> `:attention-x` (integer): Horizontal position of attention centre - `attention-y` -> `:attention-y` (integer): Vertical position of attention centre [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4485-L4507) --- ## sobel ```clojure (sobel input) ``` Sobel edge detector Operation name: `sobel`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4509-L4525) --- ## spcor ```clojure (spcor input ref) ``` spatial correlation Operation name: `spcor`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `ref` -> `:ref` (image): Input reference image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4527-L4544) --- ## spectrum ```clojure (spectrum input) ``` make displayable power spectrum Operation name: `spectrum`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4546-L4562) --- ## stats ```clojure (stats input) ``` find many image stats Operation name: `stats`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output array of statistics [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4564-L4580) --- ## stdif ```clojure (stdif input width height) (stdif input width height opts) ``` statistical difference Operation name: `stdif`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image - `width` -> `:width` (integer): Window width in pixels - `height` -> `:height` (integer): Window height in pixels Optional inputs: - `s0` -> `:s0` (float): New deviation - `b` -> `:b` (float): Weight of new deviation - `m0` -> `:m0` (float): New mean - `a` -> `:a` (float): Weight of new mean Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4582-L4604) --- ## subsample ```clojure (subsample input xfac yfac) (subsample input xfac yfac opts) ``` subsample an image Operation name: `subsample`. Returns an image handle. Required inputs: - `input` -> `:input` (image): Input image - `xfac` -> `:xfac` (integer): Horizontal subsample factor - `yfac` -> `:yfac` (integer): Vertical subsample factor Optional inputs: - `point` -> `:point` (boolean): Point sample Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4606-L4625) --- ## subtract ```clojure (subtract left right) ``` subtract two images Operation name: `subtract`. Returns an image handle. Required inputs: - `left` -> `:left` (image): Left-hand image argument - `right` -> `:right` (image): Right-hand image argument Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4627-L4644) --- ## sum ```clojure (sum input) ``` sum an array of images Operation name: `sum`. Returns an image handle. Required inputs: - `input` -> `:in` (seqable of image): Array of input images Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4646-L4662) --- ## svgload ```clojure (svgload filename) (svgload filename opts) ``` load SVG with rsvg Operation name: `svgload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `dpi` -> `:dpi` (float): Render at this DPI - `scale` -> `:scale` (float): Scale output by this factor - `unlimited` -> `:unlimited` (boolean): Allow SVG of any size - `stylesheet` -> `:stylesheet` (string): Custom CSS - `high-bitdepth` -> `:high-bitdepth` (boolean): Enable scRGB 128-bit output (32-bit per channel) - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4664-L4693) --- ## switch ```clojure (switch tests) ``` find the index of the first non-zero pixel in tests Operation name: `switch`. Returns an image handle. Required inputs: - `tests` -> `:tests` (seqable of image): Table of images to test Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4695-L4711) --- ## system ```clojure (system cmd-format) (system cmd-format opts) ``` run an external command Operation name: `system`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `cmd-format` -> `:cmd-format` (string): Command to run Optional inputs: - `input` -> `:in` (seqable of image): Array of input images - `out-format` -> `:out-format` (string): Format for output filename - `in-format` -> `:in-format` (string): Format for input filename Outputs: - `out` -> `:out` (image): Output image - `log` -> `:log` (string): Command log [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4713-L4733) --- ## text ```clojure (text text) (text text opts) ``` make a text image Operation name: `text`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `text` -> `:text` (string): Text to render Optional inputs: - `font` -> `:font` (string): Font to render with - `width` -> `:width` (integer): Maximum image width in pixels - `height` -> `:height` (integer): Maximum image height in pixels - `align` -> `:align` (keyword, see `ol.vips.enums/align`): Align on the low, centre or high edge - `justify` -> `:justify` (boolean): Justify lines - `dpi` -> `:dpi` (integer): DPI to render at - `spacing` -> `:spacing` (integer): Line spacing - `fontfile` -> `:fontfile` (string): Load this font file - `rgba` -> `:rgba` (boolean): Enable RGBA output - `wrap` -> `:wrap` (keyword, see `ol.vips.enums/text-wrap`): Wrap lines on word or character boundaries Outputs: - `out` -> `:out` (image): Output image - `autofit-dpi` -> `:autofit-dpi` (integer): DPI selected by autofit [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4735-L4762) --- ## thumbnail ```clojure (thumbnail filename width) (thumbnail filename width opts) ``` generate thumbnail from file Operation name: `thumbnail`. Returns an image handle. Required inputs: - `filename` -> `:filename` (string): Filename to read from - `width` -> `:width` (integer): Size to this width Optional inputs: - `height` -> `:height` (integer): Size to this height - `size` -> `:size` (keyword, see `ol.vips.enums/size`): Only upsize, only downsize, or both - `no-rotate` -> `:no-rotate` (boolean): Don’t use orientation tags to rotate image upright - `crop` -> `:crop` (keyword, see `ol.vips.enums/interesting`): Reduce to fill target rectangle, then crop - `linear` -> `:linear` (boolean): Reduce in linear light - `input-profile` -> `:input-profile` (string): Fallback input profile - `output-profile` -> `:output-profile` (string): Fallback output profile - `intent` -> `:intent` (keyword, see `ol.vips.enums/intent`): Rendering intent - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `auto-rotate` -> `:auto-rotate` (boolean): Use orientation tags to rotate image upright - `import-profile` -> `:import-profile` (string): Fallback import profile - `export-profile` -> `:export-profile` (string): Fallback export profile Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4764-L4793) --- ## thumbnail-image ```clojure (thumbnail-image input width) (thumbnail-image input width opts) ``` generate thumbnail from image Operation name: `thumbnail_image`. Avoid for routine thumbnailing. Prefer `thumbnail` when you can start from a filename.For already-loaded images, use normal image operations such as `resize` unless you specifically need this escape hatch. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image argument - `width` -> `:width` (integer): Size to this width Optional inputs: - `height` -> `:height` (integer): Size to this height - `size` -> `:size` (keyword, see `ol.vips.enums/size`): Only upsize, only downsize, or both - `no-rotate` -> `:no-rotate` (boolean): Don’t use orientation tags to rotate image upright - `crop` -> `:crop` (keyword, see `ol.vips.enums/interesting`): Reduce to fill target rectangle, then crop - `linear` -> `:linear` (boolean): Reduce in linear light - `input-profile` -> `:input-profile` (string): Fallback input profile - `output-profile` -> `:output-profile` (string): Fallback output profile - `intent` -> `:intent` (keyword, see `ol.vips.enums/intent`): Rendering intent - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `auto-rotate` -> `:auto-rotate` (boolean): Use orientation tags to rotate image upright - `import-profile` -> `:import-profile` (string): Fallback import profile - `export-profile` -> `:export-profile` (string): Fallback export profile Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4795-L4826) --- ## tiffload ```clojure (tiffload filename) (tiffload filename opts) ``` load tiff from file Operation name: `tiffload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `page` -> `:page` (integer): First page to load - `n` -> `:n` (integer): Number of pages to load, -1 for all - `autorotate` -> `:autorotate` (boolean): Rotate image using orientation tag - `subifd` -> `:subifd` (integer): Subifd index - `unlimited` -> `:unlimited` (boolean): Remove all denial of service limits - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4828-L4857) --- ## tiffsave ```clojure (tiffsave input filename) (tiffsave input filename opts) ``` save image to tiff file Operation name: `tiffsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `compression` -> `:compression` (keyword, see `ol.vips.enums/foreign-tiff-compression`): Compression for this file - `q` -> `:Q` (integer): Q factor - `predictor` -> `:predictor` (keyword, see `ol.vips.enums/foreign-tiff-predictor`): Compression prediction - `tile` -> `:tile` (boolean): Write a tiled tiff - `tile-width` -> `:tile-width` (integer): Tile width in pixels - `tile-height` -> `:tile-height` (integer): Tile height in pixels - `pyramid` -> `:pyramid` (boolean): Write a pyramidal tiff - `miniswhite` -> `:miniswhite` (boolean): Use 0 for white in 1-bit images - `bitdepth` -> `:bitdepth` (integer): Write as a 1, 2, 4 or 8 bit image - `resunit` -> `:resunit` (keyword, see `ol.vips.enums/foreign-tiff-resunit`): Resolution unit - `xres` -> `:xres` (float): Horizontal resolution in pixels/mm - `yres` -> `:yres` (float): Vertical resolution in pixels/mm - `bigtiff` -> `:bigtiff` (boolean): Write a bigtiff image - `properties` -> `:properties` (boolean): Write a properties document to IMAGEDESCRIPTION - `region-shrink` -> `:region-shrink` (keyword, see `ol.vips.enums/region-shrink`): Method to shrink regions - `level` -> `:level` (integer): Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level - `lossless` -> `:lossless` (boolean): Enable WEBP lossless mode - `depth` -> `:depth` (keyword, see `ol.vips.enums/foreign-dz-depth`): Pyramid depth - `subifd` -> `:subifd` (boolean): Save pyr layers as sub-IFDs - `premultiply` -> `:premultiply` (boolean): Save with premultiplied alpha - `rgbjpeg` -> `:rgbjpeg` (boolean): Output RGB JPEG rather than YCbCr - `squash` -> `:squash` (boolean): Squash images down to 1 bit - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4859-L4903) --- ## tilecache ```clojure (tilecache input) (tilecache input opts) ``` cache an image as a set of tiles Operation name: `tilecache`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `tile-width` -> `:tile-width` (integer): Tile width in pixels - `tile-height` -> `:tile-height` (integer): Tile height in pixels - `max-tiles` -> `:max-tiles` (integer): Maximum number of tiles to cache - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Expected access pattern - `threaded` -> `:threaded` (boolean): Allow threaded access - `persistent` -> `:persistent` (boolean): Keep cache between evaluations Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4905-L4927) --- ## tonelut ```clojure (tonelut) (tonelut opts) ``` build a look-up table Operation name: `tonelut`. Returns an image handle. Required inputs: - none Optional inputs: - `in-max` -> `:in-max` (integer): Size of LUT to build - `out-max` -> `:out-max` (integer): Maximum value in output LUT - `lb` -> `:Lb` (float): Lowest value in output - `lw` -> `:Lw` (float): Highest value in output - `ps` -> `:Ps` (float): Position of shadow - `pm` -> `:Pm` (float): Position of mid-tones - `ph` -> `:Ph` (float): Position of highlights - `s` -> `:S` (float): Adjust shadows by this much - `m` -> `:M` (float): Adjust mid-tones by this much - `h` -> `:H` (float): Adjust highlights by this much Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4929-L4955) --- ## transpose3d ```clojure (transpose3d input) (transpose3d input opts) ``` transpose3d an image Operation name: `transpose3d`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `page-height` -> `:page-height` (integer): Height of each input page Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4957-L4974) --- ## unpremultiply ```clojure (unpremultiply input) (unpremultiply input opts) ``` unpremultiply image alpha Operation name: `unpremultiply`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `max-alpha` -> `:max-alpha` (float): Maximum value of alpha channel - `alpha-band` -> `:alpha-band` (integer): Unpremultiply with this alpha Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4976-L4994) --- ## vipsload ```clojure (vipsload filename) (vipsload filename opts) ``` load vips from file Operation name: `vipsload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L4996-L5020) --- ## vipssave ```clojure (vipssave input filename) (vipssave input filename opts) ``` save image to file in vips format Operation name: `vipssave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5022-L5044) --- ## webpload ```clojure (webpload filename) (webpload filename opts) ``` load webp from file Operation name: `webpload`. Returns a closeable result map. Pass it anywhere an image is expected, or inspect `:out` and the additional outputs directly. Required inputs: - `filename` -> `:filename` (string): Filename to load from Optional inputs: - `page` -> `:page` (integer): First page to load - `n` -> `:n` (integer): Number of pages to load, -1 for all - `scale` -> `:scale` (float): Factor to scale by - `shrink` -> `:shrink` (integer): Shrink factor on load - `memory` -> `:memory` (boolean): Force open via memory - `access` -> `:access` (keyword, see `ol.vips.enums/access`): Required access pattern for this file - `fail-on` -> `:fail-on` (keyword, see `ol.vips.enums/fail-on`): Error level to fail on - `revalidate` -> `:revalidate` (boolean): Don’t use a cached result for this operation - `sequential` -> `:sequential` (boolean): Sequential read only - `fail` -> `:fail` (boolean): Fail on first warning - `disc` -> `:disc` (boolean): Open to disc Outputs: - `out` -> `:out` (image): Output image - `flags` -> `:flags` (integer flags): Flags for this file [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5046-L5074) --- ## webpsave ```clojure (webpsave input filename) (webpsave input filename opts) ``` save as WebP Operation name: `webpsave`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save - `filename` -> `:filename` (string): Filename to save to Optional inputs: - `q` -> `:Q` (integer): Q factor - `lossless` -> `:lossless` (boolean): Enable lossless compression - `preset` -> `:preset` (keyword, see `ol.vips.enums/foreign-webp-preset`): Preset for lossy compression - `smart-subsample` -> `:smart-subsample` (boolean): Enable high quality chroma subsampling - `near-lossless` -> `:near-lossless` (boolean): Enable preprocessing in lossless mode (uses Q) - `alpha-q` -> `:alpha-q` (integer): Change alpha plane fidelity for lossy compression - `min-size` -> `:min-size` (boolean): Optimise for minimum size - `kmin` -> `:kmin` (integer): Minimum number of frames between key frames - `kmax` -> `:kmax` (integer): Maximum number of frames between key frames - `effort` -> `:effort` (integer): Level of CPU effort to reduce file size - `target-size` -> `:target-size` (integer): Desired target size in bytes - `reduction-effort` -> `:reduction-effort` (integer): Level of CPU effort to reduce file size - `mixed` -> `:mixed` (boolean): Allow mixed encoding (might reduce file size) - `smart-deblock` -> `:smart-deblock` (boolean): Enable auto-adjusting of the deblocking filter - `passes` -> `:passes` (integer): Number of entropy-analysis passes (in [1..10]) - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5076-L5113) --- ## webpsave-mime ```clojure (webpsave-mime input) (webpsave-mime input opts) ``` save image to webp mime Operation name: `webpsave_mime`. Returns a result map. Required inputs: - `input` -> `:in` (image): Image to save Optional inputs: - `q` -> `:Q` (integer): Q factor - `lossless` -> `:lossless` (boolean): Enable lossless compression - `preset` -> `:preset` (keyword, see `ol.vips.enums/foreign-webp-preset`): Preset for lossy compression - `smart-subsample` -> `:smart-subsample` (boolean): Enable high quality chroma subsampling - `near-lossless` -> `:near-lossless` (boolean): Enable preprocessing in lossless mode (uses Q) - `alpha-q` -> `:alpha-q` (integer): Change alpha plane fidelity for lossy compression - `min-size` -> `:min-size` (boolean): Optimise for minimum size - `kmin` -> `:kmin` (integer): Minimum number of frames between key frames - `kmax` -> `:kmax` (integer): Maximum number of frames between key frames - `effort` -> `:effort` (integer): Level of CPU effort to reduce file size - `target-size` -> `:target-size` (integer): Desired target size in bytes - `reduction-effort` -> `:reduction-effort` (integer): Level of CPU effort to reduce file size - `mixed` -> `:mixed` (boolean): Allow mixed encoding (might reduce file size) - `smart-deblock` -> `:smart-deblock` (boolean): Enable auto-adjusting of the deblocking filter - `passes` -> `:passes` (integer): Number of entropy-analysis passes (in [1..10]) - `keep` -> `:keep` (integer flags): Which metadata to retain - `background` -> `:background` (seqable of number): Background value - `page-height` -> `:page-height` (integer): Set page height for multipage save - `profile` -> `:profile` (string): Filename of ICC profile to embed - `strip` -> `:strip` (boolean): Strip all metadata from image Outputs: - none [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5115-L5151) --- ## worley ```clojure (worley width height) (worley width height opts) ``` make a worley noise image Operation name: `worley`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `cell-size` -> `:cell-size` (integer): Size of Worley cells - `seed` -> `:seed` (integer): Random number seed Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5153-L5172) --- ## wrap ```clojure (wrap input) (wrap input opts) ``` wrap image origin Operation name: `wrap`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `x` -> `:x` (integer): Left edge of input in output - `y` -> `:y` (integer): Top edge of input in output Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5174-L5192) --- ## xyz ```clojure (xyz width height) (xyz width height opts) ``` make an image where pixel values are coordinates Operation name: `xyz`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `csize` -> `:csize` (integer): Size of third dimension - `dsize` -> `:dsize` (integer): Size of fourth dimension - `esize` -> `:esize` (integer): Size of fifth dimension Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5194-L5214) --- ## xyz2-cmyk ```clojure (xyz2-cmyk input) ``` transform XYZ to CMYK Operation name: `XYZ2CMYK`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5216-L5232) --- ## xyz2-lab ```clojure (xyz2-lab input) (xyz2-lab input opts) ``` transform XYZ to Lab Operation name: `XYZ2Lab`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - `temp` -> `:temp` (seqable of number): Colour temperature Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5234-L5251) --- ## xyz2-yxy ```clojure (xyz2-yxy input) ``` transform XYZ to Yxy Operation name: `XYZ2Yxy`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5253-L5269) --- ## xyz2sc-rgb ```clojure (xyz2sc-rgb input) ``` transform XYZ to scRGB Operation name: `XYZ2scRGB`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5271-L5287) --- ## yxy2-xyz ```clojure (yxy2-xyz input) ``` transform Yxy to XYZ Operation name: `Yxy2XYZ`. Returns an image handle. Required inputs: - `input` -> `:in` (image): Input image Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5289-L5305) --- ## zone ```clojure (zone width height) (zone width height opts) ``` make a zone plate Operation name: `zone`. Returns an image handle. Required inputs: - `width` -> `:width` (integer): Image width in pixels - `height` -> `:height` (integer): Image height in pixels Optional inputs: - `uchar` -> `:uchar` (boolean): Output an unsigned char image Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5307-L5325) --- ## zoom ```clojure (zoom input xfac yfac) ``` zoom an image Operation name: `zoom`. Returns an image handle. Required inputs: - `input` -> `:input` (image): Input image - `xfac` -> `:xfac` (integer): Horizontal zoom factor - `yfac` -> `:yfac` (integer): Vertical zoom factor Optional inputs: - none Outputs: - `out` -> `:out` (image): Output image [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips/operations.clj#L5327-L5345) ## ol.vips # ol.vips Load, transform, and write images with libvips from Clojure. `ol.vips` exposes the runtime, I/O, metadata, and animated-image helpers that most applications use directly. Loaders such as [`from-file`](#from-file), [`from-buffer`](#from-buffer), and [`from-stream`](#from-stream) return closeable image handles. Operations return new image handles rather than mutating the original image, and sinks such as [`write-to-file`](#write-to-file), [`write-to-buffer`](#write-to-buffer), and [`write-to-stream`](#write-to-stream) trigger evaluation of the underlying libvips pipeline. Guides and API reference live at https://docs.outskirtslabs.com/ol.vips/next/. Use this namespace for: * runtime initialization and safety controls * file, buffer, and stream input/output * metadata and raw header access * animated-image metadata and frame-aware helpers * low-level generic operation calls with [`call`](#call) ## Related Namespaces * [`ol.vips.operations`](api/ol-vips-operations.adoc) for generated wrappers around the libvips operation surface * [`ol.vips.enums`](api/ol-vips-enums.adoc) for normalized enum keywords and enum value sets ## Example ```clojure (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} ``` ## init! ```clojure (init!) ``` Starts libvips and loads the `ol.vips` native bindings for this process. This function is idempotent. Most public API calls initialize libvips lazily, so call `init!` when you want eager startup or want to inspect the shared runtime state up front. On first initialization, `ol.vips` restores the secure default and blocks libvips operations marked as untrusted. See [`set-block-untrusted-operations!`](#set-block-untrusted-operations!). Returns the shared runtime state map, which should be considered an opaque handle and is not public API. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L47-L60) --- ## set-block-untrusted-operations! ```clojure (set-block-untrusted-operations! blocked?) ``` Set whether libvips operations tagged as untrusted are blocked at runtime. This is the direct wrapper around libvips `vips_block_untrusted_set`. Pass `blocked?` as `true` to restore the secure default and block operations libvips has marked as untrusted. Pass `false` to allow them to run. Returns the current runtime state map. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L62-L71) --- ## set-operation-block! ```clojure (set-operation-block! name blocked?) ``` Set the block state for a libvips operation class hierarchy. `name` should be a libvips operation class name such as `"VipsForeignLoad"` or `"VipsForeignLoadJpeg"`. libvips applies the block state at that point in the class hierarchy and to all descendants. This is the direct wrapper around libvips `vips_operation_block_set`. Pass `blocked?` as `true` to block that class hierarchy, or `false` to allow it. Example: ```clojure (v/set-operation-block! "VipsForeignLoad" true) (v/set-operation-block! "VipsForeignLoadJpeg" false) ``` That blocks all loaders except the JPEG loader family. Returns `{:name :blocked? }`. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L73-L95) --- ## operation-cache-settings ```clojure (operation-cache-settings) ``` Returns the current libvips operation cache settings. Because libvips operations are free of side effects, libvips can cache a previous call to the same operation with the same arguments and return the previous result again. Returns `{:max :size :max-mem :max-files }`. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L97-L106) --- ## set-operation-cache-max! ```clojure (set-operation-cache-max! max) ``` Sets the maximum number of operations libvips keeps in the operation cache. Reducing this limit may trim cached operations immediately. Returns the current cache settings map. See [`operation-cache-settings`](#operation-cache-settings). [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L108-L115) --- ## set-operation-cache-max-mem! ```clojure (set-operation-cache-max-mem! max-mem) ``` Sets the maximum amount of tracked memory, in bytes, libvips allows before it starts dropping cached operations. libvips only tracks memory it allocates itself. Memory allocated by external libraries is not included. Returns the current cache settings map. See [`operation-cache-settings`](#operation-cache-settings). [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L117-L126) --- ## set-operation-cache-max-files! ```clojure (set-operation-cache-max-files! max-files) ``` Sets the maximum number of tracked files libvips allows before it starts dropping cached operations. libvips only tracks file descriptors it opens itself. Descriptors opened by external libraries are not included. Returns the current cache settings map. See [`operation-cache-settings`](#operation-cache-settings). [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L128-L137) --- ## disable-operation-cache! ```clojure (disable-operation-cache!) ``` Disables the libvips operation cache by setting the maximum cached operation count to `0`. This is often useful for image-proxy style workloads that process many different images. Returns the current cache settings map. See [`set-operation-cache-max!`](#set-operation-cache-max!). [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L139-L148) --- ## tracked-resources ```clojure (tracked-resources) ``` Returns the current libvips tracked resource counters. libvips uses these counters to decide when to start dropping cached operations. The returned map has these keys: | | | | --- | --- | | key | description | | `:mem` | Bytes currently allocated via libvips tracked allocators | | `:mem-highwater` | Largest tracked allocation total seen so far | | `:allocs` | Number of active tracked allocations | | `:files` | Number of tracked open files | These counters only include resources libvips tracks itself. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L150-L165) --- ## operations ```clojure (operations) ``` Returns the sorted libvips operation nicknames known to the runtime. These are the names accepted by [`call`](#call) and by [`operation-info`](#operation-info), such as `"flip"`, `"rotate"`, or `"thumbnail_image"`. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L167-L173) --- ## operation-info ```clojure (operation-info operation-name) ``` Describes a libvips operation by nickname. Returns a map with the operation `:name`, a short `:description`, and an `:args` vector describing each argument’s name, blurb, type, and whether it is an input, output, or required argument. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L175-L182) --- ## encode-enum ```clojure (encode-enum enum-type-name value) ``` Encodes a Clojure enum value for a libvips enum type. `enum-type-name` should be a libvips GType name such as `"VipsDirection"`. Pass a keyword like `:horizontal` to get the corresponding integer value. Integer values pass through unchanged. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L184-L191) --- ## decode-enum ```clojure (decode-enum enum-type-name value) ``` Decodes a libvips enum integer to a normalized Clojure keyword. `enum-type-name` should be a libvips GType name such as `"VipsDirection"`. ```clojure (v/decode-enum "VipsDirection" (v/encode-enum "VipsDirection" :horizontal)) ;;=> :horizontal ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L193-L204) --- ## call ```clojure (call operation-name opts) ``` Calls a libvips operation by nickname. This is the low-level generic binding API described by libvips for language bindings: create an operation from its nickname, set properties, execute with the operation cache, then extract outputs. `operation-name` should be a libvips operation nickname such as `"flip"` or `"embed"`. `opts` keys should match libvips argument names as keywords. Enum arguments accept the normalized keywords used by [`encode-enum`](#encode-enum). Image arguments accept image handles and prior operation result maps with `:out`. Returns the operation outputs in the most useful shape for Clojure: * If the only output is an image at `:out`, returns that image handle. * Otherwise returns a map of outputs. * Returned output maps that hold closeable image values are themselves closeable. Example: ```clojure (v/call "flip" {:in image :direction :horizontal}) ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L206-L232) --- ## from-file ```clojure (from-file path) (from-file path opts) ``` Opens an image from `path` and returns a closeable image handle. `path` can be a string, `java.nio.file.Path`, or anything else coercible to a path string. Arity 2 appends `opts` in libvips option-string form. The available option keys depend on the loader libvips selects for that path. To discover loader-specific options like `:shrink`, see the generated wrappers in [`ol.vips.operations`](api/ol-vips-operations.adoc), for example [`ol.vips.operations/jpegload`](api/ol-vips-operations.adoc#jpegload) or [`ol.vips.operations/pngload`](api/ol-vips-operations.adoc#pngload). For enum option values like `:sequential` on `:access`, see [`ol.vips.enums/access`](api/ol-vips-enums.adoc#access) or [`ol.vips.enums/describe`](api/ol-vips-enums.adoc#describe). ```clojure (v/from-file "input.jpg" {:access :sequential :shrink 2}) ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L234-L254) --- ## write-to-file ```clojure (write-to-file image sink) (write-to-file image sink opts) ``` Writes `image` to `sink` and returns `image`. libvips infers the saver from the sink path or extension. Arity 3 appends `opts` in libvips option-string form. The available option keys depend on the saver libvips selects for that sink. To discover saver-specific options, see the generated wrappers in [`ol.vips.operations`](api/ol-vips-operations.adoc), for example [`ol.vips.operations/pngsave`](api/ol-vips-operations.adoc#pngsave) or [`ol.vips.operations/jpegsave`](api/ol-vips-operations.adoc#jpegsave). For enum option values, see [`ol.vips.enums`](api/ol-vips-enums.adoc). ```clojure (v/write-to-file image "output.png" {:compression 9}) ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L256-L274) --- ## from-buffer ```clojure (from-buffer source) (from-buffer source opts) ``` Opens an image from in-memory bytes and returns a closeable image handle. `source` may be a byte array or a byte sequence. Arity 2 passes `opts` as a libvips option string for the loader. The available option keys depend on the loader that recognizes the input bytes. See [`ol.vips.operations`](api/ol-vips-operations.adoc) for the generated loader wrappers and [`ol.vips.enums`](api/ol-vips-enums.adoc) for enum value sets. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L276-L288) --- ## from-stream ```clojure (from-stream is) (from-stream is opts) ``` Opens an image from an `InputStream` and returns a closeable image handle. The stream is bridged to a libvips source and is closed when the returned image handle is closed. Arity 2 passes `opts` as a libvips option string for the loader. This is useful for streaming or non-file inputs, especially together with loader hints like `:access :sequential`. The available option keys depend on the loader that recognizes the stream. See [`ol.vips.operations`](api/ol-vips-operations.adoc) for the generated loader wrappers and [`ol.vips.enums/access`](api/ol-vips-enums.adoc#access) for valid `:access` values. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L290-L306) --- ## write-to-buffer ```clojure (write-to-buffer image suffix) (write-to-buffer image suffix opts) ``` Encodes `image` and returns the result as a byte array. `suffix` selects the saver and can include libvips save options directly, such as `".png"` or `".png[compression=9]"`. Arity 3 appends `opts` to `suffix` in libvips option-string form. To discover saver-specific options, see the generated wrappers in [`ol.vips.operations`](api/ol-vips-operations.adoc), for example [`ol.vips.operations/pngsave`](api/ol-vips-operations.adoc#pngsave) or [`ol.vips.operations/jpegsave`](api/ol-vips-operations.adoc#jpegsave). [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L308-L321) --- ## write-to-stream ```clojure (write-to-stream image os suffix) (write-to-stream image os suffix opts) ``` Encodes `image` to an `OutputStream` and returns `image`. `suffix` selects the saver, for example `".png"` or `".jpg"`. Arity 4 appends `opts` to `suffix` in libvips option-string form. The stream is flushed and closed after the write completes, and is also closed if the write fails. To discover saver-specific options, see the generated wrappers in [`ol.vips.operations`](api/ol-vips-operations.adoc), for example [`ol.vips.operations/pngsave`](api/ol-vips-operations.adoc#pngsave) or [`ol.vips.operations/jpegsave`](api/ol-vips-operations.adoc#jpegsave). [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L323-L338) --- ## metadata ```clojure (metadata image) ``` Returns a curated metadata map for `image`. This is the high-level metadata view for the public API. It includes the core image header fields such as width, height, bands, format, coding, interpretation, resolution, offsets, and `:has-alpha?`, plus common animated image fields when present such as `:pages`, `:page-height`, `:loop`, and `:delay`. For raw header and metadata access by libvips field name, see [`field`](#field), [`field-names`](#field-names), and [`headers`](#headers). [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L340-L352) --- ## field ```clojure (field image field-name) (field image field-name not-found) ``` Returns the libvips header or metadata field named by `field-name`. Items of metadata are identified by strings. Use this for direct access to libvips header fields and attached metadata such as `"xres"`, `"icc-profile-data"`, or `"delay"`. Arity 2 returns `nil` for missing fields. Arity 3 returns `not-found` instead. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L354-L366) --- ## field-as-string ```clojure (field-as-string image field-name) (field-as-string image field-name not-found) ``` Returns the libvips field named by `field-name` rendered as a string. This is the direct string form of a header or metadata field, useful for display and debugging. Arity 3 returns `not-found` when the field is absent. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L368-L377) --- ## field-names ```clojure (field-names image) ``` Returns the libvips field names attached to `image`. This includes both core header fields and attached metadata field names. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L379-L384) --- ## headers ```clojure (headers image) ``` Returns the raw libvips header and metadata map for `image`. Keys are the original libvips field names as strings. Prefer [`metadata`](#metadata) when you want the higher-level normalized public view. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L386-L392) --- ## has-field? ```clojure (has-field? image field-name) ``` Returns `true` if `image` has the libvips field named by `field-name`. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L394-L397) --- ## width ```clojure (width image) ``` Returns the image width in pixels. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L399-L402) --- ## height ```clojure (height image) ``` Returns the image height in pixels. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L404-L407) --- ## bands ```clojure (bands image) ``` Returns the number of image bands as an integer. libvips images have three dimensions: width, height, and bands. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L409-L414) --- ## has-alpha? ```clojure (has-alpha? image) ``` Returns `true` if `image` has an alpha band. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L416-L419) --- ## shape ```clojure (shape image) ``` Returns `[width height bands]` for `image`. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L421-L426) --- ## copy-memory ```clojure (copy-memory image) ``` Materializes `image` into a private in-memory `VipsImage` and returns it as a normal closeable image handle. This is effectively a sink. Calling `copy-memory` forces libvips to evaluate the current pipeline now, render the pixels into memory, and wrap that memory in a new image handle. Unlike [`write-to-file`](#write-to-file), [`write-to-buffer`](#write-to-buffer), or [`write-to-stream`](#write-to-stream), the result is still an image you can keep using in downstream image operations. This is useful when an intermediate image will be reused several times and you do not want libvips to recompute the upstream pipeline for each branch. It is also the explicit way to ask for a private memory-backed image before applying mutating draw operations. Behavior: * Preserves the rendered image pixels and image metadata. * Returns a new handle that remains usable after the source pipeline handles have been closed. * May avoid an extra copy if libvips determines the input is already a simple readable memory image, in which case it can return another reference to the existing image instead of allocating again. * Trades CPU savings for higher memory use, so it is best reserved for intermediates you know are reused often enough to justify retaining the pixels. Example: ```clojure (with-open [base (v/from-file "input.jpg") step (-> base (ops/resize 0.5) (ops/sharpen)) cached (v/copy-memory step)] (do-something cached) (do-something-else cached)) ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L428-L467) --- ## assoc-field ```clojure (assoc-field image field-name value) (assoc-field image field-name value opts) ``` Returns a new image with the libvips field named by `field-name` set to `value`. `assoc-field` is immutable at the API level: it leaves `image` unchanged and returns a new image handle with the updated header or metadata field. Arity 4 accepts an options map. Options: | | | | --- | --- | | key | description | | `:type` | Explicit libvips field type to use when `value` is ambiguous, such as `:array-int` for integer vectors | Header fields such as `"xres"` and `"yres"` are updated as real libvips header values so they survive save and reload. Custom metadata fields are copied onto a fresh image header and can be read back with [`field`](#field) or [`headers`](#headers). Example: ```clojure (with-open [image (v/from-file "input.jpg") tagged (-> image (v/assoc-field "xres" 10.0) (v/assoc-field "delay" [10 20 30] {:type :array-int}))] [(v/field tagged "xres") (v/field tagged "delay")]) ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L469-L501) --- ## update-field ```clojure (update-field image field-name f & args) ``` Returns a new image with `field-name` updated by applying `f` to its current value. This is the functional update variant of [`assoc-field`](#assoc-field). The current field value is read with [`field`](#field) and passed to `f` along with any extra `args`. The result becomes the new field value on the returned image. Example: ```clojure (with-open [image (v/from-file "input.jpg") tagged (v/assoc-field image "custom-int" 42) updated (v/update-field tagged "custom-int" inc)] (v/field updated "custom-int")) ;; => 43 ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L503-L520) --- ## dissoc-field ```clojure (dissoc-field image field-name) ``` Returns a new image with the libvips field named by `field-name` removed. This leaves `image` unchanged and removes the field from a copied image header. It is most useful for stripping attached metadata fields that should not be preserved downstream. Example: ```clojure (with-open [image (v/from-file "input.jpg") tagged (v/assoc-field image "custom-string" "hello") stripped (v/dissoc-field tagged "custom-string")] (v/field stripped "custom-string")) ;; => nil ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L522-L539) --- ## pages ```clojure (pages image) ``` Returns the animated page count from `image`, or `nil` when it is absent. This reads the libvips `"n-pages"` field directly. For ordinary single-page images that field is usually missing, so `pages` commonly returns `nil`. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L541-L547) --- ## page-height ```clojure (page-height image) ``` Returns the per-frame height for an animated image, or `nil` when it is absent. libvips stores animated images as frames stacked vertically in one image. `page-height` is the height of each logical frame. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L549-L555) --- ## page-delays ```clojure (page-delays image) ``` Returns the animated frame delay vector from `image`, or `nil` when it is absent. Delay values are returned as integers in the same order as the frames. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L557-L562) --- ## loop-count ```clojure (loop-count image) ``` Returns the animated loop count from `image`, or `nil` when it is absent. A loop count of `0` means loop forever when the target format supports that convention. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L564-L570) --- ## assoc-pages ```clojure (assoc-pages image page-count) ``` Returns a new image with animated page count metadata set to `page-count`. `page-count` must be a positive integer. This updates the libvips `"n-pages"` field on a copied image header and leaves `image` unchanged. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L572-L578) --- ## assoc-page-height ```clojure (assoc-page-height image frame-height) ``` Returns a new image with animated frame height metadata set to `frame-height`. `frame-height` must be a positive integer. This updates the libvips `"page-height"` field on a copied image header and leaves `image` unchanged. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L580-L587) --- ## assoc-page-delays ```clojure (assoc-page-delays image delays) ``` Returns a new image with animated frame delay metadata set to `delays`. `delays` must be a non-empty sequence of integers. When `image` already has an explicit page count, the number of delay entries must match it. This writes the libvips `"delay"` field with the correct array type and leaves `image` unchanged. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L589-L598) --- ## assoc-loop-count ```clojure (assoc-loop-count image loop-value) ``` Returns a new image with animated loop count metadata set to `loop-value`. `loop-value` must be a non-negative integer. `0` means loop forever for formats that use that convention. This leaves `image` unchanged. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L600-L606) --- ## extract-area-pages ```clojure (extract-area-pages image left top width height) ``` Extracts the same rectangle from each frame of `image`. For animated images, this crops every logical frame independently and returns a reassembled animated image with `:pages`, `:page-height`, `:loop`, and `:delay` preserved. For ordinary single-page images, this behaves like the normal libvips `extract_area` operation. Example: ```clojure (with-open [image (ops/gifload "input.gif" {:n -1}) cropped (v/extract-area-pages image 10 7 50 50)] (select-keys (v/metadata cropped) [:width :height :pages :page-height])) ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L608-L624) --- ## embed-pages ```clojure (embed-pages image x y width height) (embed-pages image x y width height opts) ``` Embeds each frame of `image` into a new canvas and returns the result. For animated images, this applies libvips `embed` to every frame and then reassembles the result while preserving animation metadata such as `:loop` and `:delay`. For ordinary single-page images, this behaves like the normal libvips `embed` operation. Arity 6 accepts the same options map passed to libvips `embed`. Options: | | | | --- | --- | | key | description | | `:extend` | How pixels outside the source image are filled, for example `:background` | | `:background` | Background band values used when `:extend` is `:background` | Example: ```clojure (with-open [image (ops/gifload "input.gif" {:n -1}) framed (v/embed-pages image 8 8 70 70 {:extend :background :background [0 0 0 0]})] (v/page-height framed)) ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L626-L654) --- ## rot-pages ```clojure (rot-pages image angle) ``` Rotates each frame of `image` by `angle`. For animated images, this applies libvips `rot` to each frame and reassembles the result with updated frame geometry and preserved animation metadata. For ordinary single-page images, this behaves like the normal libvips `rot` operation. `angle` accepts the normalized enum keywords from [`ol.vips.enums/angle`](api/ol-vips-enums.adoc#angle), such as `:d90`, `:d180`, or `:d270`. [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L656-L667) --- ## assemble-pages ```clojure (assemble-pages frames) (assemble-pages frames {:keys [loop delay] :as _opts}) ``` Stacks `frames` into one animated image and annotates the result as multi-page. `frames` must be a non-empty collection of images. Each input image becomes one animation frame. All frames must have the same width and height. The returned image has `:pages` set to the number of frames and `:page-height` set to the height of each input frame. Arity 2 accepts an options map. Options: | | | | --- | --- | | key | description | | `:loop` | Animated loop count as a non-negative integer | | `:delay` | Non-empty sequence of integer frame delays, one per frame | `assemble-pages` requires at least one frame. When `:delay` is provided, its entry count must match the number of frames. Example: ```clojure (with-open [animated (v/assemble-pages [frame-a frame-b frame-c] {:loop 2 :delay [80 120 160]})] (select-keys (v/metadata animated) [:pages :page-height :loop :delay])) ``` [source,window=_blank](https://github.com/outskirtslabs/vips/blob/main/src/ol/vips.clj#L669-L700) ## Changelog # Changelog All notable changes to this project will be documented in this file. This project uses [**Break Versioning**](https://www.taoensso.com/break-versioning). ## UNRELEASED ## `v0.0.1` (2026-XX-XX) We haven’t quite got here yet.. Please report any problems and let me know if anything is unclear or inconvenient. Thank you. ## Examples # Examples The snippets below show the main API shapes inline. For runnable end-to-end scripts, see the examples in [`examples/`](https://github.com/outskirtslabs/vips/tree/main/examples): * [`examples/create_thumbnail.clj`](https://github.com/outskirtslabs/vips/blob/main/examples/create_thumbnail.clj) creates a thumbnail from a local file and writes it back out. * [`examples/chain_transforms.clj`](https://github.com/outskirtslabs/vips/blob/main/examples/chain_transforms.clj) chains several image operations together with the threading style API. * [`examples/compose_images.clj`](https://github.com/outskirtslabs/vips/blob/main/examples/compose_images.clj) joins two images and builds a small grid with `join` and `arrayjoin`. * [`examples/bytes_and_streams.clj`](https://github.com/outskirtslabs/vips/blob/main/examples/bytes_and_streams.clj) reads image bytes into memory, streams them through libvips, and writes the result back out. * [`examples/http_stream_fetch.clj`](https://github.com/outskirtslabs/vips/blob/main/examples/http_stream_fetch.clj) streams an HTTP response body into libvips and saves a transformed result. * [`examples/metadata_roundtrip.clj`](https://github.com/outskirtslabs/vips/blob/main/examples/metadata_roundtrip.clj) reads and writes metadata fields before saving an image. * [`examples/animated_gif.clj`](https://github.com/outskirtslabs/vips/blob/main/examples/animated_gif.clj) loads every GIF frame, transforms each page, and writes an animated result. ## File Input And Output Use the file helpers when your source and destination already live on disk and you want libvips to infer formats from the path or suffix. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg" {:shrink 2})] (v/metadata image) (v/shape image) (v/write-to-file image "rabbit.png" {:compression 9}) (v/write-to-buffer image ".png" {:compression 9})) ``` ## Metadata `ol.vips` exposes a curated `v/metadata` summary and a generic header API for libvips metadata fields. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg")] {:meta (v/metadata image) :width (v/field image "width") :fields (take 5 (v/field-names image))}) ;; => {:meta {:width 2490, :height 3084, :bands 3, :has-alpha? false} ;; :width 2490 ;; :fields ("width" "height" "bands" "format" "coding")} ``` Immutable metadata edits use `assoc`/`update`/`dissoc` style names. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg") tagged (-> image (v/assoc-field "xres" 10.0) (v/update-field "yres" (constantly 10.0)))] (v/write-to-file tagged "rabbit-copy.jpg" {:strip false}) (select-keys (v/headers tagged) ["width" "height" "xres" "yres"])) ``` ## Animated Images Load every page or frame with a format-specific loader and `{:n -1}`. libvips represents animated and multipage images as one tall strip plus metadata such as `n-pages`, `page-height`, `loop`, and `delay`. ```clojure (require '[ol.vips :as v] '[ol.vips.operations :as ops]) (with-open [image (ops/gifload "test/fixtures/cogs.gif" {:n -1}) cropped (v/extract-area-pages image 10 7 50 50) turned (v/rot-pages cropped :d90) looped (v/assoc-loop-count turned 2)] (v/write-to-file looped "cogs-turned.gif") (v/metadata looped)) ;; => {:width 50, :height 250, :bands 4, :has-alpha? true, :pages 5, ...} ``` The dedicated animated helpers are: * `v/pages`, `v/page-height`, `v/page-delays`, and `v/loop-count` * `v/assoc-pages`, `v/assoc-page-height`, `v/assoc-page-delays`, and `v/assoc-loop-count` * `v/extract-area-pages`, `v/embed-pages`, `v/rot-pages`, and `v/assemble-pages` These helpers work best for uniform-height multipage inputs such as animated GIF/WebP strips and similarly-shaped TIFF/PDF inputs. For a deeper guide, see [Multipage and Animated Images](https://docs.outskirtslabs.com/ol.vips/next/multipage-and-animated-images). ## Image Loaders The generic loaders `v/from-file`, `v/from-buffer`, and `v/from-stream` auto-detect the input format and accept option maps that libvips forwards to the selected loader. When you need format-specific behavior, use the generated loader operations in `ol.vips.operations`, such as `ops/jpegload`. `ol.vips` blocks libvips operations marked as untrusted by default. This can block loaders with a larger attack surface, such as PDF or ImageMagick-backed formats. If you trust your input and need those operations, opt in explicitly before loading that data: ```clojure (require '[ol.vips :as v] '[ol.vips.operations :as ops]) (v/set-block-untrusted-operations! false) (with-open [image (ops/pdfload "document.pdf")] (v/metadata image)) ``` Use that override only for trusted inputs. See the upstream https://www.libvips.org/API/8.17/func.block_untrusted_set.html[`vips_block_untrusted_set` documentation]. In libvips terms this is equivalent to calling `vips_block_untrusted_set(FALSE)` after initialization. JPEG auto-rotation rotates the image according to its EXIF orientation at load time: ```clojure (require '[ol.vips :as v] '[ol.vips.operations :as ops]) (with-open [image (ops/jpegload "dev/rabbit.jpg" {:autorotate true})] (v/write-to-file image "rabbit-upright.jpg") (v/metadata image)) ``` ## Streaming Input And Output `from-stream` reads from any `java.io.InputStream`. `from-buffer` reads from a byte array already in memory. ```clojure (require '[babashka.http-client :as http] '[ol.vips :as v] '[ol.vips.operations :as ops]) (import '[java.io FileOutputStream]) (with-open [response-body (:body (http/get "https://casey.link/square-flask.png" {:as :stream})) image (v/from-stream response-body {:access :sequential :fail-on :error}) thumbnail (ops/thumbnail-image image 200) out (FileOutputStream. "square-flask-thumb.png")] (v/write-to-stream thumbnail out ".png") (v/metadata thumbnail)) ``` `write-to-stream` writes encoded bytes to any `java.io.OutputStream`. ```clojure (require '[babashka.fs :as fs] '[ol.vips :as v] '[ol.vips.operations :as ops]) (import '[java.io FileOutputStream]) (let [source-bytes (fs/read-all-bytes "dev/rabbit.jpg")] (with-open [image (v/from-buffer source-bytes) thumbnail (ops/thumbnail-image image 200) out (FileOutputStream. "rabbit-thumb.png")] (v/write-to-stream thumbnail out ".png") (v/metadata thumbnail))) ``` ## Autorotate And Inspect Outputs `autorot` returns a closeable result map. You can inspect `:angle` and `:flip`, and still use the same value anywhere an image is expected. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg") autorot (ops/autorot image)] {:angle (:angle autorot) :flip (:flip autorot) :meta (v/metadata autorot)}) ;; => {:angle :d0, :flip false, :meta {:width 2490, :height 3084, :bands 3, :has-alpha? false}} ``` ## Resize And Crop Use these geometry operations when you want to rescale an image first and then work on a precise rectangular region. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg") resized (ops/resize image 0.5) cropped (ops/extract-area resized 100 100 500 500)] (v/write-to-file resized "rabbit-resized.jpg") (v/write-to-file cropped "rabbit-cropped.jpg") {:resized (v/metadata resized) :cropped (v/metadata cropped)}) ``` ## Smart Thumbnailing `ops/thumbnail` exposes libvips’s higher-level thumbnail pipeline. Enum options such as `:size` and `:crop` are documented in `ol.vips.enums`. ```clojure (with-open [thumb (ops/thumbnail "dev/rabbit.jpg" 300 {:height 300 :size :down :crop :attention})] (v/write-to-file thumb "rabbit-smart-thumb.jpg") (v/metadata thumb)) ``` ## Transforming Images These operations are a good fit for orientation, color interpretation, and other structural changes you want to compose into one pipeline. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg") rotated (ops/rotate image 90.0) flipped (ops/flip rotated :horizontal) bw (ops/colourspace flipped :b-w)] (v/write-to-file bw "rabbit-bw.jpg")) ``` ## Filters And Effects libvips includes a large set of convolution and enhancement operations, so common blur and sharpen passes can stay inside the same image pipeline. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg") blurred (ops/gaussblur image 3.0) sharp (ops/sharpen image {:sigma 1.0})] (v/write-to-file blurred "rabbit-blur.jpg") (v/write-to-file sharp "rabbit-sharp.jpg") {:blurred (v/metadata blurred) :sharp (v/metadata sharp)}) ``` ## Composing Images Use the composition helpers when you need to join images, build contact sheets, or align multiple sources into one output image. ```clojure (with-open [left (v/from-file "dev/rabbit.jpg") right (v/from-file "dev/rabbit.jpg") joined (ops/join left right :horizontal) grid (ops/arrayjoin [left right left right] {:across 2 :shim 10 :halign :centre :valign :centre})] (v/write-to-file joined "rabbit-joined.jpg") (v/write-to-file grid "rabbit-grid.jpg")) ``` ## Web Optimization The save helpers accept format-specific encoder options, which makes it easy to produce smaller web-friendly JPEG and WebP outputs from the same source image. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg")] (v/write-to-file image "rabbit-progressive.jpg" {:interlace true :strip true :Q 85}) (v/write-to-file image "rabbit.webp" {:Q 80 :effort 4})) ``` ## Calling Raw Operations Use `v/call` when you want access to the full libvips operation surface before a dedicated convenience wrapper exists. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg") rotated (v/call "rotate" {:in image :angle 90.0})] (v/metadata rotated)) ``` Use `v/operations` to list available libvips operations and `v/operation-info` to inspect their inputs and outputs. ## Text Overlay Generated operation wrappers also cover image synthesis and compositing, so overlays like text labels can stay inside libvips rather than being rendered in a separate tool. ```clojure (with-open [image (v/from-file "dev/rabbit.jpg") label (ops/text "ol.vips" {:font "Sans Bold 48" :rgba true}) poster (ops/composite2 image label :over {:x 40 :y 40})] (v/write-to-file poster "rabbit-poster.png") (v/metadata poster)) ``` ## Going to Production # Going to Production This page adapts the upstream libvips production checklist to `ol.vips`. The original reference is the libvips [Checklist for programmers using libvips](https://www.libvips.org/API/8.17/developer-checklist.html). Use this page as guidance for application design and deployment. It is not a hard rulebook, but these defaults are a good starting point for long-running services, upload pipelines, and image proxy workloads. ## Prefer smart thumbnailing over load then resize If you are starting from a filename and want a thumbnail, prefer [`ops/thumbnail`](api/ol-vips-operations.adoc#thumbnail) over loading the full image and then calling [`ops/resize`](api/ol-vips-operations.adoc#resize). Unlike a separate load followed by resize, `ops/thumbnail` combines loading and shrinking into one step. That lets libvips use format-specific tricks such as shrink-on-load, which can significantly reduce memory use and latency. This is not only about speed. Thumbnailing at load time can also improve quality, because libvips can premultiply automatically where needed and can render vector inputs at the target size instead of rasterizing them large and shrinking afterwards. ```clojure (require '[ol.vips :as v] '[ol.vips.operations :as ops]) (with-open [thumb (ops/thumbnail "input.jpg" 300 {:height 300})] (v/write-to-file thumb "thumb.jpg")) ``` If you already have an image handle in hand, there is still a lower-level [`ops/thumbnail-image`](api/ol-vips-operations.adoc#thumbnail-image) wrapper. Treat it as an escape hatch. It wraps libvips `thumbnail_image`, so it does not get the load-time rendering and shrink-on-load advantages that `ops/thumbnail` gets from starting at the source. ## Use sequential access when your pipeline can stream When you know you will read the source once in loader order, pass `{:access :sequential}` to your loader. This often reduces memory use and can improve throughput. For background on why this matters, see the upstream libvips https://www.libvips.org/API/8.17/how-it-opens-files.html["How it opens files" chapter]. ```clojure (with-open [image (v/from-file "input.jpg" {:access :sequential})] (v/metadata image)) ``` The same applies to [`v/from-stream`](api/ol-vips.adoc#from-stream), [`v/from-buffer`](api/ol-vips.adoc#from-buffer), and format-specific loader operations such as [`ops/jpegload`](api/ol-vips-operations.adoc#jpegload) and [`ops/pngload`](api/ol-vips-operations.adoc#pngload). ## Prefer longer pipelines to many materialized steps libvips is demand-driven and uses partial images as intermediates. In `ol.vips`, that means you can usually build one longer pipeline of operations without materializing every step in memory or on disk. The work is deferred until a sink asks for pixels, such as [`v/write-to-file`](api/ol-vips.adoc#write-to-file), [`v/write-to-buffer`](api/ol-vips.adoc#write-to-buffer), or [`v/write-to-stream`](api/ol-vips.adoc#write-to-stream). This is one of the main reasons to lean into the libvips model instead of breaking processing into many disconnected phases. Long pipelines usually stay memory-efficient because intermediate results are represented as graph nodes rather than fully realized images. libvips is also horizontally threaded: threads tend to run along the pipeline you are evaluating, rather than up and down the image. In practice, that means longer pipelines often parallelize better than shorter ones. ```clojure (with-open [image (v/from-file "input.jpg") result (-> image (ops/resize 0.5) (ops/colourspace :b-w) (ops/sharpen))] (v/write-to-file result "output.jpg")) ``` If you can, aim for one coherent processing pipeline per output rather than a series of intermediate writes, reloads, and separate mini-pipelines. This generally works better than repeatedly writing intermediates to disk or breaking the flow into many disconnected steps. ## Reuse shared intermediates intentionally If one derived image is reused several times in the same request, bind it once and pass that handle to downstream operations instead of recalculating it. ```clojure (with-open [image (v/from-file "input.jpg") base (ops/resize image 0.5) preview (ops/colourspace base :srgb) mask (ops/extract-band base 0)] ...) ``` If you need to materialize a reused intermediate so libvips does not recalculate it, use [`v/copy-memory`](api/ol-vips.adoc#copy-memory). This forces the current pipeline to render into a private in-memory image and returns another image handle you can fan out to several downstream operations or keep in an application cache for later reuse. This can trade CPU time for higher memory use, so it is best reserved for intermediates you know are reused often enough to justify the retained pixels. ## Put large resizes early in the pipeline If a pipeline includes a large resize, do it near the start. After that, apply area operations such as sharpening, then point operations. This reduces the amount of pixel data that later stages need to touch. ## Restrict loaders and untrusted inputs `ol.vips` starts from a secure default: libvips operations marked as untrusted are blocked during initialization. If you handle untrusted data, keep [`v/set-block-untrusted-operations!`](api/ol-vips.adoc#set-block-untrusted-operations-BANG-) set to `true` unless you have a specific trusted-input path that needs those loaders. If you need direct control over that default, use [`v/set-block-untrusted-operations!`](api/ol-vips.adoc#set-block-untrusted-operations-BANG-). Passing `true` restores the default secure posture, and passing `false` allows operations libvips has marked as untrusted. libvips also has a lower-level class-hierarchy blocker, exposed as [`v/set-operation-block!`](api/ol-vips.adoc#set-operation-block-BANG-). This lets you block broad families of operations and selectively re-enable the subset you trust. For example, to allow only JPEG loaders: ```clojure (require '[ol.vips :as v]) (v/set-block-untrusted-operations! true) (v/set-operation-block! "VipsForeignLoad" true) (v/set-operation-block! "VipsForeignLoadJpeg" false) ``` After those calls, libvips will only load JPEGs from the foreign-loader hierarchy. This is useful when you need tighter runtime control without building a custom libvips binary. If you need tighter control over which loaders are present at all, prefer shipping a custom libvips build and loading it with `-Dol.vips.native.preload` instead of relying on a broader system installation. See also: [Security Policy](security.adoc). ## Sanity-check images before expensive processing Open the image, inspect cheap metadata first, and reject inputs that are too large or unsuitable for your main pipeline. ```clojure (with-open [image (v/from-file "upload.jpg" {:access :sequential})] (let [width (v/width image) height (v/height image) interlaced (v/field image "interlaced" false)] (when (> (* width height) 100000000) (throw (ex-info "image too large" {:width width :height height}))) (when interlaced (throw (ex-info "progressive images are not allowed" {}))))) ``` This is especially useful for defending against decompression bombs and for keeping progressive or interlaced inputs away from latency-sensitive paths. In practice that usually means checking [`v/width`](api/ol-vips.adoc#width), [`v/height`](api/ol-vips.adoc#height), and [`v/field`](api/ol-vips.adoc#field) before you start expensive work. ## Tune the Linux allocator for long-running glibc services On glibc-based Linux systems, long-running multithreaded image workloads can benefit from an alternative allocator such as [jemalloc](https://github.com/jemalloc/jemalloc). The default allocator often performs poorly for long-running, multithreaded processes with frequent small allocations, and switching allocators can reduce the off-heap footprint of the JVM when using libvips. This is an operating environment concern rather than an `ol.vips` API setting. On Linux that usually means configuring `LD_PRELOAD` before launching the JVM, not changing anything inside your image pipeline. The jemalloc project is also in a somewhat unsettled state. See [this postmortem](https://jasone.github.io/2025/06/12/jemalloc-postmortem/) for background, and [Facebook’s fork](https://github.com/facebook/jemalloc) for one possible continuation point. Musl-based Linux systems and non-Linux runtimes are generally less affected by this specific issue. ## Disable or tune the libvips operation cache for proxy workloads For image proxy workloads that process many unrelated images, the libvips operation cache is often not useful. Disable it entirely with [`v/disable-operation-cache!`](api/ol-vips.adoc#disable-operation-cache-BANG-): ```clojure (require '[ol.vips :as v]) (v/init!) (v/disable-operation-cache!) ``` The cache is more useful when the same or very similar operation graphs are reused repeatedly in one process, for example a service that applies a small set of common transforms over and over. In that kind of workload, the defaults may be fine and you may not want to touch them. When you do need to tune it, think about the three limits separately: * `v/set-operation-cache-max!` limits how many recent operations libvips keeps. Lower this when cache churn is high and you are not seeing reuse. Raise it only if you have evidence that repeated operation graphs are being evicted too aggressively. * `v/set-operation-cache-max-mem!` limits how much libvips-tracked memory can accumulate before cached operations start getting dropped. Lower this when you want cache eviction to happen earlier under memory pressure. * `v/set-operation-cache-max-files!` limits how many libvips-tracked file descriptors can accumulate before cached operations start getting dropped. Lower this when file handle pressure matters more than cache hit rate. Tune the cache limits directly like this: ```clojure (v/set-operation-cache-max! 0) (v/set-operation-cache-max-mem! (* 32 1024 1024)) (v/set-operation-cache-max-files! 32) (v/operation-cache-settings) ;; => {:max 0, :size 0, :max-mem 33554432, :max-files 32} (v/tracked-resources) ;; => {:mem 0, :mem-highwater 0, :allocs 0, :files 0} ``` [`v/operation-cache-settings`](api/ol-vips.adoc#operation-cache-settings) reports the current libvips cache limits and the current cache size. [`v/tracked-resources`](api/ol-vips.adoc#tracked-resources) reports libvips tracked memory, highwater memory, allocation count, and tracked file count. Those tracked counters are useful for observing trends, but they only include resources libvips tracks itself. Memory or file descriptors used inside external libraries may not be reflected there, so treat them as a lower bound rather than a complete process-wide accounting. ## Ship only the native bundle you need This is an `ol.vips`-specific deployment concern. The main library is small, but the companion native jars contain the bundled libvips binaries and their support libraries for a specific platform. Those jars are usually the largest part of an `ol.vips` deployment artifact. If you know the production target in advance, prefer packaging only the one native companion jar that matches that runtime platform. For example, a Linux x86-64 glibc deployment usually only needs `com.outskirtslabs/vips-native-linux-x86-64-gnu` on the classpath. Including several platform jars is useful for development, shared tooling, or distributing a generic application bundle. But for a single-platform deploy it usually just makes the image, container layer, or classpath larger without adding runtime value, since `ol.vips` will only load the bundle that matches the detected target platform. If possible, build separate deployment artifacts per target platform and keep each one trimmed to the matching native dependency set. ## ol.vips # ol.vips > Clojure bindings for [libvips](https://github.com/libvips/libvips) image > processing library ![doc](https://img.shields.io/badge/doc-outskirtslabs-orange.svg) ![status: experimental](https://img.shields.io/badge/status-experimental-orange.svg) ![alt=built with garnix](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Foutskirtslabs%2Fvips) `ol.vips` is a Clojure library for loading, transforming, and saving images with [libvips](https://github.com/libvips/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](https://github.com/IGJoshua/coffi) and requires Java 22{plus} for FFI/FFM (Project Panama). Project status: **[Experimental](https://docs.outskirtslabs.com/open-source-vital-signs#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. ```clojure ;; 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. https://clojars.org/search?q=group-id%3Acom.outskirtslabs+AND+artifact-id%3Avips-native*[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{plus} and native access enabled for the JVM process: ```clojure ;; deps.edn {:aliases {:dev {:jvm-opts ["--enable-native-access=ALL-UNNAMED"]}}} ``` To use your own libvips build, see [Loading the native library](https://docs.outskirtslabs.com/ol.vips/next/introduction/#loading-the-native-library). ## Quick Start ```clojure (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. ## Documentation * [Docs Home](https://docs.outskirtslabs.com/ol.vips/next/) * [Introduction](https://docs.outskirtslabs.com/ol.vips/next/introduction/) * [Examples](https://docs.outskirtslabs.com/ol.vips/next/examples/) * [Going to Production](https://docs.outskirtslabs.com/ol.vips/next/going-to-production/) * [Multipage and Animated Images](https://docs.outskirtslabs.com/ol.vips/next/multipage-and-animated-images/) * [API Reference](https://docs.outskirtslabs.com/ol.vips/next/api/) * [Changelog](https://docs.outskirtslabs.com/ol.vips/next/changelog/) * [Security Policy](https://docs.outskirtslabs.com/ol.vips/next/security/) * [Support via GitHub Issues](https://github.com/outskirtslabs/vips/issues) ## Licensing The Clojure library `ol.vips` is copyright (C) 2026 Casey Link and is licensed under [EUPL-1.2](https://spdx.org/licenses/EUPL-1.2.html). The platform-native companion jars under `native/` redistribute upstream [sharp-libvips](https://github.com/lovell/sharp-libvips/releases) binary bundles. Those redistributed native binaries are licensed separately from the `ol.vips` source, principally under LGPL-3.0-or-later. ## Introduction # Introduction `ol.vips` wraps libvips’s image graph in [Closeable](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/Closeable.html) Clojure values. Loader functions such as `v/from-file`, `v/from-buffer`, and `v/from-stream` return image handles, and operations such as `ops/resize`, `ops/colourspace`, and `v/call` return new handles rather than mutating the original image. This model is immutable and pipeline-oriented. In the common case, libvips reads only enough of the input to discover image metadata and build an operation graph. Calling loaders and transforms usually does not decode the whole image up front. libvips is demand-driven, so the pixel work happens when something downstream asks for image data. In `ol.vips`, that usually means a sink such as `v/write-to-file`, `v/write-to-buffer`, or `v/write-to-stream`. At that point libvips pulls pixels through the pipeline, processing small regions with a horizontally threaded execution model instead of materializing every intermediate image in memory. Some operations that need actual pixel values can trigger evaluation earlier, but metadata queries such as `v/width`, `v/height`, and `v/metadata` can often be satisfied from loader metadata alone. Because the image graph is immutable and operations are generally side-effect free, libvips can also reuse and cache operation results internally. `ol.vips` adds a small amount of Clojure-specific structure on top of that model. The `ol.vips.operations` namespace is generated from libvips introspection data, `ol.vips.enums` exposes the enum keywords used by many options, and the top-level `ol.vips` namespace provides the file, buffer, stream, metadata, and convenience helpers you use most often. ## Why libvips? The typical libvips workflow is exactly what many applications need: load a large source image, resize or transform it, and write a smaller web-friendly JPEG, PNG, WebP, AVIF, or TIFF result. `ol.vips` gives Clojure access to that model without shelling out to external image tools or spawning child processes. libvips is https://github.com/libvips/libvips/wiki/Why-is-libvips-quick[blazing fast] and https://github.com/libvips/libvips/wiki/Speed-and-memory-use[memory efficient] because it usually works on small regions of uncompressed image data at a time, takes advantage of multiple CPU cores, and avoids materializing every intermediate result in memory. That execution model is a strong fit for image pipelines, thumbnails, upload processing, preprocessing for vision workloads, and other server-side image tasks. It also brings broad format and operation support: [300 operations](https://www.libvips.org/API/current/func-list.html) covering arithmetic, histograms, convolution, morphology, colour, resampling, statistics, and more, with correct handling of colour spaces, embedded ICC profiles, and alpha channels. [libvips](https://github.com/libvips/libvips) was originally created at Birkbeck College and is currently maintained by [John Cupitt](https://github.com/jcupitt) and other contributors. ### Bindings Generation libvips itself is very amenable to automatic bindings generation. The core of `ol.vips` is small introspection layer that loads the native library then introspects it to generate `ol.vips.operations` and `ol.vips.enums`, and then a small runtime for loading/reading/writing. As a convenience for Clojure users there are separate jars available with the native libraries per-platform, but `ol.vips` it self does not depend on them directly. You can depend on one (or more) of those native deps, or provide your own libvips build with `-Dol.vips.native.preload`. You’ll need to choose one. This means that you can even use a custom libvips build or a newer version of libvips without having to wait for `ol.vips` to catch up (though I expect to keep it up to date). Any new or updated operations in libvips can be used with this library using the lower level `ol.vips/call` function. You can even generate the bindings yourself if you need to, simply use `ol.vips.codegen`. ## Going to Production See [Going to Production](https://docs.outskirtslabs.com/ol.vips/next/going-to-production) for production guidance on pipeline shape, sequential access, untrusted inputs, sanity checks, allocator tuning, and cache settings in `ol.vips`. See [Examples](examples.adoc) for runnable snippets that cover file, buffer, stream, metadata, thumbnailing, transforms, composition, and animated-image workflows. ## Loading the native library `ol.vips` uses this procedure to load the native components: 1. Load any explicit libraries listed in `-Dol.vips.native.preload`. 2. Load the extracted libraries from the platform native jar on the classpath. 3. If that fails, fall back to the system library loader, which can resolve `libvips` from `LD_LIBRARY_PATH`. ### 1. Preload `-Dol.vips.native.preload` is for exact native library file paths. Use it when you want to point `ol.vips` at a specific custom build in a non-standard location, or when you need to preload dependency libraries before libvips itself. On Nix-like systems that can include things like `libstdc{plus}{plus}.so.6` as well as your `libvips` library. The value is a single string containing one or more full library file paths separated by the OS path separator, which is `:` on Linux and macOS and `;` on Windows. If `ol.vips.native.preload` is set, those entries are always loaded first. If any preload entry fails to load, the packaged native-jar path is abandoned for that initialization attempt and `ol.vips` falls back to the system library loader instead of continuing with the native jar. ### 2. Classpath native bundle `ol.vips` detects the current platform, builds a resource path like `ol/vips/native/-` on macOS and Windows or `ol/vips/native/--` on Linux, and then looks for `manifest.edn` under that path. For example, Linux x86-64 glibc resolves to `ol/vips/native/linux-x86-64-gnu/manifest.edn`. If that resource is present, `ol.vips` reads the manifest, extracts the bundled native libraries into the local cache, and loads those extracted files. You can override parts of that platform detection with `-Dol.vips.native.platform-id`, `-Dol.vips.native.os`, `-Dol.vips.native.arch`, and `-Dol.vips.native.libc`. In practice, this means the companion jar for the current runtime platform needs to be on the classpath, meaning the current OS, CPU architecture, and Linux libc when applicable. This path is attempted after any explicit `ol.vips.native.preload` entries. In the successful packaged case, `v/init!` will report `:native-load-source :packaged` and expose the extracted primary library path in `:primary-library-path`, which is useful when debugging exactly what got loaded. ### 3. System fallback The system-library fallback loads by library name rather than full file path. Use this when you want the OS or JVM loader to resolve libvips from `LD_LIBRARY_PATH`, standard system locations, or other platform-specific loader configuration. A platform native jar is not required for this path; if the packaged load fails, including because no matching native jar is present on the classpath, `ol.vips` can still fall back to the system loader. By default the system fallback tries `vips-cpp` and then `vips`. Most users should not need to change this. `-Dol.vips.native.system-libs` exists for the uncommon case where your environment exposes libvips under different system library names. Like `ol.vips.native.preload`, it accepts multiple entries separated by the OS path separator. The fallback only applies to native library loading. If the packaged libraries load successfully but `vips_init` fails afterwards, `ol.vips` does not automatically retry via the system loader. For debugging, `v/init!` exposes runtime state including whether initialization came from the packaged path or the system fallback. ## Multipage and Animated Images # Multipage and Animated Images This page adapts the upstream libvips guide for `ol.vips`. The original reference is [Multipage and animated images](https://www.libvips.org/API/8.17/multipage-and-animated-images.html). libvips represents animated and multipage images as one tall image plus metadata describing how that strip should be interpreted. In `ol.vips`, the main metadata fields are [`v/pages`](api/ol-vips.adoc#pages), [`v/page-height`](api/ol-vips.adoc#page-height), [`v/page-delays`](api/ol-vips.adoc#page-delays), and [`v/loop-count`](api/ol-vips.adoc#loop-count). This model works best when every page or frame has the same dimensions. That is common for animated GIF and WebP, and also for some TIFF or PDF inputs. If page sizes vary, read and process them one at a time instead of treating the file as one uniform strip. ## Reading multipage images By default, libvips usually reads only the first page or frame. Pass `{:n -1}` to load every page, or use `{:page ... :n ...}` to load a single page or a range. ```clojure (require '[ol.vips :as v] '[ol.vips.operations :as ops]) (with-open [image (ops/gifload "test/fixtures/cogs.gif" {:n -1})] (select-keys (v/metadata image) [:width :height :pages :page-height :loop :delay])) ;; => {:width 85 ;; :height 385 ;; :pages 5 ;; :page-height 77 ;; :loop 32761 ;; :delay [0 50 50 50 50]} ``` Points to note: * [`ops/gifload`](api/ol-vips-operations.adoc#gifload) with `{:n -1}` loads every frame in the animation. * `:page-height` is the height of one frame within the strip. * `:pages * :page-height == :height` for uniform-height images. * `:loop` is the loop count for animated formats. * `:delay` is a vector of frame delays in milliseconds. You can also load a subset of frames: ```clojure (with-open [two-frames (ops/gifload "test/fixtures/cogs.gif" {:page 2 :n 2})] (select-keys (v/metadata two-frames) [:height :pages :page-height])) ``` Be careful interpreting metadata on partial loads. The loaded strip height reflects the selected range, but some loaders can still preserve source metadata such as the original total `n-pages`. For frame slicing logic, rely on the loaded image dimensions together with `page-height`, not only on the reported source page count. The same loader options apply to other multipage-capable loaders such as [`ops/webpload`](api/ol-vips-operations.adoc#webpload) and [`ops/tiffload`](api/ol-vips-operations.adoc#tiffload), or to the generic [`v/from-file`](api/ol-vips.adoc#from-file) path when you want format autodetection. For PDF input, remember that `ol.vips` blocks libvips operations marked as untrusted during initialization. If you have a trusted PDF input path and need to load it, opt in first with [`v/set-block-untrusted-operations!`](api/ol-vips.adoc#set-block-untrusted-operations-BANG-) set to `false`. ## Writing multipage images If an image already has the right strip layout and metadata, writing an animated or multipage image is just a normal save. For example, you can load a GIF animation and write it back as animated WebP: ```clojure (with-open [image (ops/gifload "test/fixtures/cogs.gif" {:n -1})] (v/write-to-file image "cogs.webp")) ``` That works because the loaded image already carries the `n-pages`, `page-height`, `loop`, and `delay` metadata that the saver needs. The same pattern applies to multipage TIFF output with [`ops/tiffsave`](api/ol-vips-operations.adoc#tiffsave) or to generic saves through [`v/write-to-file`](api/ol-vips.adoc#write-to-file) when libvips can infer the target format from the filename. ## Building an animation from frames The upstream libvips examples build a vertical strip and then set metadata by hand. In `ol.vips`, prefer [`v/assemble-pages`](api/ol-vips.adoc#assemble-pages) when you already have a sequence of equal-sized frames. It joins the frames into one strip and sets the page metadata for you. ```clojure (require '[ol.vips :as v] '[ol.vips.operations :as ops]) (with-open [base (v/from-file "test/fixtures/puppies.jpg") frame-a (ops/extract-area base 0 0 40 30) frame-b (ops/extract-area base 10 10 40 30) frame-c (ops/extract-area base 20 20 40 30) animated (v/assemble-pages [frame-a frame-b frame-c] {:loop 2 :delay [80 120 160]})] (v/write-to-file animated "puppies.gif") (select-keys (v/metadata animated) [:width :height :pages :page-height :loop :delay])) ``` Here, `frame-a`, `frame-b`, and `frame-c` are just ordinary image handles. `v/assemble-pages` does not require a special frame type. The `frames` argument is simply a non-empty collection of same-sized images, with each image becoming one animation frame in the output. In practice, those images can come from any image-producing operation, not only from [`ops/extract-area`](api/ol-vips-operations.adoc#extract-area). You can resize, crop, composite, render text, or load separate files first, then pass the resulting image handles to `v/assemble-pages`. If you already have a tall strip and need to annotate or adjust it, use [`v/assoc-pages`](api/ol-vips.adoc#assoc-pages), [`v/assoc-page-height`](api/ol-vips.adoc#assoc-page-height), [`v/assoc-page-delays`](api/ol-vips.adoc#assoc-page-delays), and [`v/assoc-loop-count`](api/ol-vips.adoc#assoc-loop-count). ## Applying operations page by page For uniform-height multipage images, the page-aware helpers apply ordinary operations frame by frame and keep the metadata consistent. ```clojure (with-open [image (ops/gifload "test/fixtures/cogs.gif" {:n -1}) cropped (v/extract-area-pages image 10 7 50 50) turned (v/rot-pages cropped :d90) looped (v/assoc-loop-count turned 2)] (v/write-to-file looped "cogs-turned.gif") (select-keys (v/metadata looped) [:width :height :pages :page-height :loop :delay])) ``` The main helpers are: * [`v/extract-area-pages`](api/ol-vips.adoc#extract-area-pages) * [`v/embed-pages`](api/ol-vips.adoc#embed-pages) * [`v/rot-pages`](api/ol-vips.adoc#rot-pages) * [`v/assemble-pages`](api/ol-vips.adoc#assemble-pages) For single-page inputs, these helpers fall back to the ordinary single-image behavior. For true multipage work, they assume that the image can be divided cleanly into equal-height pages. ## Security # Security Please report vulnerabilities through [GitHub Security Advisories](https://github.com/outskirtslabs/vips/security/advisories). For general policy and support expectations, see [Outskirts Labs Security Policy](https://docs.outskirtslabs.com/security-policy).