Android: Converting a Bitmap to a Monochrome Bitmap (1 Bit per Pixel)

前端 未结 4 1582
一向
一向 2020-12-05 00:57

I want to print a Bitmap to a mobile Bluetooth Printer (Bixolon SPP-R200) - the SDK doesn\'t offer direkt methods to print an in-memory image. So I thought about converting

4条回答
  •  温柔的废话
    2020-12-05 01:22

    Converting to monochrome with exact the same size as the original bitmap is not enough to print.

    Printers can only print each "pixel" (dot) as monochrome because each spot of ink has only 1 color, so they must use much more dots than enough and adjust their size, density... to emulate the grayscale-like feel. This technique is called halftoning. You can see that printers often have resolution at least 600dpi, normally 1200-4800dpi, while display screen often tops at 200-300ppi.

    Halftone

    So your monochrome bitmap should be at least 3 times the original resolution in each side.

提交回复
热议问题