How to generate a monochrome bitmap with a bit depth of 1 in BMP format? #1619
-
Due to printing requirements, I need to use it NET6 generates a monochrome bitmap in BMP format with a bit depth of 1, a white background, and black text. May I ask Magick Can NET be implemented? My program needs to be deployed on the Ubuntu system, thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This should already be supported? What have you tried so far? |
Beta Was this translation helpful? Give feedback.
-
I tried the above code and the generated image is still 32-bit deep. If the format is set to MagickFormat Bmp3 generates a depth of 24 bits. |
Beta Was this translation helpful? Give feedback.
You should set
image.ColorType
toColorType.Bilevel
after you have called.Draw(image)
. This makes sure that the image becomes monochrome.