Creating Embroidered Charts with R and ImageMagick

https://news.ycombinator.com/rss Hits: 9
Summary

In my last post, I analysed mine and Rhea's NYT word games for the last two years. Since the analysis is pretty simple (just summaries and aggregates), the time saved by not having to do more in-depth work can be used to think of more interesting ways to show the data. To make my digital work more fun to create and enjoy, I love mimicking real-life objects, textures, and analogies. My latest gimmick this time was trying to make the charts look like they were embroidered into cloth. Since I was already feeling very Christmasy and cozy, an embroidery style felt like the good side-quest to set off on. I’m certainly not the first to try this and if I could actually embroider, I might have just done that! I love this memorable Reuters piece, which features graphics styled as cloth patches. Inspired by that, I wanted to push myself to replicate the look as accurately as possible strictly using code. After many hours, I managed to achieve the look entirely within R and ggplot and heavy use of the ImageMagick library. In this post, I’ll break down the process. It requires some familiarity with CLI tools and code, but that barrier is lower than ever and if you wish you can easily paste this post into an LLM to tailor the code to your specific needs. Why go through the trouble of coding this when there is Photoshop? There seem to be no shortage of ā€˜embroidery actions and filters’ available for free. All of these may be good options, and no one method is better than the other, but for me the answer is always reproducibility. If I built this in Photoshop, every time I updated the dataset or caught a typo in my ggplot code, I would have to re-export the image, open it in Photoshop, and manually rerun an action or apply some filter. That is a recipe for frustration and as far as possible, the ā€œartā€ part of this should be programmatic too. If the data changes, I don’t want to repeat a manual post-processing pipeline 1 I also refuse to use generative AI for anything to do with imag...

First seen: 2026-01-10 12:54

Last seen: 2026-01-10 20:55