Jump to content

BMP's created by ImageMagick will not display in a GUI


Go to solution Solved by ioa747,

Recommended Posts

Hello.  Attached are two images converted from the same source image.  One created by Directory Opus and the other created by ImageMagick.

The ImageMagick image will not display in an AutoIt GUI, but those created by other programs work fine (I also tried GIMP and IrfanView converts).

Any idea what's wrong?

My ImageMagick command line:

convert.exe "C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg" "imagemagick_convert.bmp"

Example code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

GUICreate("My GUI picture", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU)

Local $idPic = GUICtrlCreatePic("DOpus_convert.bmp", 50, 50, 200, 50)
Local $idPic2 = GUICtrlCreatePic("imagemagick_convert.bmp", 50, 120, 200, 50)

GUISetState(@SW_SHOW)

While 1
        Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                        ExitLoop
        EndSwitch
WEnd

GUIDelete()

DOpus_convert.bmp imagemagick_convert.bmp

Link to comment
Share on other sites

  • Solution
from: https://usage.imagemagick.org/formats/#bmp

If you have an older program cannot read the default BMP4 images written by
  ImageMagick, (for example a Windows Background Image), you can enforce the
  generation of a BMP3 format image using...

       magick image BMP3:image.bmp

  This format should have no transparency and should be a 'printable image',
  whatever that means.  In other words 'Windows' compatible.

  However, if a PNG input file was used and it contains a gAMA and cHRM chunk
  (gamma and chromaticity information) either of which forces "magick" to
  write a BMP4. To get a BMP3 you need to get rid of that information. One way
  may be to pipeline the image though a minimal 'image data only' image file
  format like PPM and then re-save as BMP3.  Messy, but it should work.

      magick image.png  ppm:- | magick - BMP3:image.bpm

I know that I know nothing

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...