Ruby script to download wallpapers from the collection of the Metropolitan Mueum of Art. By default downloads a 1920x1080 image with a black background behind the original image and a white caption of the title, artist, and year of the work.
- Ruby version 2.3 or later
- Bundler
- ImageMagick version 6.7.7 or later. Installation instructions (for use with Rmagick) can be found here
- A copy of
MetObjects.csv
from the The Metropolitan Museum of Art Open Access repo placed in the directory where you run this script
Run bundle install
(once) to download dependencies.
Run with ruby met_wallpapers.rb
Wallpapers will be downloaded into a ./wallpapers
folder, and the script will run until the limit paramter is reached or all matching images are downloaded.
In order to download a specific work, you can use the --id
option. You can search through the catalog on the Met Musem website. The id can be found in the URL of the individual work after /search/
. For example, in order to download https://www.metmuseum.org/art/collection/search/459116, run ruby met_wallpapers.rb --id 459116
.
Option | Default | Description |
---|---|---|
--id |
Download a specific work | |
--width |
1920 |
Wallpaper output width, in pixels |
--height |
1080 |
Wallpaper output height, in pixels |
-l , --limit |
Limit number of wallpapers downloaded | |
-d , --department |
Filter to museum department in this list | |
--landscape |
false |
Restrict to landscape orientation images only |
--portrait |
false |
Restrict to portrait orientation images only |
--background-color |
'black' |
Wallpaper background color string, e.g. '#0c1087' , 'pink' |
--text-color |
'white' |
Caption text color string, e.g. '#0c1087' , 'pink' |
-h , --help |
Show help menu |
ruby met_wallpapers.rb
ruby met_wallpapers.rb --width 1080 --height 1920
ruby met_wallpapers.rb --background-color '#2F4F4F' --text-color 'DarkSlateGrey'
ruby met_wallpapers.rb --width 3840 --height 2160 -d 'european paintings'
ruby met_wallpapers.rb -d 'photographs'
Metropolitan Museum of Art Open Access API licensed with CC0. Images downloaded by this script are limited to those marked by the API as in the Public Domain.