Posts

Showing posts with the label python

Evolving an image, part II - image rendering

The second installment in the series on evolving an image with trianges. In this post I will focus on the rendering of the actual image, both for rendering and scoring. Other parts of this series are: Make a generator for the genome. Translate genome to a rendered image. Score the rendered image and compare for evolution. (Optional) Possible optimizations. Scoring generations is done by comparing their matrix representations. At the start of the project I started pretty much blank on the rendering of polygons in python. The Pillow package is primarily meant for graphical implementations, not matrix algebra. My path of drawing polygons on a canvas and then turning the canvas into a matrix representation could just as easily have been reversed. When everything was implemented, the performance wasn't optimal and I looked into mathematical generation of polygons with the shapely module. For now, let's focus on drawing polygons on the canvas. python; genomeGenerator.py ...

Evolving an image, part I - genome generation

Image
This will be the first post in a series on a simple evolutionary algorithm. The inspiration comes from several blog posts, but primarily from Roger Johansson and Chris Cummins . I haven't really dug through this code, but just started replicating what they wrote and the images they generated. Credits to Pierre Lindenbaum for this image. The plan right now is separated in this rough outline. This is the first instalment, with a focus on generating the data structures that represent a generated image. Make a generator for the genome. Translate genome to a rendered image. Score the rendered image and compare for evolution. (Optional) Possible optimizations. For starters, let's generate random polygons. They have a shape, and a colour. I've decided for now on sticking to just one kind of polygon, the triangle. Perhaps in a later version there could be polygons with more edges, but I'm curious how good generated images could turn out with just triangles. A...

MySQL shortcuts and icons

Image
Having a SQL server available always comes in handy. There are many implementations, most of which are at least partly freely usable. Previously I've worked with an enterprise installation of Windows Server 2008 R2. For my needs, just a stripped down server will suffice. At the time I installed MySQL server, MySQL was probably the most popular open source SQL application. Ever since I've stuck with MySQL. The choice doesn't really matter in terms of functionality, it's just what I've grown accustomed to. With a fresh install of my pc, I had to reinstall MySQL server as well. I always chose for the MySQL Community Server installer, which includes all the MySQL products. This time I wanted a more simple installation, because I realised I didn't really ever use any of the included products. With just the server installed, I also thought it would be neat to optimise my resource usage. By default the MySQL server starts when Windows starts up. This of course isn...