All notable changes to this project will be documented in this file. This change log follows the conventions of keepachangelog.com.
OHTA
conversion should coerce input to colorIgPgTg
normalized conversion fixedHCL
conversion fixed (uncached case)- eastwood related fixes
custom-event
andfire-custom-event
to allow firing an event from the code
apply-theme
to generate random color from a given color and theme definitionwhiten
andblacken
to-XYZ1
,from-XYZ1
not scaled version (range from 0 to around 1)scale
3 or 4 channels by a value (to easier normalize rgb), alsoscale-up
,scale-down
- new colorspaces from colour:
- more from
Oklab
family:Okhsv
,Okhsl
andOkhwb
DIN99
color space family::DIN99
,:DIN99b
,:DIN99c
,:DIN99d
and:DIN99o
reduce-colors
can accept a distance (as function orfastmath.distance
object),clarans
algorithm is used then (instead ofxmeans
).clarans
path is very slow though.- path definition accepts winding rule and shape appending
- certain shapes can accept coordinates as vectors
:onrepaint
refresher type for a window, leaves repainting a window for AWT. Good when you want to diplay a static image.:position
argument for window creation, sets location of the window in desired position.mixbox
pigment-based color mixing by Secret Weaponsgrid-qr-cell
to allow draw grid cells inq,r
coordinate systemclj-kondo
configs
Oklab
should use linear RGB not on sRGBUCS-OSA
color space should have different order ofg
andj
channels.IPT
should operate on not scaled XYZ- missing palettes from
:nord
LDRenderer
with filtering should draw on borders- [breaking]
to-lch
andfrom-lch
renenamed toto-luma-color-hue
andfrom-luma-color-hue
#21
LDRenderer
revisited- added new
to-pixel
modes:linear?
(default:false
), whentrue
turns offlog
scalingsplats?
(default:false
), whentrue
averages pixel's values only
vibrancy
is1.0
by default (was0.5
)- contrast/saturation/brightness don't affect background now
- changed internal splat representation (as a number from
0.0
to1.0
)
- added new
show-image
(and other functions inclojure2d.extra.utils
) uses:onrepaint
refreshing strategy by default.
- Dependency to
smile-mkl
is removed.openblas
seems to be enough for current functionality. This makes a package lighter (1GB -> 250MB).
- Clojure 1.11.0
shape
introduced (all primitives have additiona shape version) + functions:bounding-box
,intersects-rectangle?
,contains-point?
andcontains-rectangle?
shape->path-def
andpath-def->shape
to construct path from a definition and backtext-shape
returns shape of the textload-font
loads fonts from a fileload-image
,load-svg
andload-bytes
can load from http URLs now- PalettonHSV, RYB, XYB and Oklab color spaces
- Dictionary of Colour Combinations - colors and palettes (prefix
:docc
) - https://github.com/mattdesl/dictionary-of-colour-combinations - Color Vision Deficiency
cvd-lens
function (a filter) mixsub
subtactive mixingadjust
adds a value to color channelcomplementary
to find complementary colorrandom-color
can select from various presets, also selects colors from palettes and known colorswavelength
returns color from light wavelength in nmclojure2d.color.cssgram
set of instagram-like filters +custom-filter
function- many more color difference functions
:retina
hint added to support high density displays (first attempt, things might not work well)
- LDRednerer is aware of alpha channel now
palette
should return a vector in every casepath
points should be any seq (not vector only)possible-color?
should recognize String as a valid colorHWB
colorspaces fixed to ensure reversibility- canvas orientation shift
- color difference functions revisited and reorganized
load-url-image
- useload-image
- fastmath deps updated
- deps updated
- deps updated
- Introduced cpt-city palettes and gradients
- Introduced paletteer palettes and gradients
- Updated fastmath and batik deps
- Refactor to load gradients and palettes dynamically
- [breaking] due to the number of palettes/gradients,
find-palette
andfind-gradient
should be used to find names.
compose-channels
applies alpha blending by default when alpha channel processing is turned off.
- internal core optimizations (fn -> macros)
- deps updated
lerp-
color interpolator
possible-color?
catches gradientiq-gradient
wrong interpolation between two colors
- mathematica gradients (thanks to Chris N.)
palette
helper functiontemperature
to convert black-body emissions to colorget-channel
,set-channel
,modulate
- to manipulate channels in selected color spacerelative-luma
(WCAG version)- more String as color (single letter, triplets, #rgba)
- correct-lightness for gradient and palette
- deps bumped
- pixels mutating functions are now with
!
- [breaking] all blending functions moved to separate namespace and reweritten from the scratch
- [breaking] changed API for certain color functions. Especially for [[palette]] and [[gradient]]
- Signal processing - moved to fastmath
- palette/gradient presets as vars (use [[palette]] or [[gradient]] to access them)
- Closing window during
draw
can cause NPE when accessing global state. HCL
is now proper HCL by Sarifuddin and Missaou (to use CIELab version use LCH)brighten
/darken
andsaturate
/desaturate
corresponds to chroma.js nowmix
corresponds to chroma.js nowcontrast-ratio
reflects WCAG definition
:always-on-top?
parameter to set window to be on toporient-canvas
- axis orientation functionsfilter-channel
,filter-channel-xy
,blend-channel
andblend-channel-xy
can accept function as a parameter single parameter (acts a partial)..set-composite
andcomposite
to compose drawing with canvas by Java2d, see java.awt.Composite- new window parameter,
:background
set panel background color - bounding box for given text
load-url-image
to handle loading from URLpattern-mode
to set textured fill for shapes- Gradient density rendering
- BREAKING: by default canvas is fully transparent. Window background is set to white. This is made to match html canvas behaviour.
- BREAKING:
set-background
uses SrcOver (default) composite. Previously was Src.
- thi.ng/color dependency
- Bring window to top // (still doesn't work well)
- Headless mode fix
- Blur algorithm rounding (ghosting effect)
- Native color conversion
from-
was clumping an input
- grid cells
- hex primitive
- quadtree segmentation now uses low-discrepancy sequence generator
- reconstruction filters spread parameter
- Hann reconstruction filter
- reconstruction filters default values
- refactored renderer, breaking change: intensity is now vibrancy and acts opposite way
- reconstruction filters errors
pack
color into 32 bit integerresize
Pixels- 4 new color spaces: IPT, LMS, JAB, JCH
- new palettes and gradient
- new color distance based on JAB
- list of all predefined colors, palettes and gradients have separate docs
reduce-colors
- selects color from cluster usingmode
rather than centroid- html-color* -> named-color*
Pixels
can be treated as sequence now (sequence of colors)reduce-colors
using x-means clustering algorithm
iq-gradient
accepts also two colors (https://github.com/thi-ng/color/blob/master/src/gradients.org#gradient-coefficient-calculation)load-svg
andtranscode-svg
added
merge-renderers
can merge any number of renderers (previously only two).iq-random-gradient
also usesiq-gradient
for two colors generated by paletton generatorrandom-gradient
uses also iq-random-gradient functionfilled-with-stroke
is macro now- removed dependency to
Vec2
in some functions inclojure2d.core
random-gradient
will use only two interpolators (:cubic and :linear) to avoid exceed of the range
- arc and rarc (radius arc) functions
- spots overlay - number of spots heuristic changed
Please note - breaking changes!
- key-pressed? mouse-pressed? (and other event values) functions available in
draw-fn
(via Window protocols) - lerp in color (to interpolate colors)
- set-stroke-custom - to set custom stoke pattern
- to-XXX* / from-XXX* are now normalized (0-255) colorspace conversion functions.
- color distances
- color interpolators
- color preset palettes (Brewer, Tableaus, Microsoft)
- color gradients
- color tweaking functions
- font-ascent
- thi.ng rgba interoperability
- project dependencies to external
generateme/fastmath
library - to-luma -> luma, get-hue -> hue
- hue returns angle (0 - 360)
- make-color, make-awt-color, make-canvas, make-2d-...-array changed to names without
make-
prefix - make-pixels -> pixels
- make-effect* -> effect
- almost all make- in raymarching are changed to version without prefix
resize-image
andresize-canvas
are now moved to ImageProto asresize
- xor-mode, gradient-mode are reset with paint-mode
- to-XXX/from-XXX in colorspaces are raw conversions now
- YXY renamed to Yxy
- make-color-converter -> color-converter
- paletton-palette -> paletton
- signal processing refactored, api changed
- overlays refactored
- glitch scripts refectored, api changed
Prefix make-
is reserved when function is created.
- set-font works now
- math namespaces moved to
generateme/fastmath
project - examples moved to separate repository
with-canvas
is no longer threading macro (usewith-canvas->
for that):setup
parameter added toshow-window
. It's run before displaying window. Parameters are: canvas (within context) and window. When returned value is notnil
it's used as initial state. In other case:draw-state
parameter is used.- color can be represented as int (eg. in hex form like: 0x234344)
clamp255
returns double, for long version calllclamp255
- bezier and curve functions added
- date/time functions (year, month, day, hour, minute, sec, millis, nanos)
- new function
filled-with-stroke
- to draw primitive with stroke and filled load-bytes
added- general key-event added (like mouse-event). You can now dispatch also on event type not only key char or code
- background supports transparency
- screen-width and screen-height functions
- threshold filter wrong values
draw
now displays exception when something is wrong- window canvas was in the bad size causing visual artifacts
- more accurate frame delay calculations
with-canvas
is renamed towith-canvas->
:highest
hint added (it's:high
with Stroke Pure)- :right, :left or :center alignments for text (last parameter, default :left)
rendering-hints
is map of vectors now, it gave 25% speed gain during recreating graphics context
- Vcf303, Echo and BassTreble signal processing effects + example 16 updated
- key-released and key-typed events added
- fractal bestiary explorer - example 37
- path-bezier - bezier spline
- text and font functions
- Java2D convolution filters (via (convolve ...)), returning image
- Expectations Tests
- ArrayVec type - doubles array vector representation (for speed gain)
- Overlays API changed to image + configuration map
- Switched from clojure math to primitive math library
- FastMath bindings changed to macros for several methods
- Saving picture moved to image protocol, replaced save-canvas and save-pixels removed (call (save canvas name)).
- KeyEvent protocols
- vector scale -> set-mag
- fixes after tests
- rgb scanlines bad tint values
- subpixel accuracy for strokes included in :high canvas profile
- New overlay - crt scanlines
- Events and Window carry global state,
show-window
parameters reorganized.
- Canvas transformations (transpose, rotate, scale, push/pop matrix)
- Image protocol (get-image, width and height fns) for Window, Canvas, image, Pixels
- Mouse position protocol to Window and MouseEvent
- Nature of Code examples
- html 140 colors defined in color namespace (access by (c/to-color :name) or (set-color canvas :name))
- point and line drawing function accept Vec2 coordinates as well
- more variations
- clojure2d temporary icon
- Canvas as a type
- Window as a type (record)
- Helper functions to check if window is visible
- Helper function to get image from canvas and window
- Color manimulations refactored (awt vs vec4)
- Complex type is Vec2 now
- Session management refactored
- Draw function accepts also Window (to access mouse position)
- Examples revisited
- Signal processing optimisations - speed gain 2x
- Core:
- session management functions
- Pixels:
- accumulation bins rendering support
- Random:
- random and low discrepancy sequence generators (binding to apache commons math)
- Color:
- color converters
- palette generators (paletton style, colourlovers 200 palettes, iq generator)
- Extra:
- glitch functions - slitscan, mirror, color redutions, bleding
- raymarching - basic raymarching
- signal - signal processing for sonification (pixels to raw, raw to pixels converters, wave generators)
- Examples: currently 32 examples
- A lot of changes and huge number of code optimizations (for speed)
- Draw function behaviour
- Canvas wrapper (Graphics2d allocation and release)
- Mouse moved event
- JPanel -> java.awt.Canvas and custom paint function
- Vectors as Seq + PersistentVector enhanced (VectorProto)
- filters changed to signal ns
Bugs, bugs, bugs + optimization for speed
- Initial release
- Core:
- image load/save
- display window
- basic canvas operations
- Pixels:
- operate on pixel and channel level
- basic filter
- blending functions
- Math:
- jafama FastMath lib
- random functions based on Apache Commons Math
- noise functions based on flow-noise and joise
- statistic functions
- Complex type
- Color:
- various blending methods
- Extra, place for common functions used in glitch/generative process
- filters.clj - analog filters (for sonification)
- overlays.clj - rgb scanlines, noise, spots
- segmentation.clj - divide image into squares
- variations.clj - fractal flames variation libarary (vector fields)
- Examples: 13 examples