Search code examples
imagemagickbmp

ImageMagick Convert BMP from 24 bit to 16 bit question?


Trying to convert bmp file from 24-bit to 16-bit bmp by ImageMagick and ViX 統合画像ビュアー. This is the same as the thumbnail in my images, but in hex content is not my expected. And the question I ask because I have to covert these 16-bit bmp files to a .spr (Sprite image file) for MMORPG Game(Lineage 1).

  • ImageMagickVersion: ImageMagick-7.1.0-portable-Q16-HDRI-x64
  • ViX 統合画像ビュアー Version: ViX 2.21
  • Plateform: Win11
  • Source fils here
    1. Input_24bit.bmp
    2. Output_16bit_ViX.bmp
    3. Output_16bit_IM.bmp

ImageMagick Command

convert '24_bit.bmp' -alpha off -define bmp:subtype=RGB565 '16_bit.bmp'

ViX 統合画像ビュアー

Use GUI windows to decreasing color to Highcolor(16bit)

Result presenting (Red background will been transparent in Game) enter image description here

BMP Hex Compare

  • (A) result from ViX 統合画像ビュアー that I expected
  • (B) result from Imagemagick convert

enter image description here


Solution

  • The difference is that ImageMagick, by default, writes a v5 BMP, whereas your program has written a v3 BMP.

    To make ImageMagick write the older BMP3 format, prefix your output filename with BMP3: like this:

    convert input.bmp -alpha off -define bmp:subtype=RGB565 BMP3:output.bmp