RSS/Atom feed Twitter
Site is read-only, email is disabled

Problem with exporting as .bmp for MS Windows BITMAP resource

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Problem with exporting as .bmp for MS Windows BITMAP resource BengtV 31 Aug 22:43
  Problem with exporting as .bmp for MS Windows BITMAP resource Richard 04 Sep 18:56
2016-08-31 22:43:14 UTC (about 8 years ago)
postings
1

Problem with exporting as .bmp for MS Windows BITMAP resource

I wanted to export an image as a .bmp file for use as a BITMAP resource in an MS Windows .rc file. The CBitmap method for loading the resource failed. The road to making the file usable turned out *not* to be as straight as I had hoped.

Looking at the header showed that the saved .bmp was compressed (type=3). I converted the file using ImageMagick to the older "bmp3" format. Now the file contained uncompressed (type=0) RGB data and loaded nicely into the application.

Now the problem was the alpha channel. Apparently, the ImageMagick team last year (on a request) added the possibility to force bmp3 to include the alpha channel with the --alpha flag. Now the image looked strange in areas where there was a gradient in the alpha. It seems like Windows wants the RGB data to be premultiplied with the alpha channel.

So, after a long time searching through forums, I finally came up with an ImageMagick command line which converted a .png to a .bmp (bmp3) with premultiplied alpha. Using this, my toolbar icons looked great, without any alpha-related border artifacts.

My questions are: 1. Has anyone experienced the same problem? (Besides the guy requesting the --alpha flag from the ImageMagick team) ;)

2. Why doesn't .bmp-export in GIMP have options to handle this? Is the image format used in any real extent on any other platform??? (Like "export for Windows resource compatibility")

Richard
2016-09-04 18:56:44 UTC (about 8 years ago)

Problem with exporting as .bmp for MS Windows BITMAP resource

This is a known issue when exporting BMP files from within GIMP -- using RLE compression, colorspace or alpha channel in the target file is not supported by all BMP loaders, so check your Export options to be sure.

(This being said, I was unable to reproduce this scenario on my Win 10 system regardless of my export settings -- I have however encountered it in Windows XP.)

-- Stratadrake strata_ranger@hotmail.com
--------------------
Numbers may not lie, but neither do they tell the whole truth.

From: gimp-user-list  on behalf of BengtV 
Sent: Wednesday, August 31, 2016 3:43 PM
To: gimp-user-list@gnome.org
Cc: notifications@gimpusers.com
Subject: [Gimp-user] Problem with exporting as .bmp for MS Windows BITMAP resource

I wanted to export an image as a .bmp file for use as a BITMAP resource in an MS
Windows .rc file.
The CBitmap method for loading the resource failed.
The road to making the file usable turned out *not* to be as straight as I had
hoped.

Looking at the header showed that the saved .bmp was compressed (type=3).
I converted the file using ImageMagick to the older "bmp3" format.
Now the file contained uncompressed (type=0) RGB data and loaded nicely into the
application.

Now the problem was the alpha channel.
Apparently, the ImageMagick team last year (on a request) added the possibility
to force
bmp3 to include the alpha channel with the --alpha flag.
Now the image looked strange in areas where there was a gradient in the alpha.
It seems like Windows wants the RGB data to be premultiplied with the alpha
channel.

So, after a long time searching through forums, I finally came up with an
ImageMagick
command line which converted a .png to a .bmp (bmp3) with premultiplied alpha.
Using this, my toolbar icons looked great, without any alpha-related border
artifacts.

My questions are:
1. Has anyone experienced the same problem?
   (Besides the guy requesting the --alpha flag from the ImageMagick team)  ;)

2. Why doesn't .bmp-export in GIMP have options to handle this?
   Is the image format used in any real extent on any other platform???
   (Like "export for Windows resource compatibility")

--
BengtV (via www.gimpusers.com/forums)
Forums - gimpusers.com
www.gimpusers.com
Forums. While there are many different GIMP forums of there, our own forums provide an extended way to communicate because they are connected to the official GIMP ...