Image to Commodore 64 Style Converter
Convert any image to authentic Commodore 64 graphics with VIC-II color constraints, dithering, and export to native C64 formats (Koala, Art Studio, PRG).
About
The Commodore 64's VIC-II graphics chip enforces constraints that no modern image editor replicates correctly. In hi-res mode (320×200 pixels), each 8×8 character cell permits exactly 2 colors from a fixed 16-color palette. Multicolor mode doubles horizontal pixel width to 160×200, allowing 4 colors per 4×8 cell - but one must be the shared background color. Naively reducing an image to 16 colors produces color clash artifacts at cell boundaries. This tool performs per-cell constrained quantization using CIEDE2000 perceptual color distance in CIE LAB space, then applies optional Floyd-Steinberg or ordered dithering within those constraints. The result is an image that would display correctly on real hardware.
Exported files use authentic binary formats: Koala Painter (10003 bytes at load address $6000) for multicolor, Art Studio (9009 bytes at $2000) for hi-res, or a standalone PRG with a 6502 machine code viewer stub. The conversion approximates results - CRT phosphor behavior and PAL signal artifacts are not simulated. For best results, use source images with strong contrast and limited color gradients. Fine text and thin lines below 4 pixels will be lost in multicolor mode due to the doubled pixel width.
Formulas
Color matching uses the CIEDE2000 perceptual distance formula in CIE LAB space. Each pixel's RGB is converted to LAB, then compared against all 16 palette entries.
Where ΔL′ is the lightness difference, ΔC′ is the chroma difference, ΔH′ is the hue difference, SL, SC, SH are weighting functions, and RT is the rotation term correcting for blue region interaction between chroma and hue.
Floyd-Steinberg error diffusion distributes quantization error to neighboring pixels:
Multicolor mode cell constraint: each 4×8 pixel cell selects 3 unique colors plus 1 shared background color (index stored in VIC-II register $D021). The background color is determined globally by frequency analysis across all cells.
Reference Data
| Index | Color Name | Hex (Pepto) | RGB | Luminance |
|---|---|---|---|---|
| 0 | Black | #000000 | 0, 0, 0 | 0 |
| 1 | White | #FFFFFF | 255, 255, 255 | 255 |
| 2 | Red | #68372B | 104, 55, 43 | 68 |
| 3 | Cyan | #70A4B2 | 112, 164, 178 | 155 |
| 4 | Purple | #6F3D86 | 111, 61, 134 | 81 |
| 5 | Green | #588D43 | 88, 141, 67 | 114 |
| 6 | Blue | #352879 | 53, 40, 121 | 50 |
| 7 | Yellow | #B8C76F | 184, 199, 111 | 186 |
| 8 | Orange | #6F4F25 | 111, 79, 37 | 79 |
| 9 | Brown | #433900 | 67, 57, 0 | 51 |
| 10 | Light Red | #9A6759 | 154, 103, 89 | 110 |
| 11 | Dark Grey | #444444 | 68, 68, 68 | 68 |
| 12 | Grey | #6C6C6C | 108, 108, 108 | 108 |
| 13 | Light Green | #9AD284 | 154, 210, 132 | 185 |
| 14 | Light Blue | #6C5EB5 | 108, 94, 181 | 105 |
| 15 | Light Grey | #959595 | 149, 149, 149 | 149 |