Hold-And-Modify

The Hold -And- Modify mode ( HAM mode ) is a display mode of your graphics chipsets the Amiga platform to 12 -bit and 18 -bit display pictures with only 6 or 8 bits per pixel. In this case, special hardware implemented data compression is used in order to save memory bandwidth.

If a CAMG chunk is present in an IFF image file, this mode can be identified on 11 bit.

  • HAM or HAM6 images can represent 4096 colors and we use six bits per pixel and a color palette of 16 colors.
  • The HAM8 mode was introduced with the Amiga 4000 and the Amiga 1200 and with only eight bits per pixel and a base palette of 64 colors offers a very good, photo-like image quality. In this mode, almost as many colors can be displayed from the 24 -bit range, as can fit in the Chip RAM ( minus the first column of pixels ) and how the image resolution allows.

The color of a pixel in HAM mode, each color 12- bit color palette with HAM6 or 24 - bit color palette with HAM8 be. Alternatively, the color of the right to the left adjacent pixel can be taken, one of the three color components of the RGB color space ( Red, Green, Blue) is set to a new value. On the left-hand side of the border color is applied ( color index 0, the color palette). Note: The video hardware begins at the first pixel of a bit-plane, but only at the first visible pixel, which in Hardwarescrolling (virtual or on large screen) a ( ugly ) difference it makes.

This procedure in keeping with the characteristics of television signals (CVBS), so that the lossy data compression does not result in deterioration.

HAM - image files, the pixel data in the BODY chunk is stored as a code that is allocated to the mode and the remaining bits. The coding of the pixel corresponds to the format used by the video hardware.

If a pixel is not a color in the palette is ( mode 00), only the new value of the three RGB values ​​can be specified. The other two values ​​are the same as in the pixel previously. If the pixels of the first line of an image is, the previous pixel as RGB triplet (0, 0, 0 ) is assumed (as opposed to by the video hardware, supra ).

Format of mode and data bits of a pixel in HAM6 mode:

543210 00wxyz - color index wxyz in a 16 items long base color palette 01wxyz - Keep the color value of the previous pixel, but put the ( top ) four bits of blue on wxyz 10wxyz - Keep the color value of the previous pixel, but put the ( top ) four bits of red on wxyz 11wxyz - Keep the color value of the previous pixel, but put the ( top ) four bits of green on wxyz A HAM- image can not be directly decoded into an image with 256 colors or less, without previously carrying out a reduction in the colors. In order to obtain full quality, requires at least a 12- bit image.

If you want to an image that is in the 256 or more colors convert into a HAM- image, one first searches for the optimum basis for this range can be represented directly or with only small deviations with the already as many points of the image. When the base range is fixed, it is row-wise through the image and is optimized for each pixel, whether it can be illustrated best by one of the base palette colors, or even better by a HAM- modification of the previous pixel ( one of the three RGB color components to the desired value set ). The evaluation is carried out by distance calculation in 3D color space between the image pixels and the respective base or HAM- candidates. This applies generally to both HAM6 as well as for HAM8.

The number of data bits is four for standard HAM6 and six for HAM8. The number of bitplanes in the BMHD chunk is six or eight. If a HAM- image is to be displayed as a 24 -bit image, the data bits ( four or six) should be extended to eight bits. The maximum value should be converted to 255 for eight bits per RGB channel.

Format of mode and data bits of a pixel in HAM8 mode:

76543210 00uvwxyz - color index uvwxyz in a 64 items long base color palette 01uvwxyz - Keep the color value of the previous pixel, but put the top six bits of blue on uvwxyz 10uvwxyz - Keep the color value of the previous pixel, but put the top six bits of red on uvwxyz 11uvwxyz - Keep the color value of the previous pixel, but put the top six bits of green on uvwxyz HAM8 images must be converted to 24 -bit images to maintain the full picture quality on non- Amiga systems.

To the HAM8 mode really be able to represent all the colors of the 24 - bit palette, you have the 64 colors of the palette based Preassign so that the 64 possible combinations of the two lowest bit of all color components are accurately covered. Then you can reach all the colors of the 24 - bit palette using the HAM- mechanism of these basic colors. Simultaneously displayable number of colors is limited only by the size of the chip RAMs. The latter is two megabytes, so you can represent about 2 million different colors on a HAM8 image. ( Go from chip RAM from various other amounts, for the Workbench and various data structures of the operating system, which must be in chip RAM. )

View

It was a long time in the discussion, these HAM mode, which is based on the RGB color representation, building by an appropriate mode on the HSV color space (hue, saturation, brightness ) to replace what you look even higher compression options and / or more better display quality promised. However, the HAM mode is no longer necessary on current computers because of the fallen RAM prices and faster graphics hardware so that these considerations have so far not led to any practical implementation.

371404
de