converting bmp to grayscale png

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?".
Post Reply
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

converting bmp to grayscale png

Post by manit »

hi,
Here is my problem :-
$ convert -set colorspace Gray ./66/SIRE-66_6_2_HT4.bmp 66_SIRE-66_6_2_HT4.png
convert: length and filesize do not match `./66/SIRE-66_6_2_HT4.bmp' @ warning/bmp.c/ReadBMPImage/831.
$ file ./66/SIRE-66_6_2_HT4.bmp
./66/SIRE-66_6_2_HT4.bmp: PC bitmap, Windows 3.x format, 712 x 540 x 8
Input BMP File is at https://ufile.io/d1p9y

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converting bmp to grayscale png

Post by snibgo »

The metadata in your BMP says the image takes zero bytes in the file. This is clearly wrong, and IM warns you about this. But it is just a warning, and the result should be okay.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: converting bmp to grayscale png

Post by magick »

We inspected the image. It claims a file size of 1078 bytes whereas its actually 385558 and results in a warning exception.
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: converting bmp to grayscale png

Post by manit »

snibgo ,
you are right .
I saw error but command still works .

magick,
Can you tell how you found 1078 claim ?

Thanks.
Post Reply