Commit Graph

18 Commits

Author SHA1 Message Date
kris
467a0cd196 Tidy up a bit to prepare for merge 2021-03-15 10:45:33 +00:00
kris
ad9515dcf2 Implement NTSC emulation, using an 8 pixel window for chroma signal.
Use this to precompute a new ntsc palette with 256 entries (though
only 84 unique colours) that are available by appropriate pixel
sequences.  Unfortunately the precomputed distance matrix for this
palette is 4GB!

Optimize the precomputation to be less memory hungry, while also
making efficient use of the mmapped output file.

Add support for dithering images using this 8-bit palette depth,
i.e. to optimize for NTSC rendering.  This often gives better image
quality since more colours are available, especially when modulating
areas of similar colour.

Fix 140 pixel dithering and render the output including NTSC fringing
instead of the unrealistic 140px output that doesn't include it.

Add support for rendering output image using any target palette, which
is useful e.g. for comparing how an 8-pixel NTSC rendered image will
be displayed on an emulator using 4-pixel ntsc emulation (there is
usually some colour bias, because the 8 pixel chroma blending tends to
average away colours).

Switch the output binary format to write AUX memory first, which
matches the image format of other utilities.
2021-02-14 23:34:25 +00:00
kris
3ac5c284e9 Checkpoint NTSC emulation 2021-02-03 23:40:16 +00:00
kris
a835baadf8 Fix --show_input 2021-01-26 00:16:51 +00:00
kris
2bbd65a079 Add some comments and docstrings 2021-01-25 23:16:46 +00:00
kris
dd8cf07c49 Add support for multiple palettes 2021-01-25 22:28:00 +00:00
kris
84442f32a7 Clean up some more 2021-01-21 23:33:12 +00:00
kris
a4ecf69610 Checkpoint WIP 2021-01-21 23:17:55 +00:00
kris
9f0cd870e7 In 140px resolution show the output image with and without NTSC fringing 2021-01-16 18:11:21 +00:00
kris
f9f1398969 Show output as 560x384 regardless of input size 2021-01-16 17:57:21 +00:00
kris
18ce9d8f82 Expand help text 2021-01-15 23:03:31 +00:00
kris
a061795022 Re-enable 140px mode 2021-01-15 22:58:01 +00:00
kris
8d671f08ac Remove bitmap support 2021-01-15 22:34:22 +00:00
kris
d57d6f9038 Add flags to show input/output images 2021-01-15 22:34:03 +00:00
kris
ce99d62304 Tidy 2021-01-15 22:28:44 +00:00
kris
f132f0b84b Default to --lookahead=6 now that it's fast 2021-01-15 22:25:32 +00:00
kris
c5b8feb17e Parametrize dither patterns as command-line argument 2021-01-15 22:25:06 +00:00
kris
f5553e00b8 Rename 2021-01-15 22:20:28 +00:00