gimpusers.com logo
German version English version

Not logged in

Sign up! | Lost password?

Latest discussion

  1. gimp-user | yesterday 11:59 PM
    How to do this using GIMP
  2. gimp-user | yesterday 05:58 PM
    [script] resize image in pourcent
  3. gimp-developer | yesterday 03:40 PM
    What's next for the meta-data browser
  4. gimp-developer | yesterday 01:45 PM
    GEGL-0.1.0
  5. gegl-developer | yesterday 01:45 PM
    GEGL-0.1.0

External news

Poll

Did you ever buy products (books, video dvds) about GIMP?

No, never did

Yes, helped alot (please post)

Yes, helped a little bit (please post)

Yes but I was disappointed (why? please post)

See results

Stats

gimpusers.com RSS feed

GIMP Forums » For GIMP users

Problem loading BMP; invalid BMP or bug in GIMP?

Jump to message:

  1. Problem loading BMP;... — Roel Schroeven, 29 Dec 2008 09:56 AM
    1. Problem loading BMP;... — peter kostov, 29 Dec 2008 11:50 AM
    2. Problem loading BMP;... — Martin Nordholts, 29 Dec 2008 12:01 PM
    3. Problem loading BMP;... — Sven Neumann, 29 Dec 2008 12:14 PM
      1. Problem loading BMP;... — peter kostov, 29 Dec 2008 12:36 PM
        1. Problem loading BMP;... — Sven Neumann, 29 Dec 2008 12:42 PM
          1. Problem loading BMP;... — peter kostov, 29 Dec 2008 03:58 PM
            1. Problem loading BMP;... — Roel Schroeven, 29 Dec 2008 04:16 PM
        2. Problem loading BMP;... — Roel Schroeven, 29 Dec 2008 04:14 PM
      2. Problem loading BMP;... — Roel Schroeven, 29 Dec 2008 02:55 PM
        1. Problem loading BMP;... — Ernie Wright, 30 Dec 2008 07:30 PM

As a registered user, you can subscribe forum threads in order to get notified when replies are posted. Just log in at the right top of the page if you already have an account, otherwise you can register for free.

Permalink:gja3c6$ssl$1@ger.gmane.org
Date:29 Dec 2008 09:56 AM
From:Roel Schroeven
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Hi,

I have some BMP-files that GIMP doesn't load correctly; GIMP shows
almost the whole image as transparent instead of the real image data.
Only a small region is visible, and even that with partial transparency.
The image doesn't contain any transparency though (I don't even think
BMP supports transparency).

Other image editors and viewers such as Irfanview and Paint.NET open the
image correctly.

I'm using GIMP 2.6.2 on Windows XP.
If you want to see the image, get it at
http://rschroev.fastmail.fm/radar-20081222T090636-00.bmp (5 MB) or
http://rschroev.fastmail.fm/radar-20081222T090636-00.zip (854 kB).

Should I report this as a bug? Or is the BMP maybe written in an invalid
format?

--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov

Roel Schroeven

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:4958AB5C.8090806@light-bg.com
Date:29 Dec 2008 11:50 AM
From:peter kostov
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Roel Schroeven wrote:
> Hi,
>
> I have some BMP-files that GIMP doesn't load correctly; GIMP shows
> almost the whole image as transparent instead of the real image data.
> Only a small region is visible, and even that with partial transparency.
> The image doesn't contain any transparency though (I don't even think
> BMP supports transparency).
>
> Other image editors and viewers such as Irfanview and Paint.NET open the
> image correctly.
>
> I'm using GIMP 2.6.2 on Windows XP.
> If you want to see the image, get it at
> http://rschroev.fastmail.fm/radar-20081222T090636-00.bmp (5 MB) or
> http://rschroev.fastmail.fm/radar-20081222T090636-00.zip (854 kB).
>
> Should I report this as a bug? Or is the BMP maybe written in an invalid
> format?
>

Hi,

I can't help you :( I can only confirm what you are saying:
On Linux (Gentoo) - identify:
identify "radar-20081222T090636-00.bmp" (9575)
radar-20081222T090636-00.bmp BMP 1024x1280 1024x1280+0+0 8-bit
DirectClass 5mb

In gqview and cinepaint the image looks normal, so it is when imported
in Inkscape too.
In Gimp both 2.4 and 2.6.0 the image looks like you are describing -
transparent.

Greetings,
Peter
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:4958AE24.2020501@gmail.com
Date:29 Dec 2008 12:01 PM
From:Martin Nordholts
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Roel Schroeven wrote:
> Hi,
>
> I have some BMP-files that GIMP doesn't load correctly; GIMP shows
> almost the whole image as transparent instead of the real image data.
> Only a small region is visible, and even that with partial transparency.
> The image doesn't contain any transparency though (I don't even think
> BMP supports transparency).
>
> Other image editors and viewers such as Irfanview and Paint.NET open the
> image correctly.
>
> I'm using GIMP 2.6.2 on Windows XP.
> If you want to see the image, get it at
> http://rschroev.fastmail.fm/radar-20081222T090636-00.bmp (5 MB) or
> http://rschroev.fastmail.fm/radar-20081222T090636-00.zip (854 kB).
>
> Should I report this as a bug? Or is the BMP maybe written in an invalid
> format?
>
>

