27
Arfunkel: Functions for Art Creative Coding Amsterdam 18 February 2016 Eelco den Heijer

Arfunkel - Functions for Art

Embed Size (px)

Citation preview

Page 1: Arfunkel - Functions for Art

Arfunkel: Functions for Art

Creative Coding Amsterdam18 February 2016

Eelco den Heijer

Page 2: Arfunkel - Functions for Art

Introduction

•Arfunkel : Art Functions

•Functions on Images

•Generative Art

•Building Blocks

•Not a Tool: Framework

Page 3: Arfunkel - Functions for Art

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…)

Page 4: Arfunkel - Functions for Art

Functions on Images

create

filter

Page 5: Arfunkel - Functions for Art

blend

split

terminate

Page 6: Arfunkel - Functions for Art

Functions on Functions

•or: Higher Order Functions

• Repeat/ loop (e.g. kaleidoscope)

• If/then/else

• Etc.

Page 7: Arfunkel - Functions for Art

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.

Page 8: Arfunkel - Functions for Art
Page 9: Arfunkel - Functions for Art

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

Page 10: Arfunkel - Functions for Art

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

Page 11: Arfunkel - Functions for Art
Page 12: Arfunkel - Functions for Art

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

Page 13: Arfunkel - Functions for Art

RGB

HSV

CIELAB

Page 14: Arfunkel - Functions for Art

Mirroring • Simple horizontal, vertical mirror

• Sort of Kaleidoscope effect

Page 15: Arfunkel - Functions for Art

Misc

•Several standard, ‘bread and butter’ filters;

• Solarize

• Blur

• Posterize

• Image Segmentation

Page 16: Arfunkel - Functions for Art
Page 17: Arfunkel - Functions for Art
Page 18: Arfunkel - Functions for Art

Workflow ex. 1

Get Image

Get Image

Blend Recolour Solarize

Page 19: Arfunkel - Functions for Art

Workflow ex. 2

Get Image

Get Image

Blend

Recolour

MirrorLeft/Right

Recolour

Page 20: Arfunkel - Functions for Art
Page 21: Arfunkel - Functions for Art
Page 22: Arfunkel - Functions for Art
Page 23: Arfunkel - Functions for Art
Page 24: Arfunkel - Functions for Art
Page 25: Arfunkel - Functions for Art
Page 26: Arfunkel - Functions for Art

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

Page 27: Arfunkel - Functions for Art

Questions? @eelcodenheijer

Tumblr: [email protected]