cfef9fa3c9Add arg type
kris
2022-07-16 21:57:45 +0100
ccbb6980d9Load data files relative to script path
kris
2021-11-27 10:43:41 +0000
a2b67ba882Require a subcommand
kris
2021-11-26 13:36:29 +0000
4d5dea2c41Restore dhr conversion support
kris
2021-11-26 13:15:57 +0000
0a964b377aMove SHR conversion out into convert_shr in preparation for re-enabling dhr support
kris
2021-11-26 12:35:45 +0000
ae89682dabSplit out common utility functions into a shared module
kris
2021-11-26 12:26:46 +0000
0dc2c0a7a0Disable bounds checking and wraparound by default
kris
2021-11-26 12:12:55 +0000
4221c00701Split dither into dither_dhr and dither_shr
kris
2021-11-26 12:08:48 +0000
1075ff0136Tidy a bit and remove support for tunable parameters that are no longer needed
kris
2021-11-26 10:36:39 +0000
cf63a35797Cython tweaks to remove some unnecessary C code
kris
2021-11-26 09:54:42 +0000
25e6ed7b88Preserve palette order when deduplicating entries
kris
2021-11-25 21:57:27 +0000
61b4cbb184Tweak 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
ad50ed103dImprovements to image quality:
kris
2021-11-25 11:46:42 +0000
870c008827Parametrize 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
9a77af37aaAdd 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
0036ee9522Add default values to help
kris
2021-11-24 15:44:37 +0000
8d3ab4f50eAdd the ability to disable saving preview images. Also rename --gamma_correct to --gamma-correct for consistency
kris
2021-11-24 15:41:32 +0000
8175dcb052Add --fixed-colours to control how many colours will be kept identical across all 16 SHR palettes.
kris
2021-11-24 15:27:34 +0000
5fefd0b0bbDon't initialize pygame if --no-show-output
kris
2021-11-24 15:24:58 +0000
c36de2b76bWhen 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
3b8767782bEach 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
de8a303de2Initial attempt at fitting palettes to arbitrary lines instead of line ranges.
kris
2021-11-24 10:41:25 +0000
1ce5c25764Fix 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
6e52680cf1Dynamically tune the line ranges used to fit the 16 SHR palettes:
kris
2021-11-23 13:01:50 +0000
189b4655adSince 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
7609297f0dOptimize a bit
kris
2021-11-18 17:34:27 +0000
d7969f50baRemove cython checks and obsolete TODO
kris
2021-11-18 17:24:12 +0000
e53c085a91Remove debugging prints
kris
2021-11-17 22:55:47 +0000
ed2082344aWorking 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
f2f07ddc04Refactor and add comments
kris
2021-11-16 23:45:11 +0000