Hi

If other editors are able to open the file it is not corrupt. (Maybe it
is but the other loaders are then at least able to adjust for this.)

Feel free to file a bug report and attach the BMP.

- Martin

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:1230549275.27429.5.camel@bender
Date:29 Dec 2008 12:14 PM
From:Sven Neumann
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Hi,

On Mon, 2008-12-29 at 09:56 +0100, Roel Schroeven wrote:

> I have some BMP-files that GIMP doesn't load correctly; GIMP shows
> almost the whole image as transparent instead of the real image data.
> Only a small region is visible, and even that with partial transparency.
> The image doesn't contain any transparency though (I don't even think
> BMP supports transparency).
>
> Other image editors and viewers such as Irfanview and Paint.NET open the
> image correctly.

I am not so sure about that. The image opened in GIMP has all the
information and an alpha channel. If you change the alpha channel to be
all opaque, then you will see the image as shown by other viewers you
tried. So I would rather assume that the other viewers don't support
masks in BMP files and just ignore that extra information. As long as
that is not sorted out, you should not file this as a bug report against
GIMP. It is quite likely that the bug is elsewhere.


Sven


_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:4958B648.8070402@light-bg.com
Date:29 Dec 2008 12:36 PM
From:peter kostov
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Sven Neumann wrote:
> Hi,
>
> On Mon, 2008-12-29 at 09:56 +0100, Roel Schroeven wrote:
>
>> I have some BMP-files that GIMP doesn't load correctly; GIMP shows
>> almost the whole image as transparent instead of the real image data.
>> Only a small region is visible, and even that with partial transparency.
>> The image doesn't contain any transparency though (I don't even think
>> BMP supports transparency).
>>
>> Other image editors and viewers such as Irfanview and Paint.NET open the
>> image correctly.
>
> I am not so sure about that. The image opened in GIMP has all the
> information and an alpha channel. If you change the alpha channel to be
> all opaque, then you will see the image as shown by other viewers you
> tried. So I would rather assume that the other viewers don't support
> masks in BMP files and just ignore that extra information. As long as
> that is not sorted out, you should not file this as a bug report against
> GIMP. It is quite likely that the bug is elsewhere.
>
>
> Sven
>

Hi,
Sven is right. I just did:
"Add Layer Mask" -> "Transfer layer's alpha channel", check "Invert
Mask", then file -> open as layers -> open the original image, flatten
and the image is O.K.
So it is not a bug in GIMP, but maybe in the way the image was saved
with this mask.

Peter
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:1230550954.27429.13.camel@bender
Date:29 Dec 2008 12:42 PM
From:Sven Neumann
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Hi,

On Mon, 2008-12-29 at 13:36 +0200, peter kostov wrote:

> Sven is right. I just did:
> "Add Layer Mask" -> "Transfer layer's alpha channel", check "Invert
> Mask", then file -> open as layers -> open the original image, flatten
> and the image is O.K.
> So it is not a bug in GIMP, but maybe in the way the image was saved
> with this mask.

One could argue though that the BMP loader in GIMP should use a layer
mask to represent the mask in the BMP file instead of using an alpha
channel for this. You would probably have discovered this more easily
then and it appears to be a better way to represent the BMP image
structure. So I think we should accept a patch that changed the BMP file
plug-in in this way.


Sven


_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:4958E590.50107@light-bg.com
Date:29 Dec 2008 03:58 PM
From:peter kostov
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Sven Neumann wrote:
> Hi,
>
> On Mon, 2008-12-29 at 13:36 +0200, peter kostov wrote:
>
>> Sven is right. I just did:
>> "Add Layer Mask" -> "Transfer layer's alpha channel", check "Invert
>> Mask", then file -> open as layers -> open the original image, flatten
>> and the image is O.K.
>> So it is not a bug in GIMP, but maybe in the way the image was saved
>> with this mask.

Apparently Sven's answer didn't reach the list, so here it is:
>
> One could argue though that the BMP loader in GIMP should use a layer
> mask to represent the mask in the BMP file instead of using an alpha
> channel for this. You would probably have discovered this more easily
> then and it appears to be a better way to represent the BMP image
> structure. So I think we should accept a patch that changed the BMP file
> plug-in in this way.
>
>
> Sven
>

Roel, I don't understand your technique of creating this screenshot, but
it looks like the BMP file has a mask in it. This is the source of the
transparency, because the file-bmp plug-in transforms this into
transparency. Unfortunately I can't understand exactly how to change the
file-bmp plug-in to implement that what Sven is suggesting because at
this time I know just a little python, but not C.
Peter

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:gjapk6$oc8$2@ger.gmane.org
Date:29 Dec 2008 04:16 PM
From:Roel Schroeven
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
peter kostov schreef:
> Roel, I don't understand your technique of creating this screenshot, but
> it looks like the BMP file has a mask in it. This is the source of the
> transparency, because the file-bmp plug-in transforms this into
> transparency.

Yes, I understand that now.

