PNG/JPEG to Commodore Amiga graphics converter — OCS/AGA bitplane, HAM6/HAM8, EHB, copper palettes, 64 dithering modes and much more
翻訳待ち
Loading the full README.
Read the full README ↗Open-source PNG/JPEG/WebP → Commodore Amiga, Atari ST/STE,
IBM PC (CGA / EGA / VGA), Commodore 64, Sega Genesis, and SNES Mode 7
image converter. Supports OCS/AGA bitplane, HAM6/HAM8, EHB, and
sliced-HAM (SHAM) via copper palettes with perceptual OKLab color
matching. Writes IFF ILBM, Degas .PI1/.PI2/.PI3, C64 .prg /
.koa / .hir, Genesis SGDK headers, SNES tile/tilemap .bin, C
headers, raw bitplanes, and standalone AmigaOS viewer .cpp source.
The bundled build-amiga.sh wrapper runs the included
m68k-amiga-elf-gcc + exe2adf toolchain to turn the .cpp into a
runnable .exe and bootable .adf. DOS-mode .c output compiles
with ia16-elf-gcc into a 16-bit real-mode viewer.
Try it in your browser at png2amiga.app — live preview via WebAssembly, server-side compile to Amiga executables.
Aimed at retro-platform asset pipelines (Amiga / Atari / IBM PC demoscene, hobby AmigaOS games, MS-DOS coding). All color operations use OKLab perceptual color space. Sister project to png2c64.
Amiga modes: Lores / Hires (+ interlace), HAM6 (OCS) + HAM8 (AGA) with hires and/or interlace variants, EHB. 1–8 bitplanes within chipset limits. Optional sliced palette (per-line copper swaps — the same technique behind Sliced HAM / SHAM, in use since 1989) and strip palette (additional mid-line swaps in the active scanline, used in demoscene productions like Desire's Shuffling Around the Christmas Tree).
Atari modes: STF Low/Medium/Hi, STE Low/Medium/Hi (9-bit palette
on STF, 12-bit on STE; ST-Hi is hardware-locked monochrome). Degas
Elite .PI1/.PI2/.PI3 output. Spectrum 512/4096 raster modes add
.spu, .cpp, and standalone Atari TOS .exe/.prg exports.
ZX Spectrum: 256×192, two colors per 8×8 cell with shared BRIGHT;
native .scr export.
IBM PC modes: CGA 320×200 / 640×200 / composite (NTSC artifact
colors), CGA text-mode glyph matching at 80x{200,100,50,25} and
40x{200,100} cell grids, EGA 320×200 / 640×200 / 640×350 (16 of the
64-color IrgbIRGB gamut), VGA Mode 13h (320×200, 256-color chunky),
Mode 10h (640×350, 16-color planar), Mode 12h (640×480, 16-color
planar). 16-bit DOS viewer .c output for ia16-elf-gcc compilation.
Commodore 64: VIC-II hires (320×200, 2 colors per 8×8 cell),
multicolor (160×200, 4 per 4×8), FLI / AFLI (per-row screen-RAM
swaps for more colors per cell), PETSCII (40×25 text-mode glyph
matching against the C64 character ROM), and custom-charset modes
(hires + multicolor) that build a per-image 256-glyph charset with
Hamming-distance pair merging when content overflows. Outputs
.prg / .koa / .hir for direct loading on real hardware.
Sega Genesis / Mega Drive: H32 (256×224) and H40 (320×224) with
optional Shadow/Highlight extension. 4 palette lines × 16 BGR333,
8×8 4bpp tiles + tilemap. SGDK .h / .bin output.
SNES Mode 7: 256-color BGR555-palette and 256-color Direct
Color (BBGGGRRR) variants. Affine-transformable 8bpp BG1, ≤256
unique 8×8 tiles via greedy distance-merging when content overflows.
tools/snes-mode7-viewer/build.sh turns a frame into a LoROM .sfc
for an emulator or a flash cart; set M7VOFS to -1 in your own code, or
the frame's top row is hidden.
Game Boy Advance: Mode 3 (240×160 16bpp BGR555 direct), Mode 4
(240×160 8bpp + 256-color BGR555 palette), and Mode 5 (160×128 16bpp
BGR555 direct). PNG preview + devkitARM/grit-style .h header +
raw .bin (Mode 4 also writes a companion .pal).
Sega Master System / Game Gear: VDP mode 4 (SMS 256×192 RGB222,
GG 160×144 RGB444). 8×8 4bpp tiles, two 16-color palettes, H/V-flip
tile dedup and merging down to the 448-tile VRAM budget. devkitSMS
.h / .bin output.
Amstrad CPC / CPC Plus: modes 0 / 1 / 2 (16 / 4 / 2 inks) from the
27-color firmware palette or the Plus 4096-color palette. 16 KB &C000
screen as .bin or AMSDOS .scr, companion .pal, and .h.
Palette quantizers: GPU-accelerated parallel-restart Lloyd k-means in OKLab on Apple GPU (default for AGA / VGA when Xcode's Metal toolchain is available; mean ΔS2 +2.6..+3.4 vs pngquant on DIV2K-100+Kodak-24 across K=8..256), OCS brute-force (histogram + k-means over all 4096 OCS colors), PNN agglomerative (Ward's linkage in OKLab — default for HAM AGA), and median-cut + k-means refinement in OKLab (CPU fallback when Metal isn't available).
Dithering: 71 methods.
This is the beginning of the README. Read the rest at the original. Read the full README ↗