About QR codes and BMP formats

Hi,

I use QRCodelib for generate QR codes which I want to send to POS printers like a graphics. The problem is in size of that BMP file which is about 40KB, because it’s saved like a 24bpp version BMP. But for QR code is enough 1bpp and after convert the same file is just 1.7KB. Does anybody know how to set QRCodelib to save in 1bpp format, or maybe how to convert in clarion 24bpp to 1bpp BMP?

Thanks,

Marino

  1. Did you try to use ImageToPng? ImageToPng( fileNameIn (BMP), [fileNameOut] (PNG))
  2. ImageEx template could do this convert.
  3. https://imagemagick.org/ free tool can reduce colors using command line parameters.

Thank You on your answer, but…

  1. I think this is not the option … First, I use this in ver.8 and there is no this method, but I tried in ver.11 and this is not what I want to … I need .BMP, not .PNG … with this method image still stays with 24bpp, just compressed and, of course, not right format to be sent to POS printer.

  2. Just looked at ImageEx, can see that it is something in ImageExBmpSaverClass, something like PixelFormat IEPF:Format24bppRgb, so I guess that there is something like IEPF:Format1bpp, but I can’t find any example or something useful

  3. seems too complicated, that is “swiss-knife tool” and I need just one operation, but didn’t find neither that one what I want … The closest is maybe threshold, if I read correctly

Dear Marino,

  1. ImageEx template (use Reduce Color)
    Example: BitmapClass Image/Reduce Colors/Monochrome
    Save image as BMP. That’s all…
  1. Command-line for imagemagick tool;
    magick.exe test.jpeg -monochrome test.bmp
    That’s all…