8bitlenser/lenser/iigs/convert/shr.py
2026-07-03 19:35:35 -07:00

19 lines
683 B
Python

"""Apple IIGS Super Hi-Res: 320x200, 16 colours/line from 16 palettes of 4096."""
from __future__ import annotations
from ...convert.base import Conversion
from . import _common
WIDTH, HEIGHT = 320, 200
PIXEL_ASPECT = 1.0
def convert(img_rgb, palette_name="iigs", dither_mode="floyd",
intensive=False, base_color=None):
block, preview, err = _common.encode(img_rgb, dither_mode, mono=False)
return Conversion(
mode="shr", width=WIDTH, height=HEIGHT, pixel_aspect=PIXEL_ASPECT,
index_image=None, data=block, data_addr=0x2000, viewer="iigs",
preview_rgb=preview, error=err,
meta={"palette": "iigs", "dither": dither_mode},
)