Description
Say I have an indexed image with 16 input colors, and I want each input color to be reduced modulo 2**bit_depth
in the output. For example, input colors 1, 5, 9, and 13 would become 1 in the output. I have relied on this behavior of a different tool in a previous project targeting an 8-bit console with 2bpp character graphics. Would it be reasonable to add -c modulo
, which is -c embedded
without the fatal error on an out-of-bounds color value?
If there's no serious objection, I plan to attempt the PR myself.
Test case: testcase1.png
has 8 colors and uses all 8. testcase2.png
has 8 colors and uses the first 4; all color index values have been reduced modulo 4. testcase3.png
has 4 colors. Converting them with -c modulo
should produce the same character data as converting testcase3.png
with -c embedded
. (I've used two of them as test cases for #1064 as well.)