possible bug show: or -combine starting 6.8.6.10
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
possible bug show: or -combine starting 6.8.6.10
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:
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:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug show: or -combine starting 6.8.6.10
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?
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
This is a bug and will be fixed in 6.8.7.1
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug show: or -combine starting 6.8.6.10
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
It doesn't look like this is related, I will look into the other bug to see what is happening there.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug show: or -combine starting 6.8.6.10
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
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
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug show: or -combine starting 6.8.6.10
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.
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
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:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug show: or -combine starting 6.8.6.10
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_othermagick 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:
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
Does it abort with the latest ImageMagick 6.8.7-1 Beta?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug show: or -combine starting 6.8.6.10
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: possible bug show: or -combine starting 6.8.6.10
As for fmw42, on Windows 7, the command ...
... 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.
Code: Select all
convert xc:black xc:black xc:black xc:white -set colorspace CMYK -combine -colorspace sRGB txt:
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug show: or -combine starting 6.8.6.10
Yes, it does the same for me on my Mac (unix)snibgo wrote:As for fmw42, on Windows 7, the command ...... 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.Code: Select all
convert xc:black xc:black xc:black xc:white -set colorspace CMYK -combine -colorspace sRGB txt:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug show: or -combine starting 6.8.6.10
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?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: possible bug show: or -combine starting 6.8.6.10
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/