Upload
eelco-den-heijer
View
228
Download
0
Embed Size (px)
Citation preview
Arfunkel: Functions for Art
Creative Coding Amsterdam18 February 2016
Eelco den Heijer
Introduction
•Arfunkel : Art Functions
•Functions on Images
•Generative Art
•Building Blocks
•Not a Tool: Framework
Me
•Programmer (mainly Java), Creative Coder
•Many projects on Creative Coding
• PhD on Evolutionary Art (2013,CS,VU)
• Studio Heist
•Also like Music Technology (electronic music, generative music, coding…)
Functions on Images
create
filter
blend
split
terminate
Functions on Functions
•or: Higher Order Functions
• Repeat/ loop (e.g. kaleidoscope)
• If/then/else
• Etc.
blending pixels• each pixel consists of 3 components: R,G,B• RGB is a colour space or colour model• Colour space = way to organize or order colors• Well-known colour spaces: RGB, HSV/HSB, HSL,
CMYK, YIC, CIEXYZ, CIELUV,CIELAB etc.
Blending: how?• Blend 2 images:
• Iterate over all pixels (x,y):
• Pixel p1 from image 1, Pixel p2 from image 2:
• Take RGB from both pixels
• Convert to HSV (or any other colour space)
• apply function fi to each channel i (e.g. average, min, max, left, right, etc) : vi=fi(ci1,ci2); see next slide for more details
• Convert back to RGB
Example• Colour space = HSV
• Components c1,c2,c3=Hue, Saturation, Value
• functions: f1,f2,f3=min, max, avg
• New pixel:
• huenew=min(hue1,hue2)
• satnew=max(sat1,sat2)
• valnew=avg(val1,val2)
• Convert from hsv back to RGB
Recolouring• Changing the colours in an image
• Used for image repair, fixing lighting issues, or artistic purposes
• Several algorithms possible, often with source image and target image
• Channel shift algorithm
• Convert RGB to HSV (or any other colour space)
• Take value of each channel, shift predefined value
• Ensure you do not cross boundary values
RGB
HSV
CIELAB
Mirroring • Simple horizontal, vertical mirror
• Sort of Kaleidoscope effect
Misc
•Several standard, ‘bread and butter’ filters;
• Solarize
• Blur
• Posterize
• Image Segmentation
Workflow ex. 1
Get Image
Get Image
Blend Recolour Solarize
Workflow ex. 2
Get Image
Get Image
Blend
Recolour
MirrorLeft/Right
Recolour
Conclusions & Future work• First Scala, now Java 8
• Heavy use of ‘lambdas’
• Pretty flexible, still prototype
• More weird recolouring (colour transfer)
• Higher order functions
• Colouring (grayscale to colour)
• Grammar; Little Language (my own Processing)
• REPL: Read-Eval-Print Loop