Description
Currently the logic checks if all pixels in all channels are below 20.
How well is this working? If it's fine, keep it.
If you want to do something else, here are some suggestions based on my experience with image processing:
Take the average pixel value across all channels. Threshold it to <5. That way, even small blips of white that may be there will get washed out in the process of averaging. From what I understand, having a single pixel of (255,255,255) right now would prevent the logic from returning True (I'm not native to JS but that's my understanding from the cloudfunction repo's index.js
).
Take the median. Same logic.
Sum all three channels, divide by 3. If the proportion of pixels below (5,5,5) exceeds 95% / 99%, mark it as solid.
JPEG compression really in theory shouldn't be leaving artifacts in all-black images. But if someone clips just a bit of white in there, we want to be able to catch that.
Activity