ZX Spectrum graphic modes


The ZX Spectrum is generally considered to have limited graphical capabilities in comparison to some other home computers of the same era such as the Commodore 64, largely due to its lack of a dedicated graphics chip. Nevertheless, throughout its commercial life and later activity on the demoscene, various techniques have been developed to provide improvements to the Spectrum's graphical output.

Colour palette

The ZX Spectrum computers uses a variation of the 4-bit RGBI palette philosophy. This results in each of the colours of the 3-bit palette having a basic and bright variant, with the exception of black. The bright half of the palette is generated using the video display's maximum voltage levels for each of the three R/G/B colour components that a colour uses. The basic half of the palette is displayed by simply reducing these voltages.
In the ZX Spectrum encoding the colour components are in GRB order rather than the more common RGB order. The GRB order has the advantage that the colour numbers become ordered by increasing luminance, so if viewed on black-and-white display the ordered sequence 0 to 7 would form a gradient from black to white. Specifically, blue has a binary weight of 1, red has a weight of 2, and green has a weight of 4. As with any binary number, these weights add up to produce a single decimal number that matches the displayed colour, the effect of which can be seen in the table below.
For any value of n from 0 to 7, the following commands can be used to set or alter the screen's colours:
Furthermore, the BRIGHT command can be used to change the setting of the PAPER and INK commands' "bright" flag, giving them access to the entire 15-colour palette. Settings of "0" and "1" turn bright mode off and on. Since only one bit within a colour attribute byte is used to select the brightness for both foreground and background colours in a colour cell, it is not possible to select both bright and basic colour modes in the same colour cell. The BORDER command does not use a bright flag, thus only the eight basic colours are supported.
Counting from least to most significant bit, an attribute byte dedicates three bits for the foreground colour, three bits for the background colour, one bit for the bright flag, and one bit for the flashing effect.
BRIGHT BLACK colour was not in all models of ZX Spectrum and ZX Spectrum Emulators.
0,00,000,00,010,00,020,00,030,00,040,00,050,00,060,00,07
0,01,000,01,010,01,020,01,030,01,040,01,050,01,060,01,07
0,02,000,02,010,02,020,02,030,02,040,02,050,02,060,02,07
0,03,000,03,010,03,020,03,030,03,040,03,050,03,060,03,07
0,04,000,04,010,04,020,04,030,04,040,04,050,04,060,04,07
0,05,000,05,010,05,020,05,030,05,040,05,050,05,060,05,07
0,06,000,06,010,06,020,06,030,06,040,06,050,06,060,06,07
0,07,000,07,010,07,020,07,030,07,040,07,050,07,060,07,07
1,00,001,00,011,00,021,00,031,00,041,00,051,00,061,00,07
1,01,001,01,011,01,021,01,031,01,041,01,051,01,061,01,07
1,02,001,02,011,02,021,02,031,02,041,02,051,02,061,02,07
1,03,001,03,011,03,021,03,031,03,041,03,051,03,061,03,07
1,04,001,04,011,04,021,04,031,04,041,04,051,04,061,04,07
1,05,001,05,011,05,021,05,031,05,041,05,051,05,061,05,07
1,06,001,06,011,06,021,06,031,06,041,06,051,06,061,06,07
1,07,001,07,011,07,021,07,031,07,041,07,051,07,061,07,07

Dithering

This quite short colour palette has urged the graphic artists to resort to various dithering techniques; the simplest of which employs ordered patterns, as shown exhaustively in the opposite chart. Dithering also works very well with the original Composite video connection to an analog PAL TV, generating colour mixing along horizontal pixel lines.

Standard mode

Hardware implementation

The original ZX Spectrum has a screen resolution of 256×192 pixels. Colour information is overlaid onto this as a grid of 8×8 pixel regions known as attribute blocks; within each attribute block, only two colours may be used out of a palette of 8. Additionally, the entire attribute block may be designated as 'bright', resulting in a total of 15 possible colours. In many programs this limitation was evident as attribute clash.

Actual resolution over composite video connections

Due to the limitations of the original Composite video connection to an analogue PAL TV, adjacent pixels were in fact blurred out horizontally. The resulting resolution depended on the quality of the TV set and on the colour combinations used by each particular image, but on most cases was similar to ~128x192.
This effect was used to increase the number of displayed colours on screen by almost all of the graphic designers, using dithering techniques. Close to a total of 64 colours become possible this way. Some emulators provide some sort of "blur" image processing trying to simulate this effect.

Monochrome TVs and monitors

By using a monochrome monitor or black and white TV, it is possible to take advantage of the differences in intensity over the Spectrum's colour range to generate a 15-shade grayscale image at 256×192 resolution.

