Pmm Reference Implementation

Aus de_evolutionary_art_org
Wechseln zu: Navigation, Suche

back to Exploring_a_Design_Space_for_Patterns_and_Tilings_Competition_2015

Let $image be an image from which a rectangle part should be cut out and used as prototile for the pmm tile. There are two free parameters needed for the generation of a pmm tile and that is the width $t_w and the height $t_h of the rectangle and there is no need for a mask like the other cases p4m, p3m1 and p6m.


After a rectangle is selected an empty pmm tile is generated for example with transparent background. It has 2 times the width and 2 times the hight of the prototile rectangle:

# GENERATE EMPTY pmm-TILE $tile AS A FUNCTION OF $prototile
$tile_w = 2 * $t_w;										
$tile_h = 2 * $t_h;
$tile->Set(size=>"$tile_w x $tile_h");  print "generate empty tile with tile_w x tile_h = $tile_w x $tile_h \n";
$tile->Read('xc:none');  #$tile->Write(filename=>"$output_meta_folder/tile_AfterGeneration.png");


What follows is a sequence of 4 image processing operations, the CRMT commands that takes a clone of the prototile, rotates it, Flop and/or Flip it and makes a composite operation with compose=>over that includes a translation of the prototile over the tile image. The images are shown in jpg which means that the transparent background is transformed to black.

# CRMT-COMMAND-LIST_01: (C0, x0, y0)
@$prototile_crm = (); 
$prototile_crm = $Shape_list-[0]->Clone(); 
$tile->Composite(image=>$prototile_crm, compose=>'over', x=>'0', y=>'0', color=>'transparent', matte=>'true'); 
$tile->Set(page=>'0x0+0+0');
#$tile->Write(filename=>"$output_meta_folder/tile_after_crmt_01.png");
$tile->Write(filename=>"$output_meta_folder/tile_after_crmt_01.jpg");


Fehler beim Erstellen des Vorschaubildes: Datei fehlt


# CRMT-COMMAND-LIST_02: (C0, Fo, xt_w, y0)
@$prototile_crm = ();
$prototile_crm = $Shape_list->[0]->Clone();
$prototile_crm->Flop();
$tile->Composite(image=>$prototile_crm, compose=>'over', x=>$t_w, y=>'0', color=>'transparent', matte=>'true'); 
$tile->Set(page=>'0x0+0+0');
#$tile->Write(filename=>"$output_meta_folder/tile_after_crmt_02.png");
$tile->Write(filename=>"$output_meta_folder/tile_after_crmt_02.jpg");


Fehler beim Erstellen des Vorschaubildes: Datei fehlt


# CRMT-COMMAND-LIST_03: (C0, Fi, x0, yt_h)
@$prototile_crm = (); 
$prototile_crm = $Shape_list->[0]->Clone();
$prototile_crm->Flip();
$tile->Composite(image=>$prototile_crm, compose=>'over', x=>'0', y=>$t_h, color=>'transparent', matte=>'true');
$tile->Set(page=>'0x0+0+0');
#$tile->Write(filename=>"$output_meta_folder/tile_after_crmt_03.png");
$tile->Write(filename=>"$output_meta_folder/tile_after_crmt_03.jpg");


Fehler beim Erstellen des Vorschaubildes: Datei fehlt


# CRMT-COMMAND-LIST_04: (C0, Fi, Fo, xt_w, yt_h)
@$prototile_crm = ();
$prototile_crm = $Shape_list->[0]->Clone();
$prototile_crm->Flip();
$prototile_crm->Flop();
$tile->Composite(image=>$prototile_crm, compose=>'over', x=>$t_w, y=>$t_h, color=>'transparent', matte=>'true');
$tile->Set(page=>'0x0+0+0');
#$tile->Write(filename=>"$output_meta_folder/tile_after_crmt_04.png");
$tile->Write(filename=>"$output_meta_folder/tile_after_crmt_04.jpg");


Fehler beim Erstellen des Vorschaubildes: Datei fehlt


If the image processing commands were combined and integrated one get a string that codes the building of a pmm tile from a given prototile rectangle:

$CRMT_string = 'C0, x0, y0, C0, Fo, xt_w, y0, C0, Fi, x0, yt_h, C0, Fi, Fo, xt_w, yt_h';

Such a string is written in a txt file and an CRMT-image interpreter, that has be be programmed, should be able to reconstruct the building of a pmm tile from any given rectangle prototile. The gole here is an image interpreter that should be able to build tiles from the command strings that were generated from Evolutionary Algorithms environments in the Patterns and Tilings Competition.

back to Exploring_a_Design_Space_for_Patterns_and_Tilings_Competition_2015