ham_convert is a freeware (also free for commercial use) graphic converter written by Sebastian Sieczko that can convert a normal jpg/gif/png image to one of the graphic modes of the Commodore Amiga. It was written in java and should work on any operating system supported by JRE8 or newer (fonts may look worse on OpenJDK). It can produce ILBM IFF files (Amiga graphic modes: EHB, HAM6, HAM8, 4/8/16/32/64/128/256-color indexed, PCHG – 4/8/16/32/EHB modes).
Example HAM6 images are available here.
Contact info (also available in the program – click on the copyright note at the bottom-left of the main window). Please report incompatibilities, regressions, bugs and any undesired or simply weird behavior. Inclusion of your test pictures and conversion settings will also be really helpful.
I send thanks to the following people who helped me with testing and gave some interesting ideas:
Tomasz Rachwal, cholok
- ILBM IFF file generation (HAM6, HAM8, EHB, 4/8/16/32/64/128/256-color modes, DynamicHires-like modes with 2-6 planes as PCHG IFF) with optional lossless compression. Hires and lace flag control is also available.
- Dithering modes: Bayer, Atkinson, Floyd–Steinberg, Jarvis, Judice, and Ninke, Sierra Lite, 2-row Sierra, 3-row Sierra, Checks (default mode, includes special “lines” and “lines-mixed” versions for HAM6, recommended for interlaced images).
- Dithering propagation factor selection (5%-100%, most used values: 75%, 85%, 100%, no effect for Bayer and Checks because of lack of error propagation).
- Dual mode – dual pixel HAM error calculation. This feature exploits dependence of possible set/modify operations of the next pixel on the choice made in current pixel in the same line. Supported in all HAM modes. Testing showed that a two-pixel sequence testing is not enough to react on the coming rapid color change so a more efficient “triple mode” was implemented.
- Triple mode (HAM6) – extension of dual mode with three pixels instead of two. That makes it both much slower and more efficient.
The principle is to check all possible 3-pixel combinations of HAM operations to better reproduce the source image. Because up to 3 pixels with modify operations are needed to reproduce the source color if all 3 color components differ from the previous pixel in the same line there is a varying “lag” that results in undesired intermediate colors. This lag causes the image to appear slightly blurry horizontally sometimes with garbage pixels at edges called artefacts. Triple mode attempts to better organize set and modify operations to reduce this lag and make resulting image sharper. Use this option for HAM6. Enabled by default since 1.2.2.
- Build-in palette generator using Java Advanced Imaging library. NeuQuant Neural-Net image quantization algorithm is used by default. There are several modes. Mode 0 is a fast single-pass mode for slower computers. Multi-pass modes: 1-safest that doesn’t look great but always gives acceptable result with no side-effects. Other modes eliminate some very similar colors from a bigger palette to make palette more diverse and make room for colors of smaller details that wouldn’t normally appear. Mode 7 is the most aggressive and should be used with caution because it eliminates more colors than other mores and it can make the resulting picture look unnatural.
- Color reduction is performed only when a source image contains more colors that is allowed in the selected Amiga mode. In OCS modes these colors still need to be converted to 12-bit RGB colorspace, so an image won’t look identical but very close. This allows the user to perform color reduction in a different program and use ham_convert to just save as an iff image.
- Multithreaded HAM6 palette optimization. Attempts to minimize average error by inserting colors from the source image. Unlike previous methods this one performs HAM6 conversion each time to measure how palette modification affects average error. Its more efficient and reliable than CIEDE HAM palette generator but very slow. There is also a turbo switch that reduces source palette to 256 colors prior to calculation for a big speedup with little quality loss.
- Batch conversion.
- Importing a palette from a file (JASC palette file format).
- Color mapping in non-HAM indexed modes is performed optionally using a CIEDE2000-based color difference function.
- HAM map generation. It’s an image that illustrates what type of operation was used on every pixel of the HAM image. Legend: red – modify red, green – modify green, blue – modify blue, black – set.
- Error map generation (saved together with the ham map). Brightness represents the color distance between a source color and a calculated color of a ham pixel (normalized to 0-255). Greater distance=brighter pixel.
- Sample palette files of the various vintage home computers from the 80s like Commodore 64 and Atari 800xl. Use them with the 256-color mode.
- HAM-6 mode – 2 control bits+4 bits of data, 16-color palette, 12-bit color space (Amiga OCS/ECS), experimental dithering support. Note: the most common way to minimize fringing in HAM modes is to oversaturate and overbright the pictures so there are few dark tones close to each other and few tones close to grayscale.
- HAM-8 mode – 2 control bits+6 bits of data, 64 color palette, 24-bit color space (Amiga AGA). The only mode supported in the earliest versions of the program. Later work moved into HAM6 and that mode is best supported.
- HAM-10 mode – 2 control bits+8 bits of data, 256 color palette, 24-bit color space (unfinished Amiga AAA).
- 64-color EHB (Extra Half-Brite) mode – 32 colors+the same 32, but with halved brightness, 12-bit color space (Amiga OCS/ECS).
- OCS/ECS indexed modes – 4-32 colors, 12-bit color space.
- AGA indexed modes – 64-256 colors, 24-bit color space.
- Dynamic HiRes – 4/8/16-color palette in hires, 4/8/16/32/64 (EHB) in lores. On pre-AGA Amigas this software mode allowed displaying more than 16 colors in high resolution modes that didn’t support HAM and more than 16 colors at once. PCHG IFF saving is available since 1.3.0 beta (tested viewers: Paint.net – Windows, Visage – Amiga).
- Color bit depth reducer for RGB bit depth reduction (every combination of 1-8 bits per channel).
- ZX Spectrum mode – 15 colors divided into two palettes: bright1 and bright0. Two colors for every 8×8 pixel block, both from bright1 or both from bright0.
- ZX Spectrum 8×1 mode available in some ZX Spectrum clones like Timex Sinclair, Pentagon. This mode uses a 8×1 pixel block size to improve the color resolution. The rest is the same as in normal mode.
- C64 hires and multicolor modes.
- Commodore Plus/4 hires and multicolor modes.
- MSX screen2 – 2 colors out of 15 every 8×1 block.
- VGA fakemode: fake 18-bit hicolor mode used to simulate more than 256 colors at once on a normal VGA card.
- Sliced variants of HAM and indexed modes – different palette every horizontal line for better color reproduction. Replaced with higher quality DynamicHires modes.
- Converting source image to 12-bit RGB
- Iterational color reduction using Neuquant and similar color removal with configurable strength (pal. gener. mode 0-9, 5 recommended). Starts from 64-color palette, decreases palette size until there are only 16 unique colors.
- Calculating HAM operation type for each pixel using brute force search with configurable search sequence length (dual mode-2 pixels, triple mode-3 pixels).
- Optional dithering (checks lines-mixed simulates 15-bit color depth, other types more noticeable and less optimized for HAM).
- Optional error map and ham operation map saving.
- Optional IFF image output with lossless compression.
- PNG image output with lossless compression (all images are saved in the same location as the source image).
- Examples thanks to Trachu – HAM6 with checks (lines-mixed) dithering
- No Man’s Sky HAM6 slideshow by Blake Patterson on the Amiga 1000.
- Real hardware screenshots by retronav.
- Test image – Mielno, Poland (54°15’44.0″N 16°03’06.8″E). Testing platform: WinUAE 3.0.0., emulated Amiga 1200 with 4 MB fast ram, clean installation of Workbench 3.1, no RTG.