Skip to content

Latest commit

 

History

History

saville_code

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Peter Saville's color code

In 1983-1984, the Manchester graphic designer Peter Saville used a color code to write information on four Factory Records covers, the first being the Blue Monday 12" single (best selling 12" single of all time). The idea was to underline the modernity of the music track with a color code evoking a computer-readable code (barcode readers were still a novelty). The Blue Monday cover is also famous for its cut-out in the shape of a 5.25" floppy disk (a modern medium at the time, generally storing 360 KB).

In Saville's code, the available characters are only the ten digits, the A-Z letters and the space. In our application, lowercase letters are automatically converted into uppercase letters. All other characters are treated like spaces.

Except the space which is coded by a grey octagon, all the glyphs are represented by a square whose each half can have its own color. If the two halves have different colors, they are separated by a white line. The letters A to I (which share the same glyphs as the digits 1 to 9) use only one color.

Remark: depending on the sources available on the Web, the 0 character is either a white square or similar to the character J. It is uncertain as the zero was not used in the four covers. For the moment, we have chosen the first interpretation, as suggested by some graphical notes by Peter Saville available on the web.

Fortran implementation

This Fortran implementation of Saville's color code is based on gtk-fortran (GTK 4), and especially its Cairo graphics library. The image is saved both in a PNG file and a SVG file.

Color class

This project was a pretext to study the basics of Object Oriented Programming in modern Fortran (OOP was introduced in the Fortran 2003 standard). The color class contains two arrays CMYK and RGB to store the color values, and two subroutines for conversions between those two systems. Peter Saville wanting to print an album cover, he defined the colors of his code using the CMYK color model. Note that we do not use any ICC profile. It is therefore just a simplistic conversion. We used the formula available on those two pages:

Glyph and grapheme classes

A glyph is defined by its name, the colors of its two halves and the presence or absence of a separator between the two halves. The set() method receives the name of the glyph (for example "A") and sets its other properties, using the Peter Saville's color code.

The grapheme class extends the glyph class. It has x and y coordinates, a width in pixels and a Cairo context. The method draw() is used to draw it on screen.

Build and run

With fpm

If you have installed the Fortran Package Manager fpm, you have just to type from the saville_code/ directory:

$ fpm run

fpm will automatically clone the gtk-fortran repository and build everything.

With the build.sh script

gtk-fortran is supposed to be installed in your system.

With GFortran

On a UNIX-like system, you can use the build script:

$ ./build.sh && ./a.out

With another compiler

You can use another compiler, for example Intel ifx:

$ FC="ifx" ./build.sh
$ ./a.out

but in that case gtk-fortran must be compiled with the same compiler.

Perspectives

  • ...

Contributing

Bibliography