Page 1 of 2
possible bug show: or -combine starting 6.8.6.10
Posted: 2013-09-29T21:36:07-07:00
by fmw42
Using 6.8.6.10 and 6.8.7.0 the following combine command is displaying a grayscale image with JPG. It works fine under 6.8.6.9 or with PNG. Mac OSX Snow Leopard
convert rose: -separate rose_%d.jpg
# this fails
convert rose_0.jpg rose_1.jpg rose_2.jpg -combine show:
convert rose_0.jpg rose_1.jpg rose_2.jpg -combine 1tmp1.jpg
convert 1tmp1.jpg show:
# this fails
convert rose_0.jpg rose_1.jpg rose_2.jpg -combine show:
convert rose_0.jpg rose_1.jpg rose_2.jpg -combine 1tmp1.png
convert 1tmp1.png show:
convert rose: -separate rose_%d.png
# this works
convert rose_0.png rose_1.png rose_2.png -combine show:
convert rose_0.png rose_1.png rose_2.png -combine 1tmp1.png
convert 1tmp1.png show:
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-01T19:09:29-07:00
by fmw42
Adding -colorspace sRGB after the -combine, does not help Tested again with IM 6.8.7.0
These still fails:
convert rose_0.jpg rose_1.jpg rose_2.jpg -combine -colorspace sRGB show:
convert rose_0.jpg rose_1.jpg rose_2.jpg -combine -set colorspace sRGB show:
However, these works:
convert rose_0.jpg rose_1.jpg rose_2.jpg -set colorspace sRGB -combine show:
convert rose_0.jpg rose_1.jpg rose_2.jpg -colorspace sRGB -combine show:
Magick: Is this a bug or a new requirement/feature?
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-02T03:54:45-07:00
by dlemstra
This is a bug and will be fixed in 6.8.7.1
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-02T09:40:04-07:00
by fmw42
dlemstra wrote:This is a bug and will be fixed in 6.8.7.1
Thanks for the reply Dirk.
Do you know if this is related to my other bug report with -separate at
viewtopic.php?f=3&t=24188
Fred
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-02T22:16:34-07:00
by dlemstra
It doesn't look like this is related, I will look into the other bug to see what is happening there.
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-05T18:03:57-07:00
by fmw42
Here are some examples that seem to show that it might be format related. PNG works, but miff and jpg do not.
This seems to work fine:
convert rose: -separate rose_%d.png
convert rose_0.png rose_1.png rose_2.png -combine newrose.png
display newrose.png
But this comes out grayscale in jpg format:
convert rose: -separate rose_%d.jpg
convert rose_0.jpg rose_1.jpg rose_2.jpg -combine newrose.jpg
display newrose.jpg
But this comes out grayscale in miff format:
convert rose: -separate rose_%d.miff
convert rose_0.miff rose_1.miff rose_2.miff -combine newrose.miff
display newrose.miff
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-14T17:07:22-07:00
by fmw42
Further problems with -combine
Create test sRGB black image and convert to CMYK to see if that works and what the values are in CMYK
convert xc:black xc:black xc:black -combine -colorspace CMYK txt:
# ImageMagick pixel enumeration: 1,1,65535,cmyk
0,0: (0%,0%,0%,100%) #000000000000FFFF cmyk(0,0,0,255)
So the above is fine.
So take the cmyk values and create the reverse
convert xc:black xc:black xc:black xc:white -set colorspace CMYK -combine -colorspace sRGB txt:
Abort trap
convert xc:black -colorspace CMYK \
xc:black -compose CopyCyan -composite \
xc:black -compose CopyMagenta -composite \
xc:black -compose CopyYellow -composite \
xc:white -compose CopyBlack -composite \
-colorspace sRGB txt:
# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (99.990844586861982179%,99.990844586861982179%,99.990844586861982179%) #FFF9FFF9FFF9 srgb(99.990844586861982179%,99.990844586861982179%,99.990844586861982179%)
which comes out as nearly white.
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-14T17:59:57-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.7-1 Beta available by sometime tomorrow. You'll also need this command:
Code: Select all
convert xc:black -colorspace CMYK \
xc:white -set colorspace CMYK -compose CopyCyan -composite \
xc:white -set colorspace CMYK -compose CopyMagenta -composite \
xc:white -set colorspace CMYK -compose CopyYellow -composite \
xc:black -set colorspace CMYK -compose CopyBlack -composite \
-colorspace sRGB txt:
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-15T17:10:49-07:00
by fmw42
magick wrote:We can reproduce the problem you posted and have a patch in ImageMagick 6.8.7-1 Beta available by sometime tomorrow. You'll also need this command:
Code: Select all
convert xc:black -colorspace CMYK \
xc:white -set colorspace CMYK -compose CopyCyan -composite \
xc:white -set colorspace CMYK -compose CopyMagenta -composite \
xc:white -set colorspace CMYK -compose CopyYellow -composite \
xc:black -set colorspace CMYK -compose CopyBlack -composite \
-colorspace sRGB txt:
Why is -set colorspace needed? Is should not be needed since the first line sets the colorspace to CMYK. This is per Anthony's examples at http://www.imagemagick.org/Usage/color_ ... bine_other
And what about the more current approach that aborts
convert xc:black xc:black xc:black xc:white -set colorspace CMYK -combine -colorspace sRGB txt:
Abort trap
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-15T17:51:01-07:00
by magick
Does it abort with the latest ImageMagick 6.8.7-1 Beta?
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-15T18:08:19-07:00
by fmw42
magick wrote:Does it abort with the latest ImageMagick 6.8.7-1 Beta?
No, that is fine. Thanks.
imbh convert xc:black xc:black xc:black xc:white -set colorspace CMYK -combine -colorspace sRGB txt:
# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (0%,0%,0%) #000000000000
black
But this still does not work without -set colorspace CMYK before each -channel (which does work) and I do not understand why that is needed now, when it was not before as per
http://www.imagemagick.org/Usage/color_ ... bine_other
imbh convert xc:black -colorspace CMYK \
> xc:black -compose CopyCyan -composite \
> xc:black -compose CopyMagenta -composite \
> xc:black -compose CopyYellow -composite \
> xc:white -compose CopyBlack -composite \
> -colorspace sRGB txt:
# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (100%,100%,100%) #FFFFFFFFFFFF
white
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-15T18:19:55-07:00
by snibgo
As for fmw42, on Windows 7, the command ...
Code: Select all
convert xc:black xc:black xc:black xc:white -set colorspace CMYK -combine -colorspace sRGB txt:
... crashed under v6.8.7-0 but succeeds under 6.8.7-1beta, returning the expected result "0,0: (0%,0%,0%) #000000000000 black". Thanks.
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-15T18:28:54-07:00
by fmw42
snibgo wrote:As for fmw42, on Windows 7, the command ...
Code: Select all
convert xc:black xc:black xc:black xc:white -set colorspace CMYK -combine -colorspace sRGB txt:
... crashed under v6.8.7-0 but succeeds under 6.8.7-1beta, returning the expected result "0,0: (0%,0%,0%) #000000000000 black". Thanks.
Yes, it does the same for me on my Mac (unix)
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-15T19:31:54-07:00
by fmw42
fmw42 wrote:Here are some examples that seem to show that it might be format related. PNG works, but miff and jpg do not.
This seems to work fine:
convert rose: -separate rose_%d.png
convert rose_0.png rose_1.png rose_2.png -combine newrose.png
display newrose.png
But this comes out grayscale in jpg format:
convert rose: -separate rose_%d.jpg
convert rose_0.jpg rose_1.jpg rose_2.jpg -combine newrose.jpg
display newrose.jpg
But this comes out grayscale in miff format:
convert rose: -separate rose_%d.miff
convert rose_0.miff rose_1.miff rose_2.miff -combine newrose.miff
display newrose.miff
The above issues all seem to work correctly now in IM 6.8.7.1 beta
The only remaining issue here is why -set colorspace needs to be added to each line of
imbh convert xc:black -colorspace CMYK \
xc:black
-set colorspace CMYK -compose CopyCyan -composite \
xc:black
-set colorspace CMYK-compose CopyMagenta -composite \
xc:black
-set colorspace CMYK-compose CopyYellow -composite \
xc:white
-set colorspace CMYK-compose CopyBlack -composite \
-colorspace sRGB txt:
This was not needed before as per http://www.imagemagick.org/Usage/color_ ... bine_other
Why is this now needed?
Re: possible bug show: or -combine starting 6.8.6.10
Posted: 2013-10-16T16:40:39-07:00
by anthony
As it currently stands sometimes -combine needs -set colorspace before. sometimes it needs -set colorspace afterwards. The before case is especially important for the black channel of CMYK, as most colorspaces do not have the 4th channel for -combine to copy the black values into.
But it does NEED a colorspace setting at some point, as it is MISSING information, especially if input images are single channel 'greyscale' images (which is what they should be).
I have said many times. -combine really needs a 'colorspace' argument. The only solution I can see for backward compatibility is to have a new option that does the same job but takes a colorspace argument.
Remember -separate and -combine should only copy values as they are it should not modify the values, only separate and merge the color channels.