Android Question How to convert PNG to BMP image?

vecino

Well-Known Member
Licensed User
Longtime User
Hello, is there a library to convert images to BMP format?

I have a POS printer and only print images in BMP
Actually, you can also print in PNG and JPG format, but the print quality is terrible.
However, in BMP format images are printed very well.

Thanks and regards.
 

DonManfred

Expert
Licensed User
Longtime User
I haven´t seen such a lib. And i think it´s not needed for android-programming cause you can use PNG (Alphachannel possible) or JPG.

BMPs are MUCH bigger in Filesize and storage is limited on Devices.
So, i think, that´s the cause why BMPs are not the favorite Image-Type ;-)

  • Bitmap 1 Bit
  • Grayscale 8 Bit
  • RGB 24 Bit (8 Bit each channel)
  • CMYK 32 Bit (8 Bit each channel)
Filefize

WIDTH x HEIGHT x Colordept*
* [Colordept = Colordept for each channel x channelcount]

For the above it would be:

As Example we are using a 128x128 Pixel Image (which is not really big ;-))

Bitmap (128x128x1) 16.384 Bytes, 16kb (NOTE: Black/White-Image. No Colors)
Grayscale (128x128x8) 131.072 Bytes, 128kb
RGB (128x128x24) 393.216 Bytes, 384kb
CMYK (128x128x32) 524.288 Bytes, 512kb

Saved as PNG or JPG it would be much lesser in FileSize.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I agree with you .... But I will not save images.
Just create an image for printing. Each time.

BMP image sent to the printer:

PNG image sent to the printer:


Thanks and regards.
 
Last edited:
Upvote 0
Top