Commit Graph

  • 7ad560247b Clean up kris 2021-11-16 12:24:43 +0000
  • 10c829906b Checkpoint - Repeatedly refit palettes since k-means is only a local optimization. This can produce incremental improvements in image quality but may also overfit, especially on complex images. - use pygame to render incremental images - Fix off-by-one in palette striping - When fitting palettes, first cluster a 16-colour palette for the entire image and use this to initialize the centroids for individual palettes. This improves quality when fitting images with large blocks of colour, since they will otherwise be fit separately and may have slight differences. With a global initializer these will tend to be the same. This also improves performance. kris 2021-11-16 11:21:53 +0000
  • b363d60754 Checkpoint kris 2021-11-15 09:19:44 +0000
  • 643e50349e Optimize more kris 2021-11-13 17:29:13 +0000
  • 0596aefe0b Use pyclustering for kmedians instead of hand-rolled kris 2021-11-13 17:18:34 +0000
  • 52af982159 k-means should be using median with L1 norm, otherwise it may not converge kris 2021-11-13 16:10:33 +0000
  • 5cab854269 Fit palettes from overlapping line ranges, and map line to palette when dithering with two limitations: kris 2021-11-11 16:10:03 +0000
  • ee2229d0ea * Modify Floyd-Steinberg dithering to diffuse less error in the y direction. Otherwise, errors can accumulate in an RGB channel if there are no palette colours with an extremal value, and then when we introduce a new palette the error all suddenly discharges in a spurious horizontal line. This now gives quite good results! kris 2021-11-11 11:10:22 +0000
  • 8c34d87216 WIP - interleave 3 successive palettes for each contiguous row range. Avoids the banding but not clear if it's overall better kris 2021-11-10 18:30:39 +0000
  • 322123522c Assign scan lines randomly to palettes and cluster independently. This doesn't give good results either, since neighbouring lines end up getting similar but not identical colours, which still results in horizontal striping. kris 2021-11-10 00:34:17 +0000
  • fb52815412 Experiment with striping 16 palettes contiguously across line ranges. As expected it has clear banding. A better approach (though still not optimal) might be to assign lines to palettes randomly. kris 2021-11-09 22:42:27 +0000
  • 80885aabf9 Working SHR version. Still just uses a single palette kris 2021-11-09 22:26:34 +0000
  • 21058084e2 Tidy kris 2021-11-09 16:14:37 +0000
  • 01b19a4a06 Use 4-bit RGB values instead of 8-bit kris 2021-11-09 15:35:44 +0000
  • a92c9cd7b5 Work in CAM16-UCS colour space and cythonize kris 2021-11-09 15:13:07 +0000
  • 173c283369 First implementation of using k-means clustering in RGB space to dither a 320x200 SHR image. kris 2021-11-09 11:23:25 +0000
  • 0630db2bf1 More relnotes v1.1 kris 2021-11-04 14:55:23 +0000
  • f097945b2e Add version history colourspacious kris 2021-11-04 14:46:53 +0000
  • aebb21263e Update docs kris 2021-11-04 14:35:14 +0000
  • 387500a9b4 Remove stray file kris 2021-11-04 14:34:44 +0000
  • bd19d27bd3 Add a script to regenerate image conversions for example images, and add a .po disk image kris 2021-11-04 14:32:58 +0000
  • 7e68847bfe nit kris 2021-11-04 14:31:33 +0000
  • 1010b64272 Fix shift_pixel_window when shift_right_by > window_width kris 2021-11-03 15:19:29 +0000
  • 34ae40ac2d Fix a bug with output for non-ntsc palette kris 2021-11-03 15:17:57 +0000
  • b7174778e6 Oops, no that was wrong. I forgot to cross-check against OpenEmulator <o> kris 2021-11-03 12:40:22 +0000
  • bf76271d75 NTSC conversion should be using YIQ space instead of YUV, which seems to explain several fudge factors I needed to include to match colours. kris 2021-11-02 23:28:58 +0000
  • df0adec8aa Fix typo kris 2021-11-02 22:24:47 +0000
  • d35cdbc877 Switch remaining palettes to be indexed by (n-bit pixel value, NTSC phase) and update the comments to explain the encoding scheme. kris 2021-11-02 22:15:13 +0000
  • 52bd35e875 Update comment kris 2021-11-02 22:15:09 +0000
  • 3544bd74c8 Update comment kris 2021-11-02 22:14:59 +0000
  • 1ed565ff8d Fix a bug with palette depths < 8 kris 2021-11-02 22:14:42 +0000
  • 0f1ec6f6f2 Optimize memory a bit kris 2021-11-02 21:25:00 +0000
  • 4fbb0faf84 Fixes kris 2021-11-02 15:47:37 +0000
  • 9dbf413733 Tidy kris 2021-11-02 15:45:20 +0000
  • e84dfb59f9 Tidy a bit kris 2021-11-02 15:26:43 +0000
  • b63fd81c07 Unify DHGRScreen implementations kris 2021-11-02 15:23:23 +0000
  • 75a3c6bc48 Simplify image_to_rgb and remove the need for DOTS and DOTS_TO_INDEX kris 2021-11-02 15:14:22 +0000
  • 809b975e6e Return a bitmap directly from dither_image. This removes the need to deal with n-bit encodings at all in DHGRScreen kris 2021-11-02 14:42:00 +0000
  • b7e8c69f64 More descriptive variables kris 2021-11-02 13:48:53 +0000
  • cf69dc9cf2 Bounds check lookahead kris 2021-11-02 13:42:23 +0000
  • 8cfee55b1d Get rid of support for 140px mode, it was only useful as a demo of why other converters have the wrong basic approach. kris 2021-11-02 13:40:32 +0000
  • d442baf1f1 Tidy a bit kris 2021-11-02 12:30:43 +0000
  • 5675fac40d Clean up a bit and accommodate palette depth in sliding pixel window kris 2021-11-02 12:29:30 +0000
  • 24644658cb Tidy a bit kris 2021-11-01 12:10:02 +0000
  • 0c588f7489 Tidy kris 2021-07-19 18:40:16 +0100
  • e5c49b3518 Floyd-Steinberg is working well now, and gives better detail kris 2021-07-19 18:39:38 +0100
  • feefdb5dc6 Use .npy format for RGB to CAM16UCS conversion matrix, and get rid of precomputed CIE2000 distances kris 2021-07-19 18:35:44 +0100
  • e979df03bc Nope, don't need XYZ kris 2021-07-19 18:13:43 +0100
  • 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 kris 2021-07-19 17:54:46 +0100
  • 4984df7f7a Tidy up and optimize a bit kris 2021-07-19 13:21:32 +0100
  • e08f25e4cc Simplify kris 2021-07-19 12:55:50 +0100
  • 20a73ffb8a Checkpoint - working again, and simpler kris 2021-07-19 12:33:49 +0100
  • 508ce134aa Try to fix how we compute the next pixel palette for 8-bit mode. Still not sure this is correct. kris 2021-07-19 09:58:22 +0100
  • 70074a2942 Support arbitrary gamma correction of input image kris 2021-07-19 09:57:26 +0100
  • 7a3adea025 Try cam16UCS instead kris 2021-07-15 14:25:32 +0100
  • 4fcda908bd WIP - use colourspacious to perform image dithering in CAM02_UCS colour space, which is supposed to be perceptually uniform. i.e. we can use Euclidean distance instead of CIEDE2000 kris 2021-07-15 13:58:22 +0100
  • 9bbb9fda7c Fix typos in x transition labels kris 2021-07-15 09:41:57 +0100
  • a593639606 Allow parametrizing gamma kris 2021-05-28 11:24:05 +0100
  • 07a358d49b Fix --all to be an optional boolean argument, and fix a deprecation warning (h/t: 4am) kris 2021-03-15 21:42:21 +0000
  • fb6a0f90ab whitespace kris 2021-03-15 21:42:01 +0000
  • 99242d455f Fix warning kris 2021-03-15 21:41:39 +0000
  • 7a7923503f With recent optimizations converter became ~2.1x faster, so --lookahead=8 is a reasonable new default. kris 2021-03-15 17:55:21 +0000
  • 5487b4aa7e Note disk space requirements and tweak usage kris 2021-03-15 17:50:56 +0000
  • 527f6504f7 Add comments and tidy up some more kris 2021-03-15 17:22:14 +0000
  • 101d974d50 Use hyphens in option names so that --no-boolean-option is consistently hyphenated. kris 2021-03-15 17:21:22 +0000
  • ede063a21b No need to pattern to have third axis of shape 1 kris 2021-03-15 16:22:55 +0000
  • 551be3eba7 Get --resolution=140 working again kris 2021-03-15 15:41:33 +0000
  • fcf83aaf9c Even more fasterer! kris 2021-02-05 23:08:12 +0000
  • f157272327 Checkpoint more type annotations kris 2021-02-05 22:10:44 +0000
  • 722e85f645 Combine loops in dither_lookahead and don't bother dithering beyond lookahead or edge of screen. kris 2021-02-05 21:29:09 +0000
  • 8b48455c8f Checkpoint kris 2021-02-05 00:48:01 +0000
  • 049c334950 Fixed kris 2021-02-05 00:08:14 +0000
  • f4cc7dac40 Checkpoint - I broke something kris 2021-02-04 23:16:31 +0000
  • a686ef76c3 WIP kris 2021-02-04 23:00:10 +0000
  • f87ca90fd4 Add a --verbose option to output progress kris 2021-03-15 15:01:21 +0000
  • e98116b276 Tidy up for merge kris 2021-03-15 14:01:14 +0000
  • 72de8f0dfe Try using a table ntsc kris 2021-03-15 13:55:44 +0000
  • 4ddd48ed8c Try to fix image layout kris 2021-03-15 13:43:25 +0000
  • 85ad76a251 More fixes kris 2021-03-15 13:41:01 +0000
  • aa802b93d4 Fixes kris 2021-03-15 13:35:17 +0000
  • 5f78cf53d3 Fixes kris 2021-03-15 13:33:07 +0000
  • 4b00da3771 Add more screenshots of --palette=openemulator kris 2021-03-15 13:08:34 +0000
  • 93456edb53 Openemulator screenshots of NTSC image conversions kris 2021-03-15 12:07:59 +0000
  • d5e6038939 Regen kris 2021-03-15 11:50:51 +0000
  • aef135808c Rename files to match existing scheme kris 2021-03-15 11:05:56 +0000
  • 61052ca93c Add DHR and preview images rendered with --palette=ntsc kris 2021-03-15 10:59:04 +0000
  • e1108b4dd0 Tidy up a bit in preparation for merge. kris 2021-03-15 10:45:57 +0000
  • 467a0cd196 Tidy up a bit to prepare for merge kris 2021-03-15 10:45:33 +0000
  • d5bd173345 Update to describe NTSC emulation kris 2021-02-18 00:53:43 +0000
  • e0b732cdaa Reimplement NTSC conversion to closely match openemulator output. I can't figure out why contrast=2 is needed (openemulator uses a default value of 1, so there must be a factor of 2x somewhere), or where the slight hue rotation comes from - perhaps this is somehow introduced by the more complex band-pass filtering that openemulator does? kris 2021-02-17 21:29:43 +0000
  • e1dab91783 Whitespace kris 2021-02-14 23:42:57 +0000
  • 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! kris 2021-02-14 23:34:25 +0000
  • 301ca2772b Checkpoint kris 2021-02-04 22:00:03 +0000
  • 3ac5c284e9 Checkpoint NTSC emulation kris 2021-02-03 23:40:16 +0000
  • a835baadf8 Fix --show_input kris 2021-01-26 00:16:51 +0000
  • b29f5f2b18 Create directory before writing to it kris 2021-01-25 23:57:07 +0000
  • c3c88efc09 Fix path typos kris 2021-01-25 23:42:17 +0000
  • 2bbd65a079 Add some comments and docstrings kris 2021-01-25 23:16:46 +0000
  • a7d734f2b0 Fix broken paths kris 2021-01-25 22:47:41 +0000
  • 6a3707e1fa Rename file to try and get github to render link kris 2021-01-25 22:46:37 +0000