Support for binary images
I need a way to represent an image mask, i.e. an overlay on an image that indicates which pixels are included and which are not. This implies a binary image type backed by bool primitives. To my knowledge this is unsupported in the image crate because Pixel has no corresponding implementation, nor is there an appropriate member of color::ColorType.
I'm filing this issue as a feature request that a new Binary color type and corresponding pixel type be implemented, allowing representation of binary images. I understand this could be a challenge as Primitive used by Pixel implies traits like Num and NumCast that might be hard to reconcile with bool. So I'm not getting my hopes up, but I want to put the request out here in case it can be resolved at some time in the future.
Attempting my own implementation using a copied version of the define_colors! macro and Blend and Invert, I can get very close to a binary image implementation very quickly. However, the need for bool to implement Primitive and thus Num/NumCast/Bounded is not something I can address on my own since I don't own any of those traits.
The use case is of course understandable, and I've considered the very same question for a strongly typed GPU pipeline. It seems to me to be more easily resolved if we're not going to have binary images as ImageBuffer. This would have the same problem as C++'s std::vector<bool> and that's not a promising path to walk. bool pixels would be the sole types that can not have their components addressed as individual elements by reference, needs separate methods for writing them, etc. Another buffer type should be used here instead that is from ground-up written as a mask with more limited modification operations such that it can be represented correctly and not interfere with the ImageBuffer/DynamicImage API.