Remove ASCII BGRs from BMP

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Locked
Stefano
Posts: 3
Joined: 2015-12-22T07:34:34-07:00
Authentication code: 1151

Remove ASCII BGRs from BMP

Post by Stefano »

Hi,

my name is Stefano, and I'm a member of IT staff in a multisite company.
I have to insert QR Codes in our Crystal Report 6 (used for internally develop applications) that can accept ONLY BMP.
I have created qr in png, and then converted them using ImageMagick convert.exe into bmp, but CR6 cannot recognize them correctly.

I guess I found the issue: opening the converted bmp with notepad, I see the initial string with BGRs entry (I guess color profile).
I've tried to open that bmp with MS Paint and then simply saved it again: the resulting saved bmp does NOT have that ASCII BGRs value, and CR6 can read it properly!!!

I wish to use convert to automatically do the above: I've tried -strip / +profile options, but with no result.
Could you please let me know how I can achieve my goal?

Thank you in advance

Stefano
Posts: 3
Joined: 2015-12-22T07:34:34-07:00
Authentication code: 1151

Re: Remove ASCII BGRs from BMP

Post by Stefano »

Additional info:

i've also tried BMP2: option... It removed the BGRs header, but it lets CR6 crash (differently from the saved bmp from Paint...)!

User avatar
GeeMack
Posts: 757
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Remove ASCII BGRs from BMP

Post by GeeMack »

Stefano wrote:Could you please let me know how I can achieve my goal?
IM should be able to convert your PNG to a few slightly different BMP formats. I'm using IM7 which can convert to BMP, BMP2, and BMP3. When I save a BMP with MS Paint and check it with IM's "identify"...

Code: Select all

identify qrcode.bmp
...it shows as a BMP3. You might try forcing IM to use BMP3 using a command something like this...

Code: Select all

convert qrcode.png -define bmp:format=bmp3 qrcode.bmp

Stefano
Posts: 3
Joined: 2015-12-22T07:34:34-07:00
Authentication code: 1151

Re: Remove ASCII BGRs from BMP

Post by Stefano »

You might try forcing IM to use BMP3 using a command something like this...

CODE: SELECT ALL
convert qrcode.png -define bmp:format=bmp3 qrcode.bmp
Great! It works! Thank you very much for your support!

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Remove ASCII BGRs from BMP

Post by fmw42 »

You can also do it this way:

Code: Select all

convert qrcode.png BMP3:qrcode.bmp

Locked