![]() The key is to collect a library of tiles that will allow sufficient diversity so that the program can make good contrast choices. However, there’s a catch not all pictures have a base resolution that is amenable to being scaled down.īuilding a photo mosaic is really an R-tistic thing to do. Fortunately, the package has a utility for doing this. If you have an extensive library of tiles (I had over 600 in this instance), it is possible - but ill advised - to try to adjust their sizes manually. Second, there is an R-tistic balance between the size of the base image and the size of the tiles some experimentation is necessary. I (somewhat embarrassingly) discovered this by having my R instance return a cannot allocate vector of size 9GB error 1. While this is simple enough, there are a few thing to consider.įirst, the dimension of the resulting image will be (in pixels) approximately the base image expanded by the tiles for instance, if the base is 150x150, and the tiles are 30x30, the resulting image will be 4500 x 4500. If properly chosen, a close-up view will focus on the tiles, but at a distance the base image will emerge. The advantages to using R for this project (as well as other things) is that it allows for the creation of bespoke solutions in other words, I don’t want just any photo mosaic, but rather one that has the attributes that I want.Īfter a quick stack overflow / CRAN search, I found the RsimMosaic package which gave me the tools I was looking for.īasically, the tools in this package take a base image and replace each pixel with a tile. While there are both free and commercially available solutions, my first choice, of course, was to find an R-centric solution. When we finished our report, my coauthors asked for suggestions on cover art, I naturally suggested we create a photo mosaic. All the while, I’ve been increasing the amount of time I spend on graphics, particularly within the ggplot2 construct, as well as color scales provided by the ggsci package (there are Simpsons and Futurama color palettes)! At some point over the summer, my interest in developing graphics began to inspire my R-tistic side, which I wrote about in INFORMS/Analytics magazine this summer.Īll of last year, I worked on a project titled ‘Mosaic’. ![]() From there, I Replaced my word processor and slide software with markdown. I started by using R for all the things that I previously did with spreadsheets - a great way to learn your way around the magrittr and dplyr packages. I’ve been a dedicated useR for the past 4 years. I’m also going to touch on some of the implications of the R license, which underlies our entire ecosystem, but we don’t usually think about that often. In this short piece, I’m going to discuss a fun photography project I did over the winter using R. Harrison Schramm, CAP, PStat, is a Senior Fellow at the Center for Strategic and Budgetary Assessments.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |