-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding 8bpp BMPs #21
Comments
Hi! The only reason this isn't supported is because it is unimplemented :) This library is mostly a result of needing to generate some simple images, and it was implemented because I couldn't find any other available library at that time. A pull-request with 8-bit encoding would be very much appreciated! Or maybe I'll sit down in the near future to look into it :) I was also about to recommend you to look at the PistonDevelopers/Image crate, but it seems like it only has support for BMP decoding. |
I checked the code and it seems that the pixel format is fixed to 3 channels. I guess we need to introduce another Image and Pixel types if we want in-memory representations of 1-channel images, since they aren't generic. But for the time being, just saving one channel of 3-channel image is enough for me. But thinking from perspective of contributing to the Rust ecosystem, a general solution would be nice. Then again, maybe it should be left as a concern for the Piston Image crate. |
A minimal solution for saving greyscale 8bpp BMPs would be some kind of an |
Sorry for delayed answer, got caught up with work. But yeah, a general It's been a little while since I've looked at the BMP specification, but The decoder will look for a color palette when it decodes the image, and it I'm not sure what the best way to construct an 8-bit image would be, but it Maybe the Pixel can be an enum, somthing similar to this (Where 32, 8, 4,
For this approach, the image would have to be an image of type pixel
This is just a rough outline, and it might be a bit of redundancy in here. On Tue, Jun 7, 2016 at 8:50 AM, Pyry Kontio notifications@github.com
|
Hi, I noticed that this library doesn't support encoding 8bpp BMPs. ( http://sondrele.github.io/rust-bmp/bmp/index.html )
Is this intentional, or just unimplemented? I'd like to save a 8bpp greyscale image, and BMP seems like an ideal format because of its simplicity.
The text was updated successfully, but these errors were encountered: