Colors of Historical Postcards

Wanna take a look at the colors in our historical postcards? Thanks to Laura Wrubel from the George Washington University Libraries in Washington DC, now you can!

We took her code, adapted it to use our postcards as a data source, tweaked the computation algorithm a little, and this is the result:

Details

Laura Wrubel built and shared a Jupyter Notebook, detailing how to download images from the Library of Congress API, how to compute the centroids of 6 color clusters using the k-means clustering algorithm, and how to create a vector graphics representation of that.

If you want to know more about her project for the Library of Congress and her process, take a look at the notebook, the git repository, or take a look at the article she wrote about it.

Tools

The two notebooks we used to create data for the swatch viewer

DescriptionLink

Create Swatches

Create the color swatches you see above; based on Laura Wrubel’s original Notebook

LOC Colors - Production.ipynb

Create JSON

The code we used to create the data for this page

LOC Colors - Data Management.ipynb

Data Sets

Raw data used for the swatch viewer

DescriptionLink

Color Data

CSV with ids and hex color codes

historical postcards - id colors name date.json

Color Data and HTML

CSV with ids, hex color codes and pre-generated HTML

BZ2 GZ ZIP