22 lines
807 B
Python
22 lines
807 B
Python
"""Amiga monochrome: 320x200, 16 grey levels (the Amiga has true 16 greys)."""
|
|
from __future__ import annotations
|
|
|
|
from ...convert.base import Conversion
|
|
from . import _common
|
|
|
|
WIDTH, HEIGHT = 320, 200
|
|
PIXEL_ASPECT = 1.0
|
|
NCOL = 16
|
|
|
|
|
|
def convert(img_rgb, palette_name="amiga", dither_mode="floyd",
|
|
intensive=False, base_color=None):
|
|
planes, colors, preview, err = _common.flat_encode(
|
|
img_rgb, NCOL, dither_mode, mono=True, base_color=base_color)
|
|
return Conversion(
|
|
mode="mono", width=WIDTH, height=HEIGHT, pixel_aspect=PIXEL_ASPECT,
|
|
index_image=None,
|
|
data={"planes": planes, "colors": colors, "nplanes": 4, "ham": False},
|
|
data_addr=0, viewer="amiga", preview_rgb=preview, error=err,
|
|
meta={"palette": "amiga", "dither": dither_mode},
|
|
)
|