项目
在 GitHub 查看
mikera/imagez
关于
Image processing library for Clojure
设计与媒体可以做什么
- 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
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文imagez
Image processing library for Clojure
Contains various utility functions for handling colours and bitmap images.
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 image, after applying an "invert" filter
(show (filter-image ant (filt/invert)))

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.
探索相关项目
加载中…
