Re: [Gimp-developer] 32bit BMP appear blank

2007-01-05 Thread Sven Neumann
Hi,

On Wed, 2007-01-03 at 20:42 +0100, Raphaël Quinet wrote:

 I have not tried these programs supporting alpha channels in BMP but
 from their descriptions I could identify the following strategies when
 loading 32-bit BMP or ICO files:
 1) Always ask the user if the alpha channel should be used or not
 2) Use the alpha channel if and only if it contains at least one
non-zero value.
 3) Use the alpha channel if the file name ends in .ICO, ignore it if
it is .BMP.
 
 The second strategy seems like a good compromise and would probably
 work in most cases (i.e., match the user's expectations).

I agree. Let's go for this option then.


Sven


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


Re: [Gimp-developer] 32bit BMP appear blank

2007-01-05 Thread Sven Neumann
Hi,

Aurimas wrote a patch that implements it the way that Raphael suggested.
Thanks a lot for that, the patch has been committed in the meantime.

While reviewing this patch it became evident that the BMP plug-in is one
of those evil fellows among the file plug-ins. It allocates a buffer the
full size of the image instead of transferring the pixel data to/from
the core tile-by-tile or at least in smaller stripes. It does this both
for loading and saving. If possible, this should be changed.


Sven


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


[Gimp-developer] 32bit BMP appear blank

2007-01-03 Thread Aurimas Juška
Hi,

This is a summary of Bug 352262 – 32bit bitmaps (*.bmp) appear blank (
http://bugzilla.gnome.org/show_bug.cgi?id=352262 ) which as Sven said
is important to be settled before releasing 2.4 version.

After bmp plug-in has been updated it, among other things, started
parsing bytes which were thought to be alpha channel. When bitmap
contained valid alpha data in these bytes (which can be created with
PS or some other app), this feature worked as expected. However, when
bitmap was saved in 32 bit format without alpha, all those bytes
became 0. As the result, image appeared completely blank on the
screen.

The main question: should those bytes be ignored (as it is done by
many applications) or should some workaround be used (in case we want
to support 32bit bitmaps with alpha channel)?

Unfortunately, we were unable to find any official documentation
dealing with the problem.

Programming Windows, 5th Edition (Charles Petzold - MS Press, 1998)
tells that those bytes should be 0. In other words, they should be
ignored while loading and set to 0 while saving.

P.S. Results of the discussion could be useful when solving Bug 65534.
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] 32bit BMP appear blank

2007-01-03 Thread Raphaël Quinet
On Wed, 3 Jan 2007 17:10:54 +0200, Aurimas Juška [EMAIL PROTECTED] wrote:
 This is a summary of Bug 352262 – 32bit bitmaps (*.bmp) appear blank (
 http://bugzilla.gnome.org/show_bug.cgi?id=352262 ) which as Sven said
 is important to be settled before releasing 2.4 version.
[...]
 The main question: should those bytes be ignored (as it is done by
 many applications) or should some workaround be used (in case we want
 to support 32bit bitmaps with alpha channel)?

I did a quick web search to see how some applications dealt with this
problem and I found a number of links to photoshop plug-ins (including
one GPL program [1]) and standalone programs for converting or editing
Windows .BMP or .ICO files.  It should be noted that the support for
the alpha channel is an extension added in Windows XP (and made
partially obsolete by the usage of PNG in Windows Vista) so it is
unlikely to be available or even mentioned in programs, books or
official or unofficial specifications written before 2001.

As mentioned on many web sites, there does not seem to be any complete
and official specification of the BMP file format available anywhere.
Even the documentation from Microsoft (MSDN Library) does not mention
the usage of the alpha channel although it is used in Windows XP.

I have not tried these programs supporting alpha channels in BMP but
from their descriptions I could identify the following strategies when
loading 32-bit BMP or ICO files:
1) Always ask the user if the alpha channel should be used or not
2) Use the alpha channel if and only if it contains at least one
   non-zero value.
3) Use the alpha channel if the file name ends in .ICO, ignore it if
   it is .BMP.

The second strategy seems like a good compromise and would probably
work in most cases (i.e., match the user's expectations).

-Raphaël

[1] http://www.telegraphics.com.au/svn/icoformat/trunk/dist/README.html
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer