hamify
Information
hamify converts image files into Amiga OCS HAM6 mode. It supports a few quality modes for choosing trade-off between speed and quality. It can automatically scale images down to the native Amiga resolution, taking optional interlacing into account. It can also apply dithering for better results.It is designed to have little external dependencies and be portable. It only requires a C++17 compiler (GCC recommended) and can optionally support libSDL for reading more image formats. Without SDL, it reads binary PPM files.
It can output ILBM IFF files, or PPM with pixel values chosen to match HAM6 requirements.
hamify is free software released under the GNU General Public License V3 or later. For details read COPYING.
hamify (C) 2024 Ralf Hoffmann.
Features
- Scaling
It can scale to OCS screen size (with or without interlacing) using linear interpolation - Dithering
It uses Floyd-Steinberg dithering which can be disabled. - multiple quality modes for find best palette to use:
- Defaut is usally reasonable fast (one second or less)
It basically uses the unique colors and merges the most used colors based on an error tolerance and tries to find best error tolerence. - Fast mode just a pre-defined error tolerance.
- Good mode checks combination of unique colors to best result. This usually can take a couple of seconds.
- Best mode checks 16 * 4096 color combinations for best palette. This can take a few minutes.
- See examples below for results and speed comparison
- Defaut is usally reasonable fast (one second or less)
Download
The current release is hamify 0.1 (171 kB) (signature) from 2024-02-10.
Changes
- 2024-02-10: Version 0.1
- first release
Requirements
- a POSIX compatible system and a C++17 compiler
- optionally: libSDL2 + SDL2_image
Installation
Compile it with$ ./configure && makeYou can install it with "make install", but you don't have to. It is a stand-alone program with no additional files required for execution.
hamify can use SDL if installed for more input image file type support, but it can compile without SDL too.
Usage
The most basic usage is:hamify input.png -o output.iffand if scaling and interlacing is wanted, use:
hamify input.png -o output.iff --scale --interlaceSee the following section for all options.
Options
-V, --version |
Print the program version and exit | |
-h, --help |
Print help and exit | |
-o, --output=<path> |
Set output file | |
-t, --type=<type> |
Output type Possible values: iff, ppm |
|
--scale |
Scale image to OCS LoRes | |
--interlace |
Use interlace screen size | |
--adjust-interlace |
When used without scaling, still adjust the width so the aspect ratio is correct on interlace screen. | |
--ntsc |
Select NTSC screen size | |
--no-dither |
Disable dithering when converting to OCS color space. | |
-q, --quality |
Select quality (speed vs accuracy) Possible values: 0 or fast, 1 or normal (default), 2 or good, 3 or best fast and normal are reasonable fast, while good or best take signifcant amount of time to find most accurat representation. |
|
-l, --ham-lookahead |
Select type of lookahead mode for HAM calculation. Possible values:
|
|
--compress |
Enable ILBM compression | |
--quiet |
Suppress regular output | |
--threads=<threads> |
Use given number of threads for faster processing in good and best quality mode. Defaults to number of threads available on system. |
Example images
The images below show the conversion results for different types of images. A photo, a computer-generated graphic, and a random graphic. The conversion done by GIMP is shown for comparison of what would be the best possible result given the 4 Bit per channel color space limition of the OCS graphic mode.Links
- http://netpbm.sourceforge.net/
contains 'ppmtoilbm' to a file to ILBM including HAM support.
Image quality is just ok as the tool uses a gray palette. - ham_convert A closed-source Java program with a GUI and a lot of options for optimization. Also supports many target image formats.
- AmigAtari Bitmap Converter Converts images to different Amiga and Atari formats. Uses a brute-force approach to scan a subset of all possible palette variations for best solution (similar to best quality mode in hamify). It can use the GPU for faster procressing. Looks like it runs on Windows only though.
tags: amiga10