Hicolour (8x1 attributes)

Hardware implementation

Several third-party Spectrum clones, including the Timex Sinclair machines and the Pentagon, support a screen mode in which attribute blocks are 8×1 pixels in size rather than the usual 8×8. A screen in this mode takes 12 KB RAM. In the case of the Timex, this mode is activated through the command OUT 255,2. In addition, this screen mode can be generated through the use of the MB03+ Ultimate interface, the MB-02 disk system's DMA hardware, and is also available as Mode 2 on the SAM Coupé.

Software implementation

"8x1" attributes

On other Spectrum models, this effect can be replicated by exploiting the fact that the ULA re-reads the attribute information on every pixel row when generating the video output; it is possible to write a new value to the relevant memory location in between successive lines, and thus cause a different pair of colours to be shown. However, the Spectrum's processor is not fast enough to write to an entire row of attribute bytes in one scanline, so 8×1 attributes can only be achieved over 20 columns. This technique is variously known as Hicolour, Multicolour, FLI or Rainbow Processor mode.

"8x2" attributes

A variation on this method is to change the complete row of attributes over the course of two scanlines, resulting in 8×2 pixel attribute blocks over the full width of the screen.

"4x1" attributes

A special case involves alternating between the two available colours per attribute cell for 4 pixels each, allowing each 4×1 region to be treated as an independently colourable 'pixel'.

ULAPlus

ULAPlus is compatible with the standard ZX Spectrum display, if used only to modify the 16 basic colours.
Yet any software that uses the full 64 colours will trigger the "flash" attributes of the original Spectrum.

Interlace/Switched modes

By alternating between two screens on every frame interrupt, it is theoretically possible to simulate a doubling of the vertical display resolution from 192 to 384 lines.
The Timex clones and ZX Spectrum 128K implement a 'shadow' screen area which can be switched into place through the use of a single OUT command, and this is often utilised to rapidly switch between two images for this purpose.
When viewed on a CRT television screen, the flicker is less noticeable than on a modern monitor.
The image is linked to : Image:Parrot interlace.gif|here.
The technique does not in fact achieve a true interlaced display, as the Spectrum lacks the ability to synchronise with the display hardware at such a low level. Rather, the effect is more akin to anti-aliasing, with certain pixels appearing at half intensity.

GigaScreen

The attributes of an image are alternated at 50 Hz on the screen, taking advantage of the PAL colour system encoding for mixing. This way, the palette is increased to approximately 36 colours.
For Pentagon machines, a hardware modification is available which directly combines the two alternate screen areas into the video signal, thus eliminating the flicker associated with this method. Furthermore, the gigascreen and hicolour techniques may be employed together to produce even richer-coloured images; this format has been named DithVIDE and BZither, both names referring to the dithering methods employed when converting true-colour images to the format.

3colour / Multichrome / RGB-3 / Interchrome

Three separate images, comprising a red, green and blue layer, are displayed on the screen rapidly, one after the other, relying on persistence of vision effects to merge the three layers into a single coloured image. The result is an 8-colour image where each pixel may be coloured independently.
This effect is simulated in another image linked to :Image:Parrot rgb3.gif|here ; the flashing is less noticeable when viewed on a television screen.

Emulated

256×192, 256 colours, "256 colour mode", no attributes

The SPEC256 and EmuZWin emulators have a screen mode 256×192 pixels where each pixel can be in one of 256 colours. This is achieved by extending the word size of the emulated Z80 from 8 bits to 64, making eight bits of data available for each pixel; the screen thus takes 48 KB of memory. This mode only exists on the emulator and software graphics must be modified to use it.

Compatible machines and interfaces

Later ZX Spectrum compatible machines offered extra video modes. These are based on the standard 256x192 mode but incompatible with the original Spectrum.
Also interfaces, the Spectra interface and the MB03+ Ultimate interface extend the Spectrum’s display to support more colours or/and extra video modes.

512×192 monochrome

This mode was mainly used to display 64×24 or 80×24 columns text screen and only Timex Sinclair computers and some Russian clones can display it. There are two graphics editors for this mode and it is supported by BASIC64 and some CP/M implementations. It also takes 12 KB RAM.

512×192x4

Layer 2 (256×192x256)

256×192x16

384x304x16

512x384x2

16c

HAM256

Radastan

This mode displays 128x96 double sized pixels. Each pixel holds one of sixteen colours. Pixels are stored in linear buffer as 4-bit nibbles. The buffer is 6144 bytes long and occupies same memory as 256x192 pixel ram.