Giter VIP home page Giter VIP logo

clisk's Introduction

Clisk

Clisk is a Clojure based DSL/library for procedural image generation.

You can use it for:

  • Creating 2D material textures for games
  • Building fractal images / artwork
  • Generating 3D or 4D textures for raytracing (e.g. in Enlight: https://github.com/mikera/enlight)
  • Creating patterns (e.g. randomly generated maps)

The core operation of Clisk is taking an image description using the Clisk DSL as input and creating a bitmap images as output. You can create images of arbitrary size as long as they fit in memory.

Clisk is intended to be used from Clojure in a REPL environment, but can also with a little effort be used from Java.

Clojars Project

Build Status

Example code and resulting image

;; Create a Voronoi map based on a mathematical function
(def vblocks 
  (v* 5.0 
      (voronoi-function 
        `(Math/sqrt (- (* ~'y ~'y) (* ~'x ~'x))))))

;; Render an texture using the Voronoi map as a height-field
(show (render-lit 
        (seamless vplasma) 
        (v+ (v* 0.2 (seamless 0.2 (rotate 0.1 plasma))) 
            (v* 0.6 vblocks))))

Voronoi rocks

For more examples see the Wiki

Installation

The best way to get started with clisk is to install it from Clojars using either leiningen or Maven.

Once you have Clisk specified as a dependency, you should be able to get going with the key functionality as follows:

(use 'clisk.live)
 
(show (checker red white))

Features

  • A concise DSL for specifying image generators through function composition
  • Multi-dimensional texture generation (e.g. 4D textures including time dimension for animations)
  • Fast image synthesis thanks to compiled image generation functions (typically sub-second generation 256*256 4x antialiased textures)
  • Anti-aliasing (arbitrary precision)
  • A wide variety of patterns and transforms, e.g. Voronoi maps, Perlin Noise
  • Easily extensible with your own image generation functions
  • Ability to render surfaces with shading based on 3D heightmaps

Plasma Globe

License

Clisk is open source, licensed under the GNU Lesser General Public License (LGPL)

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.