First public commit.

This commit is contained in:
The Dust Council 2026-07-03 19:35:35 -07:00
parent 2a48f52979
commit 4bac9d83ed
288 changed files with 18417 additions and 1076 deletions

View file

@ -0,0 +1,24 @@
"""CoCo 3 GIME 320x192, 4 colours from the 64-colour palette (more resolution,
fewer colours than gr16)."""
from __future__ import annotations
from ...convert.base import Conversion, perceptual_error
from . import _common
WIDTH, HEIGHT = 320, 192
PIXEL_ASPECT = 1.0
NCOL = 4
CRES = 1
def convert(img_rgb, palette_name="gime", dither_mode="floyd",
intensive=False, base_color=None):
pen, inks, idx, img_lab, plab, prgb = _common.render(img_rgb, NCOL, dither_mode)
screen = _common.PACK[CRES](pen)
return Conversion(
mode="gr4", width=WIDTH, height=HEIGHT, pixel_aspect=PIXEL_ASPECT,
index_image=idx, data=screen, data_addr=0x4000, viewer="coco3",
preview_rgb=prgb[idx], error=perceptual_error(idx, img_lab, plab),
meta={"palette": "gime", "dither": dither_mode, "cres": CRES,
"inks": inks, "border": inks[0] if inks else 0},
)