Various glitching pixel filters or functions
Use following filters with [[filter-channels]] function.
Short sketches operating on images/pixels.
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.
(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:
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 channelBlend 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-machine-random-config)
Random configuration for blend machine.
Random configuration for blend machine.
(fold)
(fold {:keys [fields r]})
Folding filter based on vector fields.
Parameters:
:fields
- vector fields configuration [[combine]]:r
- range value 1.0-3.0Folding filter based on vector fields. Parameters: * `:fields` - vector fields configuration [[combine]] * `:r` - range value 1.0-3.0
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)
(mirror)
(mirror t)
Mirror image for given (or random) mirroring functions.
Mirror image for given (or random) mirroring functions.
(mirror-random-config)
Generate random mirroring functions.
Generate random mirroring functions.
Map of names and mirroring functions
Map of names and mirroring functions
(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 shiftPix2line 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-random-config)
Make random config for pix2line.
Make random config for pix2line.
(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 axisShift channels by given amount. Parameters: * `:x-shift` - shift amount along x axis * `:y-shift` - shift amount along y axis
(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.
(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).
(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.
(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.0Slitscan filter based on vector fields. Parameters: * `:fields` - vector fields configuration [[combine]] * `:r` - range value 1.0-3.0
(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)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close