Skip to content
Clojure library for pixel-art and simple work with images
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/clyaksa
test/clyaksa
.gitignore
README.md
project.clj

README.md

clyaksa

Clojars Project

Create new image

(new-image 1000 :rgb)           ;; 1000x1000 rgb image
(new-image 600 800 :argb)       ;; 600x800 argb image

Enabled image types:

  • :custom
  • :rgb
  • :argb
  • :argb-pre
  • :bgr

Save/Load image

Save:

(save-image image "image.jpg")
(save-image image "image.jpg" :jpg)

Load:

(load-image :file "image.png")              ;; load image from filesystem
(load-image :url "google.com/image.png")    ;; load image by url

(load-image "image.png")                    ;; image loaded from filesystem by default

Image data

(get-height image)          ;; get height of the image
(get-width image)           ;; get width of the image

Drawing

Color is int value.

Set pixel:

(set-pixel image 200 300 color)         ;; return changed image

Get pixel:

(get-pixel image 55 55)                 ;; return color of pixel

Swap pixels in one image:

(swap-pixel image x1 y1 x2 y2)          ;; return changed image

Swap pixels between two image:

(swap-pixel image1 image2 x1 y1 x2 y2)  ;; return array of changed images: [image1 image2]
You can’t perform that action at this time.