Commit Graph

11 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 39e8eac8ed Add support for DHGR mono conversions 2023-01-21 17:30:27 +00:00
kris 9dbf413733 Tidy 2021-11-02 15:45:20 +00:00
kris 8b500b16cb Dither in XYZ representation but use CAM16UCS for colour differences.
This gives the best of both worlds: dithering in a linear space, with
good (and fast) perceptual error differences

TBD: would linear RGB work as well as XYZ?
2021-07-19 17:54:46 +01:00
kris 70074a2942 Support arbitrary gamma correction of input image 2021-07-19 09:57:26 +01:00
kris a593639606 Allow parametrizing gamma 2021-05-28 11:24:05 +01:00
kris 3ac5c284e9 Checkpoint NTSC emulation 2021-02-03 23:40:16 +00:00
kris 2bbd65a079 Add some comments and docstrings 2021-01-25 23:16:46 +00:00
kris a4ecf69610 Checkpoint WIP 2021-01-21 23:17:55 +00:00
kris f9f1398969 Show output as 560x384 regardless of input size 2021-01-16 17:57:21 +00:00
kris 31b565f22a Refactor a bit 2021-01-15 22:18:25 +00:00