Do you know color-scheme?
It will certainly look familiar, as prefers-color-scheme has been around for longer and is clearly related.
Pal lets you apply an eight-color terminal color palette to any image you upload. Use the keyboard controls to choose a theme, set thresholds, and cycle hues.