GithubHelp home page GithubHelp logo

imagez's Introduction

imagez

Image processing library for Clojure

Contains various utility functions for handling colours and bitmap images.

Build Status

Example

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

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

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

Inverted ant

Features

Features so far:

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

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

Using Imagez

Simply add the dependency via Clojars: https://clojars.org/net.mikera/imagez

Imagez requires Clojure 1.4 and above.

More Examples

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

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

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

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

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

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

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

License

LGPL version 3.0.

imagez's People

Contributors

arosequist avatar guns avatar karls avatar mikera avatar scottdw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.