4 ms·
Sounds like an abstraction not far enough: if you want that single-color optimization, make it an image format that only allows 1x1. It would work whereever a r
by usrusr 4y ago
Sounds like an abstraction not far enough: if you want that single-color optimization, make it an image format that only allows 1x1. It would work whereever a reader for that image format exist, but code that's eager to take performance shortcuts would be free to add a little optimization. Same for the configuration UI, an "image or color picker" would be fully transparent to image picker only.
Bonus points if the specification of that image format allows itself the impertinence of annexing the file name: "if the file name starts with a hash sign and is followed by three or six hex digits, the color of the pixel is that color, contents of the file are considered a comment"