Commit Graph

9 Commits

Author SHA1 Message Date
KrisKennaway 3aa29f2d2c
Add support for hi-res conversions (#11)
Hi-Res is essentially a more constrained version of Double Hi-Res, in which only about half of the 560 horizontal screen pixels can be independently addressed.

In particular an 8 bit byte in screen memory controls 14 or 15 screen pixels.  Bits 0-7 are doubled, and bit 8 shifts these 14 dots to the right if enabled.  In this case bit 7 of the previous byte is repeated a third time.

This means that we have to optimize all 8 bits at once and move forward in increments of 14 screen pixels.

There's also a timing difference that results in a phase shift of the NTSC colour signal, which means the mappings from dot patterns to effective colours are rotated.

Error diffusion seems to give best results if we only distribute about 2/3 of the quantization error according to the dither pattern.
2023-02-03 00:40:32 +00:00
kris 629104b933 Fixes for python 3.10 and/or latest dependency versions 2023-01-21 17:29:06 +00:00
kris e5c49b3518 Floyd-Steinberg is working well now, and gives better detail 2021-07-19 18:39:38 +01:00
kris ede063a21b No need to pattern to have third axis of shape 1
Minor optimization to not compute error_fraction 3 times

Tidy a bit
2021-03-15 16:22:55 +00:00
kris 2bbd65a079 Add some comments and docstrings 2021-01-25 23:16:46 +00:00
kris 8577a00969 New default, modified Jarvis dither that propagates errors to 4 pixels
in the forward x-direction.
2021-01-25 22:43:03 +00:00
kris a4ecf69610 Checkpoint WIP 2021-01-21 23:17:55 +00:00
kris c5b8feb17e Parametrize dither patterns as command-line argument 2021-01-15 22:25:06 +00:00
kris 31b565f22a Refactor a bit 2021-01-15 22:18:25 +00:00