Behaviour of -define bmp:subtype=RGB565

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Locked
Dus
Posts: 10
Joined: 2013-04-16T04:57:39-07:00
Authentication code: 6789

Behaviour of -define bmp:subtype=RGB565

Post by Dus »

Apologies if this is just pebkac or if it's known already but I could not find info specific to this possible bug.

Using ImageMagick-7.0.8-60-portable-Q16-x86.zip on win7 I find the command

convert tst.bmp -define bmp:subtype=RGB565 rslt.bmp

gives a shift of 6 pixels to the left in rslt.bmp. The six columns that fell off now fill the right of the image. With some anomalies at the right top.
I think you can reproduce this with any old bmp made in mspaint.

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

Re: Behaviour of -define bmp:subtype=RGB565

Post by snibgo »

Please paste links to the input and output image files.
snibgo's IM pages: im.snibgo.com

Dus
Posts: 10
Joined: 2013-04-16T04:57:39-07:00
Authentication code: 6789

Re: Behaviour of -define bmp:subtype=RGB565

Post by Dus »


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

Re: Behaviour of -define bmp:subtype=RGB565

Post by snibgo »

Using Windows Photo Viewer, those images (rslt.bmp and 200x26.bmp) look identical.
snibgo's IM pages: im.snibgo.com

Dus
Posts: 10
Joined: 2013-04-16T04:57:39-07:00
Authentication code: 6789

Re: Behaviour of -define bmp:subtype=RGB565

Post by Dus »

http://www.yourfilelink.com/get.php?fid=2117930

What I see is in the zip. rslt is the top image because of the specific top right corner.
I've done this on an XP machine as well, it's the same.

Which version introduced bmp:subtype=RGB565 ?

Jason S
Posts: 103
Joined: 2010-12-14T19:42:12-07:00
Authentication code: 8675308

Re: Behaviour of -define bmp:subtype=RGB565

Post by Jason S »

Your rslt.bmp file looks okay in the viewers and web browsers I tried, and is correct based on what I know about BMP format. But it is an uncommon type of BMP, not supported by everything.

I guess you are using a viewer that does not support the combination of a BMPv5 header (which ImageMagick calls "BMP4", because reasons) and a BI_BITFIELDS image type (which is required for RGB565).

Maybe your viewer does support BMPv3 with BI_BITFIELDS, but unfortunately I don't know any way to get ImageMagick (as of 7.0.8-61) to correctly write such an image. It will try, if you use "-define bmp:format=bmp3", but it does it wrong.

Dus
Posts: 10
Joined: 2013-04-16T04:57:39-07:00
Authentication code: 6789

Re: Behaviour of -define bmp:subtype=RGB565

Post by Dus »

It never occured to me to drag the bmp to Firefox in which it looks OK.
Now first I need to see how much I need this, thanks.

Locked