reenigne wrote on 2023-09-14, 20:24:
That would indeed be a very nice and simple mod! Bit 4 or 5 of the palette register would be a good one to choose as it otherwise has no effect in text modes. Since only half of the bit patterns are needed (you can get the others by swapping the foreground and background colours) you could use half of the character positions for a 640x100x16 mode and the other half for a 320x200x16 mode.
Sure. Such patterns would also be an option, and admittedly a much simpler one.
reenigne wrote on 2023-09-14, 20:24:
Could you elaborate on how the Walsh-Hadamard transform could be useful here? I'm intrigued! My CGAArt program can do this sort of lossy compression (picking the optimal character/foreground/background combination in each character position) but doesn't use such a transform.
I think what makes the (2D) WHT handy is that, much like with the DCT, you basically get the spectrum of the input data, but kind of the square wave version, which looks better-suited to bi-level input data.
If you use a JPEG-like zig-zag reordering of the 2D coefficient matrix, quantize the WHT coefficients with power-of-two quantization factors by truncation and concatenate them, you would get a bit string that, if interpreted as an integer, roughly has the coarse features, starting with the DC offset, in the most significant bits and the fine detail in the least significant bits. This can then be used as a table index for locality-sensitive hashing, i.e. to help find an approximate nearest neighbor without an exhaustive search, and ideally in O(1).
This should technically work with arbitrary target pixel patterns, but one could also custom tailor them to the WHT to optimize the selection process.