Liking cljdoc? Tell your friends :D

clojure2d.extra.glitch

Various glitching pixel filters or functions

Filter

Use following filters with [[filter-channels]] function.

  • Slitscan - x/y slitscan simulation based on wave functions
  • Shift-channels - just shift channels
  • Mirror - mirror image along different axes
  • Slitscan2 - slitscan simulation based on vector fields
  • Fold - apply vector field on the image
  • Pix2line - convert pixel into horizontal line

Machines

Short sketches operating on images/pixels.

  • Blend - compose two images in glitchy way

All filters are equiped with random configuration generator.

Various glitching pixel filters or functions

### Filter

Use following filters with [[filter-channels]] function.

* Slitscan - x/y slitscan simulation based on wave functions
* Shift-channels - just shift channels
* Mirror - mirror image along different axes
* Slitscan2 - slitscan simulation based on vector fields
* Fold - apply vector field on the image
* Pix2line - convert pixel into horizontal line

### Machines

Short sketches operating on images/pixels.

* Blend - compose two images in glitchy way

All filters are equiped with random configuration generator.
raw docstring

blend-machineclj

(blend-machine p1 p2)
(blend-machine {:keys [switch? in1-cs in2-cs out-cs in1-to? in2-to? out-to?
                       blend-ch1 blend-ch2 blend-ch3]}
               p1
               p2)

Blend two Pixels based on configuration.

The idea is to compose channels separately in different color spaces.

Full flow does following steps:

  • convert inputs to (or from) selected color spaces
  • compose each channel separately using different method
  • convert output to (or from) selected color space

Parametrization:

  • :switch? - reverse input order
  • :in1-cs - color space for first image
  • :in2-cs - color space for second image
  • :out-cs - color space for output
  • :in1-to?, :in2-to?, :cs-to? - which conversion to select: to color space or from color space
  • :blend-ch1, :blend-ch2, :blend-ch3 - blend methods for each channel
Blend two `Pixels` based on configuration.

The idea is to compose channels separately in different color spaces.

Full flow does following steps:

* convert inputs to (or from) selected color spaces
* compose each channel separately using different method
* convert output to (or from) selected color space

Parametrization:

* `:switch?` -  reverse input order
* `:in1-cs` - color space for first image
* `:in2-cs` - color space for second image
* `:out-cs` - color space for output
* `:in1-to?`, `:in2-to?`, `:cs-to?` - which conversion to select: to color space or from color space
* `:blend-ch1`, `:blend-ch2`, `:blend-ch3` - blend methods for each channel
sourceraw docstring

blend-machine-random-configclj

(blend-machine-random-config)

Random configuration for blend machine.

Random configuration for blend machine.
sourceraw docstring

foldclj

(fold)
(fold {:keys [fields r]})

Folding filter based on vector fields.

Parameters:

  • :fields - vector fields configuration [[combine]]
  • :r - range value 1.0-3.0
Folding filter based on vector fields.

Parameters:

* `:fields` - vector fields configuration [[combine]]
* `:r` -  range value 1.0-3.0
sourceraw docstring

fold-random-configclj

Generate random configuration for vector fields slitscan.

  • r - field range (default 2.0)
  • d - fields configuration depth (default up to 3)
Generate random configuration for vector fields slitscan.

* `r` - field range (default 2.0)
* `d` - fields configuration depth (default up to 3)
sourceraw docstring

imgslicerclj

(imgslicer pixels
           {:keys [distance threshold min-size mode]
            :or {distance v/dist threshold 200 min-size 500 mode :color}
            :as options})
source

mirrorclj

(mirror)
(mirror t)

Mirror image for given (or random) mirroring functions.

Mirror image for given (or random) mirroring functions.
sourceraw docstring

mirror-random-configclj

(mirror-random-config)

Generate random mirroring functions.

Generate random mirroring functions.
sourceraw docstring

mirror-typesclj

Map of names and mirroring functions

Map of names and mirroring functions
sourceraw docstring

pix2lineclj

(pix2line)
(pix2line {:keys [tolerance whole] :as config})

Pix2line effect. Convert pixels to lines.

Parametrization:

  • :nx, :ny - grid size
  • :scale - grid scaling factor
  • :tolerance - factor which regulates when start new line
  • :nseed - noise seed
  • :whole - skip lines or not
  • :shiftx, :shifty - noise shift
Pix2line effect. Convert pixels to lines.

Parametrization:

* `:nx`, `:ny` - grid size
* `:scale` - grid scaling factor
* `:tolerance` - factor which regulates when start new line
* `:nseed` - noise seed
* `:whole` - skip lines or not
* `:shiftx`, `:shifty` - noise shift
sourceraw docstring

pix2line-random-configclj

(pix2line-random-config)

Make random config for pix2line.

Make random config for pix2line.
sourceraw docstring

shift-channelsclj

(shift-channels)
(shift-channels {:keys [x-shift y-shift] :or {x-shift 0.05 y-shift -0.05}})

Shift channels by given amount.

Parameters:

  • :x-shift - shift amount along x axis
  • :y-shift - shift amount along y axis
Shift channels by given amount.

Parameters:

* `:x-shift` - shift amount along x axis
* `:y-shift` - shift amount along y axis
sourceraw docstring

shift-channels-random-configclj

(shift-channels-random-config)
(shift-channels-random-config spread)

Random shift values along x and y axes.

Optionally provide spread parameter to define maximum shift value.

Random shift values along x and y axes.

Optionally provide `spread` parameter to define maximum shift value.
sourceraw docstring

slitscanclj

(slitscan)
(slitscan {:keys [x y] :or {x [(make-random-wave)] y [(make-random-wave)]}})

Create slitscan filter funtion.

Config is a map each axis has it's own list of maps defining waves. Each map contains:

  • :wave - oscillator name (see [[oscillators]].
  • :freq - wave frequency
  • :amp - wave amplitude
  • :phase - wave phase (0-1).
Create slitscan filter funtion.

Config is a map each axis has it's own list of maps defining waves. Each map contains:

* `:wave` - oscillator name (see [[oscillators]].
* `:freq` - wave frequency
* `:amp` - wave amplitude
* `:phase` - wave phase (0-1).
sourceraw docstring

slitscan-random-configclj

(slitscan-random-config)
(slitscan-random-config nx ny)

Create list of random waves for each axis separately.

Optionally you can pass number of waves to create for each axis.

Create list of random waves for each axis separately.

Optionally you can pass number of waves to create for each axis.
sourceraw docstring

slitscan2clj

(slitscan2)
(slitscan2 {:keys [fields r] :or {r 2.0 fields (var/random-configuration 0)}})

Slitscan filter based on vector fields.

Parameters:

  • :fields - vector fields configuration [[combine]]
  • :r - range value 1.0-3.0
Slitscan filter based on vector fields.

Parameters:

* `:fields` - vector fields configuration [[combine]]
* `:r` -  range value 1.0-3.0
sourceraw docstring

slitscan2-random-configclj

(slitscan2-random-config)
(slitscan2-random-config r)
(slitscan2-random-config r d)

Generate random configuration for vector fields slitscan.

  • r - field range (default 2.0)
  • d - fields configuration depth (default up to 3)
Generate random configuration for vector fields slitscan.

* `r` - field range (default 2.0)
* `d` - fields configuration depth (default up to 3)
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close