. .
CREATE OR DIE Special Downloads Shop webinale

Schauplatz

Artikel
  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Juni 2009

Generative Kunst

Prozessuales Pinselschwingen

(Link zum Artikel: http://www.createordie.de/cod/artikel/2375)

Der Künstler ein Coder, der Abarbeitungsalgorithmen für sich selbstorganisierende oder autonome Farbkleckse entwickelt.

Text: Frank Reitberger

Respektable, mit Flash erstellte und generative Kunst ist heute dank der Arbeiten von Eric Natzke, Joshua Davis oder Mario Klingemann absolut en vogue. Dabei steht bei dieser zeitgenössischen Form des kreativen Schaffens mehr der Entstehungsprozess als das tatsächliche Endprodukt im Fokus.

Das heißt, die eigentlich kreative Phase liegt zuvor in der Entwicklung eines Programms, das Abarbeitungsalgorithmen sowie geordnete oder chaotische Systeme und Regeln festlegt, wodurch sich die prozessualen Farbkleckse danach selbstorganisiert und meist autonom entfalten können. Das daraus resultierende Ergebnis ist quasi immer ein Unikat und gleicht meist niemals 1:1 einem weiteren Bild aus derselben Programmreihe.

Grundlegendes

Generative Kunst muss im Ergebnis nicht zwangsläufig in einem Bild enden, sondern kann als Konzept in ihrer Form auch auf Sprache, Musik oder als Regelcodex für ein Schauspiel angewendet werden. Legen wir uns zuerst einmal auf Folgendes fest: Als Grundlage dient uns ein Bild, das durch unsere Systeme in immer neuen Kompositionen arrangiert wird. Vorweg also ein kleines Basis-Setup, in dem wir kurz definieren, welches Bild als Vorlage dienen soll und welches System wir zum Zeichnen verwenden (Listing 1).

  1. package {
  2. ///////////////////////////////////
  3. // import used classes
  4. ///////////////////////////////////
  5. import flash.display.StageQuality;
  6. import flash.display.Sprite;
  7. import flash.display.DisplayObject;
  8. ///////////////////////////////////
  9. // class
  10. ///////////////////////////////////
  11. public class Main extends Sprite {
  12. private var core :CoreCanvas;
  13. ///////////////////////////////
  14. // class constructor
  15. ///////////////////////////////////
  16. public function Main() {
  17. core = new CoreCanvas();
  18. core.launch( this );
  19. stage.quality = StageQuality.LOW;
  20. }
  21. }
  22. }
  23. import flash.display.Bitmap;
  24. import flash.display.BitmapData;
  25. import flash.display.DisplayObjectContainer;
  26. import flash.display.Sprite;
  27. class CoreCanvas {
  28. [Embed(source = '../library/frankLisa.jpg')]
  29. private var img:Class;
  30. private var container:DisplayObjectContainer;
  31. private var paintNode:Sprite;
  32. private var bmp:Bitmap;
  33. private var canvas:Bitmap;
  34. private var imgMap:BitmapData;
  35. private var canvasMap:BitmapData;
  36. private var rndGeoms:RndGeoms;
  37. private var gSystem:Number = 1;
  38. private var w:int = 406;
  39. private var h:int = 563;
  40. ///////////////////////////////////
  41. // class constructor
  42. ///////////////////////////////////
  43. public function CoreCanvas():void { }
  44. ///////////////////////////////////
  45. // launch
  46. ///////////////////////////////////
  47. public function launch(
  48. container:DisplayObjectContainer ):void {
  49. this.container = container;
  50. this.paintNode = new Sprite();
  51. this.imgMap = new BitmapData( this.w,
  52. this.h, false, 0x000000 );
  53. this.canvasMap = new BitmapData( this.w,
  54. this.h, true, 0x00000000 );
  55. this.imgMap.draw( new img() as Bitmap );
  56. this.bmp = new Bitmap( this.imgMap );
  57. this.canvas = new Bitmap( this.canvasMap );
  58. this.container.addChild( this.bmp );
  59. this.container.addChild( this.canvas );
  60. paint();
  61. }
  62. ///////////////////////////////////
  63. // paint: current.system
  64. ///////////////////////////////////
  65. private function paint():void {
  66. if ( this.gSystem == 1 ) {
  67. this.rndGeoms = new RndGeoms();
  68. this.rndGeoms.launch( this.paintNode,
  69. this.imgMap,this.canvasMap,this.w,this.h);
  70. }
  71. }
  72. }
Das Regelwerk

Wie einfach oder komplex ein System letztendlich ist, haben wir beim Entwickeln natürlich selbst in der Hand. Legen wir uns für dieses Mal darauf fest, dass wir uns per Script kontinuierlich eine zufällige X-Y-Koordinate auf dem Ausgangsbild auswählen und dort den Farbwert des Pixels auslesen. Diesen Wert benutzen wir für die Füllung definierter Formen aus dem Flash Graphics API, die wir anschließend wiederum in ein neues Bitmap zeichnen. Bei den zu zeichnenden Formen habe ich bereits ein kleines "preset" im Array modes vordefiniert:

  • • FreeLines: Linien mit einer zufälligen Länge
  • • StructLines: immer gleich lange Linien
  • • Circles: Kreise mit unterschiedlichem Radius
  • • FineSquares: kleine, unterschiedlich dimensionierte Rechtecke
  • • BigSquares: große Rechtecke mit unterschiedlichem Durchmesser
  • • StructSquares: immer gleich große Rechtecke
  • • StampedSquares: unterschiedlich dimensionierte, innen offene Rechtecke

Die Anzahl der Formen kann selbstverständlich nach Belieben bequem erweitert werden (Listing 2, Abb. 1).

  1. package {
  2. ///////////////////////////////////
  3. // import used classes
  4. ///////////////////////////////////
  5. import flash.display.Sprite;
  6. import flash.display.BitmapData;
  7. import flash.events.Event;
  8. ///////////////////////////////////
  9. // class
  10. ///////////////////////////////////
  11. public class RndGeoms {
  12. private var rootNode :Sprite;
  13. private var imgMap :BitmapData;
  14. private var canvasMap :BitmapData;
  15. private var w :int;
  16. private var h :int;
  17. private var i :Number;
  18. private var j :Number;
  19. private var modes :Array = new Array(
  20. "FreeLines", "StructLines", "Circles", "FineSquares", "BigSquares", "StructSquares", "StampedSquares" );
  21. private var rnd :Function = Math.random;
  22. private var u :Number = Math.round(
  23. rnd() * modes.length-1 );
  24. private var system :String = "strict";
  25. private var mode :String = "Circles";
  26. private var level :String = "plain";
  27. private var order :String = "strict"; /
  28. private var blend :String = "normal"; private var anim :Boolean = false;
  29. ///////////////////////////////////
  30. // class constructor
  31. ///////////////////////////////////
  32. public function RndGeoms():void { }
  33. ///////////////////////////////////
  34. // launch
  35. //////////////////////////////////
  36. public function launch( rootNode:Sprite, imgMap:BitmapData, canvasMap:BitmapData, w:int, h:int ):void {
  37. this.rootNode = rootNode;
  38. this.imgMap = imgMap;
  39. this.canvasMap = canvasMap;
  40. this.w = w;
  41. this.h = h;
  42. init();
  43. }
  44. ///////////////////////////////////
  45. // initialize
  46. ///////////////////////////////////
  47. private function init():void {
  48. this.rootNode.addEventListener( Event.ENTER_FRAME, onUpdateFrame );
  49. }
  50. ///////////////////////////////////
  51. // onUpdateFrame
  52. ///////////////////////////////////
  53. private function onUpdateFrame( event:Event ):void {
  54. this.i = this.rnd() * this.w;
  55. this.j = this.rnd() * this.h;
  56. var w_x:Number;
  57. var w_y:Number;
  58. if ( this.level == "plain" ) {
  59. this.rootNode.graphics.clear();
  60. if ( this.mode == "FreeLines" ) {
  61. this.rootNode.graphics.lineStyle( 10, this.imgMap.getPixel( i, j ) );
  62. this.rootNode.graphics.moveTo( i, j );
  63. this.rootNode.graphics.lineTo( i + this.rnd() * 19, j +this.rnd() * 19 );
  64. } else if ( this.mode == "StructLines" ) {
  65. this.rootNode.graphics.lineStyle( 14, this.imgMap.getPixel( i, j ) ); this.rootNode.graphics.moveTo( i, j ); this.rootNode.graphics.lineTo( i + 12,j + 12 );
  66. } else if ( this.mode == "Circles" ) {
  67. this.rootNode.graphics.beginFill( this.imgMap.getPixel( i, j ), 1.0 );
  68. this.rootNode.graphics.drawCircle( i, j, 4 + this.rnd() * 20 );
  69. } else if ( this.mode == "FineSquares" ) {
  70. this.rootNode.graphics.beginFill( this.imgMap.getPixel( i, j ), 1.0 );
  71. this.rootNode.graphics.drawRect( i, j, 4 + this.rnd() * 6, 4 + this.rnd() * 6 );
  72. } else if ( this.mode == "BigSquares" ) {
  73. this.rootNode.graphics.beginFill( this.imgMap.getPixel( i, j ), 1.0 );
  74. this.rootNode.graphics.drawRect( i, j, 14 + this.rnd() * 26, 14 + this.rnd() * 26 );
  75. } else if ( this.mode == "StructSquares" ) {
  76. this.rootNode.graphics.beginFill( this.imgMap.getPixel( i, j ), 1.0 );
  77. this.rootNode.graphics.drawRect( i, j,20, 20 );
  78. } else if ( this.mode == "StampedSquares" ) {
  79. w_x = 10 + rnd() * 20;
  80. w_y = 5 + rnd() * 10;
  81. this.rootNode.graphics.lineStyle( 4, this.imgMap.getPixel( i, j ) );
  82. this.rootNode.graphics.moveTo( i, j );
  83. this.rootNode.graphics.lineTo( i + w_x, j );
  84. this.rootNode.graphics.lineTo(i+w_x,j+w_y );
  85. this.rootNode.graphics.lineTo( i, j + w_y );
  86. this.rootNode.graphics.lineTo( i, j );
  87. }
  88. }
  89. this.canvasMap.lock();
  90. this.canvasMap.draw( this.rootNode );
  91. this.canvasMap.unlock();
  92. }
  93. }
  94. }

 

Kommentare
Bisher keine Kommentare
Neuer Kommentar
  • Gute Kommentare werden belohnt.
  •   (optional)
  •   (Kommentar abonnieren/Gravatar - wird nicht veröffentlicht)
  •    Benachrichtige mich bei nachfolgenden Kommentaren per E-Mail
  • -+
Tags
Werbung