Share My Creation [B4J][B4XPages] Artifying an image - creating an impressionistic effect.

I needed this when I was developing a personal project: 'A Virtual Train Set'.
I have a large screen monitor, and I thought that I would animate trains on it from a bird's eye view.
There would be tracks in a terrain with various types of trains running on them according to a specified schedule.
Perhaps a clock, a schedule board, some sound effects, whistle blowing, some background music. Peaceful and fascinating.

Obviously, the size of trains and tracks would be exaggerated, and the clock would move at one second per real-time minute.
In other words, more narrative then realistic. I needed background scenery - but also not too realistic.
I tried drawing a cartoon-like setting. But my drawing skills are not up to that.
Then I experimented with a variety of techniques for transforming existing images to a more abstract form.
Here is the result of this experimentation.

Start with any image.
Select 5000 random 15x15 rectangles, for each rectangle:
a. compute average color (mean Red, mean Green, mean Blue)
b. from the rectangle's center follow 9 vectors angled in steps of 36 degrees
c. when the vector's color deviates from the average by some threshold, mark that point
d. make a shape defined by these points and fill it with the average color
Save the result as a .jpeg file
On my computer, all this takes about 5 seconds.

The images below are the artification of birds-eye views of three areas of the world.
As a result of the algorithm, details (towns, town names, roads, feature names, etc.) in the original image are gone.
There is retention of color, but in the form of irregular patches, somewhat like an impressionist's brush strokes.

The three images below have all been created by this algorithm.
They illustrate how the terrain color is dramatically different between areas.

Interlaken, Switzerland, has blue lakes and variegated light-blue-green snow topped mountains.

Interlaken.jpeg


Jalpaiguri, Northern India, has the dark green Himalayan foothills to North, broad rivers, and rich vegetation.


Jalpaiguri.jpeg


South Africa, southern part, has a desert center surrounded by large sharp rocky cliffs, and green areas to the south.

SAfrica.jpeg


Inside these broad color themes there is fantastic variation in color tones, due to light reflecting from different surfaces.

The zip file below contains the source file for the artification algorithm.
I have left out the original images for size consideration, and because some of the media may need permission for dissemination.
If you want to experiment, get an image (.png or .jpeg) of something and run it through the artifier.
Try changing some of the parameters, let me know if you get some interesting effects.
 

Attachments

  • Artification.zip
    10.7 KB · Views: 130
Top