Here's how it looks "in action": the image on the left is the 'source', on the right is the evolving polygon 'dna' (it gets gradually better as the dna evolves):
Actually that image is probably too complex to be a great example, sorry.
Anyway, that's old news. This post is because I've added a little piece of code to the 'ecosystem': a viewer for the .DNA files that also lets you save a high-resolution JPG copy. It was inspired by a couple of comments asking about exporting the images.
This is what the DNA Viewer looks like - on the left is a Xaml rendering, on the right is an Image. They both look the same - the interesting bit is comparing the code that generates each of them
The Image is generated by the existing
Rendererclass in Roger's source (which is also the logic used to save the JPG); the Canvas version uses a new (although very similar)
WpfRendererclass. From that it was trivial to create the
XamlRendererwhich outputs a .xaml file which can be used to view the GenArt creation in Silverlight!
You can download a GeneticDNAViewer_1.0.zip (16Kb) ZIPped exe to play with, or the WpfApplication itself can be reconstructed with the original source and these c# files:
You can test it by unZIPping operahouse6.dna.zip and opening the .dna file inside. I've uploaded a 3200x2032 copy of the image on Flickr to demonstrate the high-resolution output.
FYI, the relative file sizes are:
- operahouse6.dna 51.4Kb
- scene.xaml 17Kb
- operahouse6.jpg 371Kb
p.s. Roger has posted subsequent performance-related posts on EvoLisa, but I'm not sure he's released the source for them yet.
UPDATE [17-Feb-09] another example:
Opera House by day .DNA 49Kb (ZIPped 17Kb)
Opera House by day (Silverlight 17Kb)
Opera House by day (Flickr 1920x1440 162Kb)
While I was testing the new 'DNA', I added
SvgRendereras well (needs updated
Window1.xaml.cs). At first it didn't seem to work (left image) because I couldn't figure out how to make the background black. Decided to draw a big black rectangle behind the rest (bit of a hack, but it works). You can view operahouse_day.svg.xml (21Kb) in Firefox.