What would impressionnists do with R ?

November 12, 2010
By

(This article was first published on Romain Francois, Professional R Enthusiast, and kindly contributed to R-bloggers)

I've been playing with images recently, probably inspired from my trip in San Francisco. There was an exhibit at the De Young museum of fine arts with pieces borrowed from the Musée d'Orsay. I did not go to the exhibit because it is easy enough for me to just go to Paris and the Musée d'Orsay, but I guess this somewhat inspired me, along with the golden gate bridge, to do some R based impressionnism

The starting point is this picture of the golden gate bridge

goldengate.png

The png package makes it straightforward to import png pictures into R (There are other ways as well).

Then, I generate randomly spaced circles so that they don't overlap, and fill each circle with the average color (on the RGB space) of all te pixels that are inside the circle

circles-1.png circles-2.png
circles-3.png circles-4.png

Then I do this many times, with translucent circles, and after some iterations ,the golden gate bridge starts to reveal itself

goldengate-circles.png

The code for this is included below

Here are other examples

google-circles.png

apple-circles.png

To leave a comment for the author, please follow the link and comment on his blog: Romain Francois, Professional R Enthusiast.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: ,

Comments are closed.