Commit Graph

  • f55e878b8e
    Mark nogil functions as noexcept to avoid warning from newer cython (#15) main KrisKennaway 2023-10-29 14:43:55 +0000
  • d2857d7959 Mark nogil functions as noexcept to avoid warning from newer cython kris.kennaway/noexcept kris 2023-10-29 14:43:03 +0000
  • 69a96b4719
    Optimize palette initialization and NTSC image conversion (#13) KrisKennaway 2023-02-26 00:00:39 +0000
  • 4091dd259c Optimize palette initialization and NTSC image conversion optimize-dhr kris 2023-02-25 23:56:52 +0000
  • f8fbd768a5
    Optimize dither_dhr.dither_image performance by about 2x (#12) KrisKennaway 2023-02-25 21:21:43 +0000
  • 6f39862538 Optimize dither_dhr.dither_image performance by about 2x kris 2023-02-25 21:18:31 +0000
  • 7a4e27e0da Bump version in header kris 2023-02-03 00:42:11 +0000
  • 3aa29f2d2c
    Add support for hi-res conversions (#11) KrisKennaway 2023-02-03 00:40:32 +0000
  • 5d6cbfc438 Tweak hgr kris 2023-02-03 00:29:59 +0000
  • 4f8fe0c1e8 Fix breakage in refactoring kris 2023-02-03 00:29:19 +0000
  • a3433fd632 Document hi-res and add some examples kris 2023-02-03 00:28:54 +0000
  • 153c104f94 Rename class and add comments kris 2023-02-03 00:04:01 +0000
  • cb9228e46d Add comments kris 2023-02-02 23:55:08 +0000
  • b0aa38fe06 Unify DHR and HGR implementation in screen.py kris 2023-02-02 23:53:48 +0000
  • f019823505 Clean up hgr conversion optionns kris 2023-02-02 23:35:28 +0000
  • 36946f6ac7 Unify DHR and HGR image conversion kris 2023-02-02 23:18:03 +0000
  • d47defbd80 Prepare to unify with dither_dhr.pyx kris 2023-02-02 23:14:29 +0000
  • 762a21556a Clean up kris 2023-02-02 22:23:09 +0000
  • db4449ea26 Working version kris 2023-02-02 22:17:56 +0000
  • 154a0b7c29 WIP - HGR support kris 2023-01-31 21:10:54 +0000
  • 1b08a8f1b1 Whitespace kris 2023-01-28 15:26:13 +0000
  • 6573bad509
    Merge pull request #10 from KrisKennaway/fix-lookahead KrisKennaway 2023-01-31 21:32:02 +0000
  • 0560409717 Fix --lookahead parsing kris 2023-01-31 21:28:40 +0000
  • 055851aa9c
    Merge pull request #9 from KrisKennaway/create-data-dir KrisKennaway 2023-01-31 21:15:03 +0000
  • 2ab582790c Create data directory before writing to it create-data-dir kris 2023-01-31 21:12:42 +0000
  • 05a3624866
    Merge pull request #5 from KrisKennaway/mono KrisKennaway 2023-01-21 17:32:14 +0000
  • 39e8eac8ed Add support for DHGR mono conversions kris 2023-01-21 17:30:27 +0000
  • 629104b933 Fixes for python 3.10 and/or latest dependency versions kris 2023-01-21 17:29:06 +0000
  • 7b8b6bc12b Tweak kris 2022-07-19 22:41:38 +0100
  • 7ce574dc06 Add SHR details kris 2022-07-19 22:39:56 +0100
  • 2a1874face Tweak wording kris 2022-07-19 22:39:11 +0100
  • c61bd258fd Add sample SHR conversions kris 2022-07-19 22:38:59 +0100
  • b11b322c39 Move DHR examples to subdir in preparation for adding SHR examples kris 2022-07-18 23:11:23 +0100
  • bce2153d97
    Merge pull request #4 from KrisKennaway/shr KrisKennaway 2022-07-18 23:06:18 +0100
  • 1468e06d2f Tweak shr kris 2022-07-18 22:50:31 +0100
  • 1486f8a394 Add TODO kris 2022-07-18 22:31:22 +0100
  • 12d6805617 Update docs for 2.0 and split out the technical details of dhr into its own file kris 2022-07-18 22:30:56 +0100
  • e156dd3b48 Add a requirements.txt to simplify installation kris 2022-07-18 22:11:32 +0100
  • 3196369b7d Tidy a bit and add a --save-intermediate flag kris 2022-07-18 10:00:19 +0100
  • 1ffb2c9110 Tidy kris 2022-07-18 09:59:01 +0100
  • 8fd0ec5dc6 Set window title and clean up a bit kris 2022-07-16 22:13:26 +0100
  • e71352490d Add comments kris 2022-07-16 22:00:42 +0100
  • 99aa394196 Tweak comment kris 2022-07-16 22:00:14 +0100
  • cfef9fa3c9 Add arg type kris 2022-07-16 21:57:45 +0100
  • ccbb6980d9 Load data files relative to script path kris 2021-11-27 10:43:41 +0000
  • a2b67ba882 Require a subcommand kris 2021-11-26 13:36:29 +0000
  • 4d5dea2c41 Restore dhr conversion support kris 2021-11-26 13:15:57 +0000
  • 0a964b377a Move SHR conversion out into convert_shr in preparation for re-enabling dhr support kris 2021-11-26 12:35:45 +0000
  • ae89682dab Split out common utility functions into a shared module kris 2021-11-26 12:26:46 +0000
  • 0dc2c0a7a0 Disable bounds checking and wraparound by default kris 2021-11-26 12:12:55 +0000
  • 4221c00701 Split dither into dither_dhr and dither_shr kris 2021-11-26 12:08:48 +0000
  • 1075ff0136 Tidy a bit and remove support for tunable parameters that are no longer needed kris 2021-11-26 10:36:39 +0000
  • cf63a35797 Cython tweaks to remove some unnecessary C code kris 2021-11-26 09:54:42 +0000
  • 25e6ed7b88 Preserve palette order when deduplicating entries kris 2021-11-25 21:57:27 +0000
  • 61b4cbb184 Tweak k-means convergence criterion to return once the total centroid position error stops decreasing. kris 2021-11-25 21:33:12 +0000
  • fc35387360 - Fill any palettes that have fewer than 16 unique entries after clustering, using the most frequent pixel colours that are not yet in the palette kris 2021-11-25 13:14:22 +0000
  • ad50ed103d Improvements to image quality: kris 2021-11-25 11:46:42 +0000
  • 870c008827 Parametrize quantization error decay and minimum value. The latter helps with images where there are large solid colour fields that sometimes cause uneven dithering because of colours that cannot be matched with the //gs palette, but it's not a viable solution in general since it reduces overall quality (sometimes substantially, e.g. in case of vertical colour gradients) kris 2021-11-25 09:09:40 +0000
  • 8b5c3dc6c1 Fix bool flags kris 2021-11-24 16:03:55 +0000
  • 9a77af37aa Add a --show-final-score to output the final image quality score. This is useful when used as part of an image repository build pipeline, to avoid replacing existing images if the new score is higher. kris 2021-11-24 15:49:56 +0000
  • 0036ee9522 Add default values to help kris 2021-11-24 15:44:37 +0000
  • 8d3ab4f50e Add the ability to disable saving preview images. Also rename --gamma_correct to --gamma-correct for consistency kris 2021-11-24 15:41:32 +0000
  • 8175dcb052 Add --fixed-colours to control how many colours will be kept identical across all 16 SHR palettes. kris 2021-11-24 15:27:34 +0000
  • 5fefd0b0bb Don't initialize pygame if --no-show-output kris 2021-11-24 15:24:58 +0000
  • e77e7abd43 Rename kris 2021-11-24 15:24:45 +0000
  • d645cc5964 Tidy kris 2021-11-24 15:21:50 +0000
  • c36de2b76b When initializing centroids for fitting the SHR palettes, only use the reserved colours from the global palette, and pick unique random points from the samples for the rest. This encourages a larger range of colours in the resulting images and may improve quality. kris 2021-11-24 14:57:24 +0000
  • 3b8767782b Each run seems to converge fairly quickly but there is a lot of variation across runs. Run in a loop and keep the running best. kris 2021-11-24 11:47:39 +0000
  • de8a303de2 Initial attempt at fitting palettes to arbitrary lines instead of line ranges. kris 2021-11-24 10:41:25 +0000
  • 50c71d3a35 Whitespace kris 2021-11-24 09:19:35 +0000
  • 04fd4f7427 Move reassigning palettes back to after fitting, otherwise it does the wrong thing the first time. kris 2021-11-24 09:18:59 +0000
  • 62f23ff910 Don't mutate initial_centroids kris 2021-11-24 09:10:03 +0000
  • 7179d009e1 Refactor kris 2021-11-23 15:09:12 +0000
  • e488955c23 Reorder kris 2021-11-23 14:58:46 +0000
  • 0b985a66b9 Reorder and tidy kris 2021-11-23 14:58:09 +0000
  • c78f731cd7 Refactor kris 2021-11-23 14:55:45 +0000
  • 0323b80e68 Refactor kris 2021-11-23 14:51:04 +0000
  • 6988b19b43 Tidy kris 2021-11-23 14:00:57 +0000
  • 1ce5c25764 Fix a bug where _fit_global_palette would crash if there were fewer than 16 global colours computed. kris 2021-11-23 13:59:48 +0000
  • 6e52680cf1 Dynamically tune the line ranges used to fit the 16 SHR palettes: kris 2021-11-23 13:01:50 +0000
  • 189b4655ad Since fixing the bug in the previous commit there is no longer a need to limit to neighbouring palettes (which was unaware of the dynamic line splits anyway) kris 2021-11-23 12:49:37 +0000
  • be55fb859d - Fix a serious bug in best_palette_for_line which was not actually computing the palette with lowest per-row error, rather the lowest per-pixel error! - Tidy a bit kris 2021-11-23 12:46:36 +0000
  • b78c42e287 Fix rounding kris 2021-11-18 22:35:15 +0000
  • b1d3488182 Actually use equal-sized palette splits. With the previous version the first and last were smaller. kris 2021-11-18 22:27:19 +0000
  • 9e46ca48a0 Refactor to extract palette splits in preparation for tuning them dynamically kris 2021-11-18 22:08:09 +0000
  • cfc150ed13 Remove some dead code kris 2021-11-18 22:03:18 +0000
  • c608f6b961 Optimize calling _convert_cam16ucs_to_rgb12_iigs since it has significant overhead kris 2021-11-18 21:50:39 +0000
  • 3159a09c27 Uncomment kris 2021-11-18 20:33:21 +0000
  • 7609297f0d Optimize a bit kris 2021-11-18 17:34:27 +0000
  • d7969f50ba Remove cython checks and obsolete TODO kris 2021-11-18 17:24:12 +0000
  • e53c085a91 Remove debugging prints kris 2021-11-17 22:55:47 +0000
  • ed2082344a Working version! Quantize the k-means centroids in 12-bit //gs RGB space but continue to use CAM16-UCS for distances and updating centroid positions, before mapping back to the nearest legal 12-bit RGB position. kris 2021-11-17 22:49:06 +0000
  • 0009ce8913 - allow reserving a number of colours which are to be shared across all palettes. This will be useful for Total Replay which does an animation effect when displaying the image (first set palettes, then transition in pixels) kris 2021-11-17 17:09:42 +0000
  • f2f07ddc04 Refactor and add comments kris 2021-11-16 23:45:11 +0000
  • bb70eea7b0 Cleanup kris 2021-11-16 21:07:13 +0000
  • 613a36909c Suppress pygame message at startup kris 2021-11-16 17:23:31 +0000
  • 5111696d5c Compute number of unique colours. This does not seem to strongly depend on the width of the palette sampling. kris 2021-11-16 16:57:44 +0000
  • 91e4fd7cba Add comment kris 2021-11-16 15:50:19 +0000
  • 83b047b73f Whoops, fix a major bug with the iterated image fitting: we don't want to mutate our source image! kris 2021-11-16 15:44:04 +0000
  • 8694ab364e Perform conversions in linear RGB space kris 2021-11-16 12:38:53 +0000