Page 1 of 2
Format BGRA doesn't work
Posted: 2010-08-19T12:14:10-07:00
by Drarakel
Either this is a bug - or the formats list is wrong..
With IM v6.6.3-7 Q16, on Windows XP, these formats are in my "convert -list format" list:
Code: Select all
BGR* RGB rw+ Raw blue, green, and red samples
BGRA* RGB rw+ Raw blue, green, red and alpha samples
BGR works, but not BGRA. Some test commands:
Code: Select all
convert logo: -transparent white bgra:test.bin
convert logo: -transparent white rgba:- | identify -depth 8 -size 640x480 bgra:-
I get a 0 byte file or an "invalid argument" error (when writing) and a "no decode delegate" error (when reading).
Re: Format BGRA doesn't work
Posted: 2010-08-19T12:33:26-07:00
by fmw42
I get "no decode delegate" error on my Mac OSX Tiger, IM 6.6.3.7 Q16 (HDRI) for the second line and a file called bgra/test.bin for the first line.
Re: Format BGRA doesn't work
Posted: 2010-08-19T12:54:44-07:00
by Drarakel
So.. there's no such delegate (and the behaviour when writing with 'bgra:' depends a bit on the OS and how exactly the filename is written).
Thanks for the confirmation.
Re: Format BGRA doesn't work
Posted: 2010-08-19T13:03:28-07:00
by magick
Edit coder.xml and associate BGRA with RGB. In the mean-time we'll add a patch to ImageMagick 6.6.3-8 Beta to fix the problem.
Re: Format BGRA doesn't work
Posted: 2010-08-19T17:09:06-07:00
by Drarakel
Editing coder.xml alone doesn't work yet. So, I'll wait for the next release version.
Thanks!
Re: Format BGRA doesn't work
Posted: 2010-08-21T09:32:42-07:00
by Drarakel
There are still problems in IM v6.6.3-8 (Q16, Windows XP) with this format.
Writing with 'BGRA' creates the same files as with 'BGR' (so, the alpha channel is omitted):
Code: Select all
convert logo: -transparent white BGR:test.bgr
convert logo: -transparent white BGRA:test.bgra
And reading with 'BGRA' doesn't work either here.
First an example that works (transparent logo image written as RGBA, again read as RGBA):
Code: Select all
convert logo: -transparent white RGBA:- | identify -verbose -depth 8 -size 640x480 RGBA:-
You will get the normal image and the 'normal' statistics.
When I read that as 'BGRA', the red and blue channels should be swapped - everything else should be the same. But it isn't:
Code: Select all
convert logo: -transparent white RGBA:- | identify -verbose -depth 8 -size 640x480 BGRA:-
...
Format: BGRA (Raw blue, green, red and alpha samples)
...
Histogram:
306240: ( 0, 0, 0,255) #000000 black
480: ( 1, 1,131,254) #010183FE rgba(1,1,131,0.996078)
480: ( 4, 2, 16,254) #040210FE rgba(4,2,16,0.996078)
...
The resulting image is almost completely black (with sometimes a few colored stripes).
The behaviour was the same in version 6.6.3-7 (with modified coder.xml).
Re: Format BGRA doesn't work
Posted: 2010-08-21T10:52:14-07:00
by magick
We can reproduce the problem you posted and will have a patch in ImageMagick 6.6.3-9 Beta within a day or two. Thanks,
Re: Format BGRA doesn't work
Posted: 2010-08-22T21:52:08-07:00
by Drarakel
Thanks.
But in IM v6.6.3-9, it doesn't work yet.
The BGRA reading part is the same (with the almost completely black image as result).
Writing as BGRA now produces the correct filesize, but the image is corrupt / fully black (tested here with 'RGBA' as input format):
Code: Select all
convert logo: -transparent white BGRA:- | identify -depth 8 -size 640x480 -verbose RGBA:-
And the format 'BGR' is now broken, too. Writing as BGR results in a fully black, one sample per pixel file (300KiB instead of 900KiB in the logo image example). And reading with BGR gives also almost completely black images.
Besides: In v6.6.3-9 (at least with my Windows Q16 binary), "RGBO", "RBG", "BRG", "GBR" and "GRB" disappeared from the formats list. Was this intended?
Re: Format BGRA doesn't work
Posted: 2010-08-23T06:36:23-07:00
by magick
Our patch was not properly exported out development environment to the ImageMagick trunk. Look for the patch in ImageMagick 6.6.3-10 Beta by sometime tomorrow. Thanks.
Re: Format BGRA doesn't work
Posted: 2010-09-03T09:07:30-07:00
by Drarakel
Thanks. In IM version 6.6.3-10, the format BGRA works.
The downside: Format BGR is broken (since version 6.6.3-9).
Writing the IM logo as BGR still results in a wrong 300 KiB file (should be 900 KiB).
Code: Select all
convert logo: BGR:logo.bgr
convert -depth 8 -size 640x480 gray:logo.bgr logo.bgr_gray.png
Something similar happened with the reading part of 'BGR':
Code: Select all
convert logo: rgb:logo.rgb
convert -depth 8 -size 640x480 bgr:logo.rgb logo.rgb_bgr.png
(Of course, the color channels are swapped by reading an RGB image as BGR. But that's not the problem here.)
And the formats "RGBO", "RBG", "BRG", "GBR" and "GRB" don't work at all:
Drarakel wrote:In v6.6.3-9 (at least with my Windows Q16 binary), "RGBO", "RBG", "BRG", "GBR" and "GRB" disappeared from the formats list. Was this intended?
All of these formats worked up till version 6.6.3-8.
Re: Format BGRA doesn't work
Posted: 2010-09-04T07:41:41-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.6.4-0 Beta available by sometime tomorrow. Thanks.
Re: Format BGRA doesn't work
Posted: 2010-09-08T10:09:15-07:00
by Drarakel
With IM v6.6.4-0, "BGR" and "BGRA" works. Thank you!
But I have to ask again:
Drarakel wrote:In v6.6.3-9 (at least with my Windows Q16 binary), "RGBO", "RBG", "BRG", "GBR" and "GRB" disappeared from the formats list. Was this intended?
So.. It seems that the result of this thread was that a) you had a lot of work, b) one format that didn't work before (BGRA) now does work, but c) 5 formats that did work before now don't work anymore. :-/
Or is this still a bug?
Re: Format BGRA doesn't work
Posted: 2010-09-08T10:30:18-07:00
by magick
RGBO should work. The other formats were supported with contributed code and clearly did not work properly / robustly. We're working on a robust implementation to support the RGBA/CMYKA combinatorics.
Re: Format BGRA doesn't work
Posted: 2010-09-08T11:32:47-07:00
by Drarakel
OK, thanks for the explanation!
magick wrote:RGBO should work.
With my ImageMagick version 6.6.4-0 Q16, on Windows XP, it does not work (even after adding "RGBO" to coder.xml). It's also not on the "convert -list format" list (since version 6.6.3-9).
Re: Format BGRA doesn't work
Posted: 2010-09-08T12:20:55-07:00
by magick
The RGBO coder is there but for some reason its not showing up in the format list. We have a fix for the problem in a day or two. Thanks.