- Amiga Hold-and-Modify
, even though 12 bits per pixel would normally be needed.
HAM can be interpreted as a
lossy compression technique, where 12 bit color information is stored in 6 bits of RAM (with reduced quality) and is decompressed through hardware inrealtime "while the graphics buffer is scanned and displayed."HAM operates on horizontally sequential
pixel s on the same display line. The previous pixel's red, green and blue color components are examined. Two of the components are "held", one component is "modified". Alternatively, all three components can be changed at once, but the color selection is limited to one of 16 colors from the indexed color palette.The original HAM mode is part of the
Original Amiga chipset , available in the first Amigas. With the release of Amigas based on theAdvanced Graphics Architecture chipset, HAM was upgraded. The original HAM was renamed "HAM6", and the new "HAM8" mode could display up to what was said to be 262,144 colors on-screen from a palette of 16,777,216, although the actual upper limit could be higher depending on screen resolution. [HAM8 explained in detail, and why saying that HAM8 is a 262144 color mode is incorrect [http://www.amigans.net/modules/AMS/article.php?storyid=22] ]HAM6 operation
The
Original Amiga chipset andEnhanced Chip Set support 16 distinct levels of red, green and blue color components, giving a grand total of 4,096 possible colors (16 * 16 * 16 = 4096). Each of the 3 components requires 4bit s to store it (16 = 24), so 12 bits are needed to store an entire color.However, the original and enhanced chipsets only support up to 6 bits per pixel
planar screen modes, and features only 32 color registers for the used color palette. Each entry in the palette could be set to one of the full range of 4096 colors. When drawing the screen itself, 5 bits per pixel would give an index into the color palette.Another Amiga-specific screenmode,
Extra Half-Brite , allowed 5 bits per pixel for an index into the 32 color palette and one extra bit to say if the color should be at full or half luminosity. However, this still only allows for 64 colors.HAM allowed all 4,096 of the Amiga's colors to be displayed. It did so by using 6 bits per pixel; 2 bits were used as decision-making "control" bits, and 4 bits were used as "data" bits. The resulting color for a pixel would be the result of following the instruction of the control bits. The 2 control bits allow for four possibilities, which were as follows:
*Set: Use the 4 bits of data as an index into the first 16 colors in the color palette. Use that color for this pixel.
*Modify Red: Maintain the green and blue color components of the previous pixel. Use the 4 bits of data as the new red color component of this pixel.
*Modify Green: Maintain the red and blue color components of the previous pixel. Use the 4 bits of data as the new green color component of this pixel.
*Modify Blue: Maintain the red and green color components of the previous pixel. Use the 4 bits of data as the new blue color component of this pixel.SHAM (Sliced HAM)
Rhett Anderson developed the so called "SHAM" or "SHM" mode, allowing each video scan line to have its own 16-color palette. This was possible because of a special co-processor that could reprogram the color palette registers at the beginning of each scan line. The SHM feature was deprecated when HAM8 was introduced. [Standards and specs: The Interchange File Format (IFF) (See HAM and Cheese) [http://www.ibm.com/developerworks/power/library/pa-spec16] ] The advantage of SHM files was the ability to lessen color fringing due to the fact that each scanline would have its own base palette of 16 colors.HAM8 operation
With the
Advanced Graphics Architecture , the Amiga's graphics quality was improved. Instead of 4 bits per color component, the Amiga now had 8 bits per color component, which offered 16,777,216 possible colors. The 6 bits per pixel was raised to 8 bits per pixel, allowing for a 256 color palette in normal operation.HAM8 worked in the same way as HAM6, using 2 "control" bits per pixel, but now there were 6 bits of "data" per pixel instead of 4. The "set" operation could now select from a palette of 64 colors instead of 16. The "modify" operation could modify the 6 most significant bits of either the red, green or blue color component - the 2 least significant bits of the color could not be altered by this operation.
Advantages and disadvantages
When the Amiga was launched in
1985 , HAM mode gave it a graphical advantage over competing systems, because it allowed the system to display digitized photographs and some rendered 3D images at a level claimed to be "photorealistic" at the time.HAM is still only an approximation of
truecolor . It can take up to three pixels to change from one color to another, so representing a sharp change in color, such as when digitizing and displaying a photograph, can lead to noticeable multi-hued "fringes" appearing.Furthermore, the HAM screenmode is difficult to use in games or any other application where the contents of the screen need to be modified. If a "set" pixel is scrolled horizontally off the left hand side of the display, it is no longer drawn; any subsequent "modify" pixels no longer have a base color to modify and start to show the wrong color. This effect makes it difficult to scroll the screen without showing this artifact. The same happens if a "set" pixel is drawn in the middle of a sequence of "modify" pixels, so drawing
blitter objects on the screen is very difficult to do without messing up the display.Implementation of HAM
HAM was only originally put into the Amiga's custom chipset as an experiment. To quote
Jay Miner :Until update 4 HAM is not supported under
AmigaOS version 4 on theAmigaOne . This can cause some incompatibilities with some software, later in AmigaOS 4.0 final update HAM6 and HAM8 were fully supported so old Applications can use this mode (like the famousDeluxe Paint fromElectronic Arts ).References
* "Amiga Hardware Reference Manual", Commodore-Amiga
* "Specification for the Advanced Amiga (AA) Chip Set", Commodore-AmigaSee also
*
Amiga Halfbrite mode
* [http://www.amiga.org/modules/myalbum/photo.php?cid=30&lid=1032 Dynamic Hires]External links
* Animated demos using [http://www.randelshofer.ch/animations/anims/eric_w_schwartz/AmigaHopAnim.HAMVE.html HAM-6] and [http://www.randelshofer.ch/animations/anims/eric_w_schwartz/AmigaHopAnim.HAM8VE.html HAM-8] mode (requires Java).
Wikimedia Foundation. 2010.