First public commit.
This commit is contained in:
parent
2a48f52979
commit
4bac9d83ed
288 changed files with 18417 additions and 1076 deletions
19
lenser/a2600/convert/__init__.py
Normal file
19
lenser/a2600/convert/__init__.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
"""Atari 2600 conversion dispatch."""
|
||||
from __future__ import annotations
|
||||
from ... import imageprep
|
||||
from . import pf
|
||||
|
||||
# "pf" = flicker-free 3-colour/scanline; "pf_il" = temporal interlace (two
|
||||
# frames at 60Hz blend to ~4-6 perceived colours/scanline, at the cost of flicker);
|
||||
# "mono" = pf restricted to the TIA's greys (one hue's 8 luminances).
|
||||
MODES = ["pf", "pf_il", "mono"]
|
||||
|
||||
|
||||
def convert_image(path_or_img, mode="pf", palette_name="tia",
|
||||
dither_mode="floyd", intensive=False, prep_opt=None, base_color=None):
|
||||
prep_opt = prep_opt or imageprep.PrepOptions()
|
||||
img_rgb = imageprep.prepare(path_or_img, pf.WIDTH, pf.HEIGHT,
|
||||
pf.PIXEL_ASPECT, prep_opt, border_rgb=(0, 0, 0))
|
||||
return pf.convert(img_rgb, palette_name, dither_mode, intensive,
|
||||
base_color=base_color, interlace=(mode == "pf_il"),
|
||||
gray=(mode == "mono"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue