Created in July 2024 PDF: paulgalea.com/Projects/Colors_Across_Great_Artworks/Visualisation.pdf /* ..................... */ /* ........TOOLS........ */ /* ..................... */ Microsoft Excel Python R Adobe Illustrator /* ..................... */ /* ....PYTHON SCRIPT.... */ /* ..................... */ import os import pandas as pd from PIL import Image from collections import Counter from sklearn.cluster import KMeans import numpy as np def color_pixel_count(artwork): with Image.open(artwork) as artwork: artwork = artwork.convert('P', palette=Image.ADAPTIVE, colors=256) return Counter(list(artwork.convert('RGB').getdata())) # Data path = r'DATA LOCATION' artworks = [os.path.join(path, file) for file in os.listdir(path) if file!='desktop.ini'] # Transform df = pd.DataFrame() for artwork in artworks: d = pd.DataFrame(list(color_pixel_count(artwork).items()), columns=['rgb','pixels']) d['pixel_percent'] = d['pixels']/d['pixels'].sum() df = pd.concat([df, d], ignore_index=True) df['weighted_percent'] = df['pixel_percent']/df['pixel_percent'].sum()*100 df['cluster'] = KMeans(n_clusters=100, max_iter=10000, n_init=10000, ).fit(np.array(df['rgb'].tolist())).labels_ colors = df.groupby('cluster')['rgb'].nunique().pipe(lambda x: x/x.sum()*100) df['hex'] = df['rgb'].apply(lambda x: '#%02x%02x%02x' % x) df[['cluster','hex','weighted_percent' ]].to_csv(r'DATA LOCATION') /* ..................... */ /* .......R SCRIPT...... */ /* ..................... */ library(readr) library(treemap) df <- read_csv("DATA LOCATION") png("DATA LOCATION", width=1160, height=1380) treemap( df, index = c("cluster", "hex"), vSize = "weighted_percent", vColor = "hex", type = "color", palette = df$hex, fontsize.labels = 0, fontcolor.labels = "transparent") dev.off() /* ..................... */ /* ...SOURCES & EXCEL... */ /* ..................... */ Top artwork lists, artwork and selection information: paulgalea.com/Projects/Colors_Across_Great_Artworks/Artworks.xlsx Top artwork lists: thepopularlist.com/most-famous-paintings-of-all-time/ brushwiz.com/most-famous-paintings ranker.com/list/best-paintings-all-time/ranker-art bookmypainting.com/blog/famous-paintings/ handmadepiece.com/most-popular/top-100-most-famous-paintings.html timeout.com/newyork/art/top-famous-paintings-in-art-history-ranked mymodernmet.com/most-famous-artwork-history/ thepopularlist.com/most-famous-paintings-of-all-time/2/ artincontext.org/famous-paintings/ edition.cnn.com/style/article/most-famous-paintings/index.html artst.org/paintings/ finearttutorials.com/guide/famous-paintings/ youtube.com/@GreatArtExplained auntbetty.com/en/travel-stories/10-famous-artworks-and-where-to-see-them artistro.com/blogs/news/30-most-famous-artworks-in-history-the-greatest-art-of-all-time Artworks included in visualisation: A Bar at the Folies-Bergere - Edouard Manet A Friend in Need - Cassius Marcellus Coolidge A Sunday Afternoon on the Island of La Grande Jatte - Georges Seurat Adoration of the Maji - Gentile da Fabriano American Gothic - Grant Wood Annunciation - Leonardo da Vinci Arnolfini Portrait - Jan van Eyck Bacchus And Ariadne - Tiziano Vecelli Bal du moulin de la Galette - Pierre-Auguste Renoir Boulevard Montmartre - Camille Pissarro Breezing Up - Winslow Homer Cafe Terrace at Night - Vincent van Gogh Charles I In Three Positions - Anthony Van Dyck Christ in the Storm on the Lake of Galilee - Rembrandt van Rijn Composition VIII - Wassily Kandinsky Composition with Red, Blue and Yellow - Piet Mondrian Death of Marat - Jacques-Louis David Et in Arcadia ego - Nicolas Poussin Flaming June - Frederic Leighton George Washington's Crossing of the Delaware River - Emanuel Leutze Girl with a Pearl Earring - Johannes Vermeer Grande Odalisque - Jean Auguste Dominique Ingres Guernica - Pablo Picasso Impression, Sunrise - Claude Oscar Monet Irises - Vincent van Gogh Japanese Bridge - Claude Oscar Monet Judith Slaying Holofernes - Artemisia Gentileschi Lady with an Ermine - Leonardo da Vinci Landscape with the Fall of Icarus - Pieter Bruegel Large Bathers - Paul Cezanne Las Meninas - Diego Velazquez Laughing Cavalier - Frans Hals Le Dejeuner sur lherbe - Edouard Manet Les Demoiselles dAvignon - Pablo Picasso Luncheon of the Boating Party - Pierre-Auguste Renoir Massacre of the Innocents - Peter Paul Rubens Mona Lisa - Leonardo da Vinci Mr and Mrs Andrews - Thomas Gainsborough Musicians - Michelangelo da Caravaggio Napoleon Crossing the Alps - Jacques-Louis David Nighthawks - Edward Hopper Nude Descending a Staircase, No. 2 - Marcel Duchamp Number 5 - Jackson Pollock Olympia - Edouard Manet Paris Street, Rainy Day - Gustave Caillebotte Pollice Verso - Jean-Leon Gerome Portrait of Madame Recamier - Jacques-Louis David Portrait of Madame X - John Singer Sargent Primavera - Sandro Botticelli Red Balloon - Paul Klee Royal Red and Blue - Mark Rothko Sacred and Profane Love - Tiziano Vecelli Saint George and the Dragon - Paolo Uccello Saturn Devouring His Son - Francisco Goya Self-Portrait without Beard - Vincent van Gogh Sunflowers - Vincent van Gogh Susanna and the Elders - Artemisia Gentileschi The Ambassadors - Hans Holbein The Anatomy Lesson of Dr. Nicolaes Tulp - Rembrandt van Rijn The Ancient of Days - William Blake The Astronomer - Johannes Vermeer The Avenue in the Rain - Frederick Childe Hassam The Basket of Apples - Paul Cezanne The Battle of Issus - Albrecht Altdorfer The Beheading of Saint John - Michelangelo da Caravaggio The Birth of Venus - Sandro Botticelli The Card Players - Paul Cezanne The Creation of Adam - Michelangelo Buonarroti The Embarkation for Cythera - Jean-Antoine Watteau The Fighting Temeraire - Joseph Mallord William Turner The Flower Carrier - Diego Rivera The Foxes - Franz Marc The Garden of Earthly Delights - Hieronymus Bosch The Gleaners - Jean-Francois Millet The Great Wave off Kanagawa - Katsushika Hokusai The Gross Clinic - Thomas Eakins The Harvesters - Pieter Bruegel The Hay Wain - John Constable The Hireling Shepherd - William Holman Hunt The Kiss - Gustav Klimt The Ladies Waldegrave - Joshua Reynolds The Lady of Shalott - John William Waterhouse The Last Supper - Leonardo da Vinci The Liberty Leading the People - Eugene Delacroix The Lovers II - Rene Magritte The Milkmaid - Johannes Vermeer The Naked Maja - Francisco Goya The Netherlandish Proverbs - Pieter Bruegel The Night Cafe - Vincent van Gogh The Night Watch - Rembrandt van Rijn The Ninth Wave - Ivan Aivazovsky The Old Guitarist - Pablo Picasso The Persistence of Memory - Salvador Dali The Portrait of Dora Maar - Pablo Picasso The Raft of the Medusa - Théodore Gericault The Return of the Prodigal Son - Rembrandt van Rijn The Roman Maidens - Juan Luna The School of Athens - Raffaello Sanzio The Scream - Edvard Munch The Seed Of Areoi - Paul Gauguin The Sleepers - Gustave Courbet The Sleeping Gypsy - Henri Rousseau The Son of Man - Rene Magritte The Starry Night - Vincent van Gogh The Swing - Joean Honore Fragonard The Third of May 1808 - Francisco Goya The Tower of Babel - Pieter Bruegel The Treachery Of Images - Rene Magritte The Triumph of Galatea - Raffaello Sanzio The Two Fridas - Frida Kahlo Three Musicians - Pablo Picasso View of Toledo - El Greco Wanderer above the Sea of Fog - Caspar David Friedrich Water Lilies Series - Claude Oscar Monet Watson and the Shark - John Singleton Copley Whistler's Mother - James Abbott McNeill Whistler