I'm using a Custom s'print DPT100-S thermal printer to made a receipt printing application.
It is able to print graphics using 384 pixels in one line. This data has to be passed on to the printer using 48 bytes (48x8=384). So, each 'bit' represents one dot to be printed (bit will be '0' for white and '1' for black).
So, I need to create a program which will read a monochrome BMP generated in Windows Paint(or any other program) and convert it into this bit format using a C program in Linux.
Please guide me.
Pseudo code:
This link has a software called LCD assistant which does the same thing as you need. You have to use paint to convert any image to bitmap and then import that bmp image into the software. The output you can choose to be 384 X xyz. You get the output pixels in HEX.
Take a look at halftoning.
A quick Google will get you references and Java applet like here: http://www.markschulze.net/halftone/index.html
If you don't have to create your own program and you are happy to use off the shelf software, try ImageMagick's
convert
command: http://www.imagemagick.org/Usage/quantize/#halftone e.g.