> Unfortunately I can't understand exactly how to change the file-bmp
> plug-in to implement that what Sven is suggesting because at this
> time I know just a little python, but not C.

I know C but not much about GIMP's internals or the BMP image structure.
I might try to create a patch if I find some time to study those.

--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov

Roel Schroeven

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:gjapga$oc8$1@ger.gmane.org
Date:29 Dec 2008 04:14 PM
From:Roel Schroeven
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
peter kostov schreef:
> "Add Layer Mask" -> "Transfer layer's alpha channel", check "Invert
> Mask", then file -> open as layers -> open the original image, flatten
> and the image is O.K.

That doesn't seem to work for me. I get an image that is almost
completely white. No big deal though: I just use Irfanview to read and
save it, which removes the alpha channel.

> So it is not a bug in GIMP, but maybe in the way the image was saved
> with this mask.

I suppose so. I'll just save the images with 24 bpp instead of 32 bpp;
that way the image doesn't include an alpha channel.

--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov

Roel Schroeven

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:gjakrv$bat$1@ger.gmane.org
Date:29 Dec 2008 02:55 PM
From:Roel Schroeven
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Sven Neumann schreef:
> Hi,
>
> On Mon, 2008-12-29 at 09:56 +0100, Roel Schroeven wrote:
>
>> I have some BMP-files that GIMP doesn't load correctly; GIMP shows
>> almost the whole image as transparent instead of the real image data.
>> Only a small region is visible, and even that with partial transparency.
>> The image doesn't contain any transparency though (I don't even think
>> BMP supports transparency).
>>
>> Other image editors and viewers such as Irfanview and Paint.NET open the
>> image correctly.
>
> I am not so sure about that. The image opened in GIMP has all the
> information and an alpha channel. If you change the alpha channel to be
> all opaque, then you will see the image as shown by other viewers you
> tried. So I would rather assume that the other viewers don't support
> masks in BMP files and just ignore that extra information. As long as
> that is not sorted out, you should not file this as a bug report against
> GIMP. It is quite likely that the bug is elsewhere.

The image is a screenshot that I make using this simple Win32/VCL code:

// Graphics::TBitmap is a Borland VCL wrapper around a Windows bitmap
void CaptureFromDC(HDC hDcSource, TRect Rect, Graphics::TBitmap *Bitmap)
{
Bitmap->Width = Rect.Width();
Bitmap->Height = Rect.Height();
Bitmap->HandleType = bmDIB;

if (!BitBlt(Bitmap->Canvas->Handle,
0, 0,
Rect.Width(), Rect.Height(),
hDcSource,
Rect.left, Rect.top,
SRCCOPY))
throw ECaptureError();
}

I can easily convert the bitmap to 24 bits, and then the image looks
good in GIMP, which is to be expected since it doesn't contain any alpha
information anymore. And it has the added benefit that the image files
are smaller.

Either way it's no big deal to me. I only wonder exactly where the alpha
values come from, but I guess that's more a question for a win32
programming mailing list.

--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov

Roel Schroeven

_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview
Permalink:495A68D8.3010405@comcast.net
Date:30 Dec 2008 07:30 PM
From:Ernie Wright
Subject:Problem loading BMP; invalid BMP or bug in GIMP?
Roel Schroeven wrote:

> I can easily convert the bitmap to 24 bits, and then the image looks
> good in GIMP, which is to be expected since it doesn't contain any
> alpha information anymore. And it has the added benefit that the image
> files are smaller.
>
> Either way it's no big deal to me. I only wonder exactly where the
> alpha values come from,

They could come from anywhere.

Historically, neither the BMP format nor the internal Windows structures
that it maps to formally define an alpha channel. The BITMAPINFOHEADER
biBitCount field can be set to 32, but the Windows SDK documentation
says that in that case "the high byte...is not used." In the RGBQUAD
structure used to hold 32-bpp pixels, the fourth field is "rgbReserved,"
not "rgbAlpha," and the description is "Reserved; must be zero."

The rationale for 32-bpp BMPs with an unused byte per pixel was that it
kept pixels longword-aligned, which in long-ago times sped up image
processing.

Naturally, BMP has been extended so that alpha is sometimes stored in
that fourth byte, and sometimes this is done out of ignorance, because
people *assume* that a 32-bpp format supports alpha. But alpha in BMP
is by no means widely supported. There's no easy way to tell whether a
given 32-bpp BMP contains a real alpha channel. And Windows itself
doesn't directly support BMP with alpha.

Since most 32-bpp BMPs *don't* contain alpha, and in those images the
fourth byte is 0, most image readers ignore the fourth byte.

A useful extension to any image loader/saver would be a preference
setting with options like

* Assume 32-bpp BMPs have alpha
* Assume that they don't
* Ask me each time

- Ernie http://home.comcast.net/~erniew
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

↑Back to thread overview

Adobe® Photoshop® is a registered trademark of Adobe Systems, Inc. Linux is a trademark of Linus Torvalds. Ubuntu and Canonical are registered trademarks of Canonical Ltd. | Clock times are shown as CET / CEST | Imprint / Privacy policy | powered by bitfire it services