potential bug in txt- reporting alpha for psd IM 6.4.1-8
Posted: 2008-06-15T14:45:07-07:00
When using txt:- to report the channels of an image, I am getting a problem with cmyka for psd format images.
Tests as follows:
Create the following in IM:
convert rose: rose_rgb.tif
convert rose_rgb.tif[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: ( 48, 47, 45) #302F2D rgb(48,47,45)
works fine
convert rose: rose_rgb.psd
rose_rgb.psd[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: ( 48, 47, 45) #302F2D rgb(48,47,45)
works fine
convert rose_rgb.tif -matte rose_rgba.tif
convert rose_rgba.tif[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,rgba
0,0: ( 48, 47, 45, 0) #302F2D rgb(48,47,45)
works fine
convert rose_rgb.psd -matte rose_rgba.psd
convert rose_rgba.psd[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: ( 0,255,255) #00FFFF cyan
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: ( 54, 51, 45, 0) #36332D rgb(54,51,45)
incorrect first set of data and correct 4-channel color values in second, but reported as rgb not rgba
But verbose info shows there is an alpha
Create CMYK in another application (GraphicConverter or Photoshop):
rose_cmyk.tif
rose_cmyk.psd
In IM add alpha:
convert rose_cmyk.tif -matte rose_cmyka.tif
convert rose_cmyka.tif[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,cmyka
0,0: (197,187,184,113, 0) #C5BBB871 cmyk(197,187,184,113)
works fine
convert rose_cmyk.psd -matte rose_cmyka.psd
convert rose_cmyka.psd[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,cmyk
0,0: (255, 0, 0,255) #FF0000FF red
# ImageMagick pixel enumeration: 1,1,255,cmyk
0,0: (186,177,182,115, 0) #BAB1B673 cmyk(186,177,182,115)
incorrect first set of data and correct 4-channel color values in second, but reported as rgb not rgba
So tif gets alpha reported correctly for both rgba and cmyka but psd does not. ( I also checked rgba png and that works fine)
Is this a bug with psd and alpha in IM?
The reason that this is important, is that I have a script that tries to extract what channels are in an image. It used a combination of colorspace (to get grayscale) and txt:- as above to determine if any of the following channels exist in an image: gray, rgb, rgba, cmyk, cmyka.
Any chance a new string format %[channels] could be made in the future to report this kind of information?
Tests as follows:
Create the following in IM:
convert rose: rose_rgb.tif
convert rose_rgb.tif[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: ( 48, 47, 45) #302F2D rgb(48,47,45)
works fine
convert rose: rose_rgb.psd
rose_rgb.psd[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: ( 48, 47, 45) #302F2D rgb(48,47,45)
works fine
convert rose_rgb.tif -matte rose_rgba.tif
convert rose_rgba.tif[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,rgba
0,0: ( 48, 47, 45, 0) #302F2D rgb(48,47,45)
works fine
convert rose_rgb.psd -matte rose_rgba.psd
convert rose_rgba.psd[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: ( 0,255,255) #00FFFF cyan
# ImageMagick pixel enumeration: 1,1,255,rgb
0,0: ( 54, 51, 45, 0) #36332D rgb(54,51,45)
incorrect first set of data and correct 4-channel color values in second, but reported as rgb not rgba
But verbose info shows there is an alpha
Create CMYK in another application (GraphicConverter or Photoshop):
rose_cmyk.tif
rose_cmyk.psd
In IM add alpha:
convert rose_cmyk.tif -matte rose_cmyka.tif
convert rose_cmyka.tif[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,cmyka
0,0: (197,187,184,113, 0) #C5BBB871 cmyk(197,187,184,113)
works fine
convert rose_cmyk.psd -matte rose_cmyka.psd
convert rose_cmyka.psd[1x1+0+0] txt:-
# ImageMagick pixel enumeration: 1,1,255,cmyk
0,0: (255, 0, 0,255) #FF0000FF red
# ImageMagick pixel enumeration: 1,1,255,cmyk
0,0: (186,177,182,115, 0) #BAB1B673 cmyk(186,177,182,115)
incorrect first set of data and correct 4-channel color values in second, but reported as rgb not rgba
So tif gets alpha reported correctly for both rgba and cmyka but psd does not. ( I also checked rgba png and that works fine)
Is this a bug with psd and alpha in IM?
The reason that this is important, is that I have a script that tries to extract what channels are in an image. It used a combination of colorspace (to get grayscale) and txt:- as above to determine if any of the following channels exist in an image: gray, rgb, rgba, cmyk, cmyka.
Any chance a new string format %[channels] could be made in the future to report this kind of information?