Page 1 of 1

Gradient masks - any recent changes?

Posted: 2015-03-29T07:39:38-07:00
by gnidam
Hi all,

until version (Linux)

Code: Select all

Version: ImageMagick 6.8.9-10 Q16 x86_64 2015-03-03 
Features: DPC Modules OpenMP
using a gradient mask this way:

Code: Select all

convert -depth 16 -size 1x4096 gradient: -flip -write mpr:gradient \
    \( mpr:gradient -sigmoidal-contrast 8x50% \) \( mpr:gradient \) \
    -composite imtest.tif
worked just fine, leading to (graph from gradient): Image

With later versions

Code: Select all

Version: ImageMagick 6.9.1-0 Q16 x86_64 2015-03-29 
Features: DPC Modules OpenMP
however, i just get (again the graph): Image

So the gradient mask seems not to be applied.
I couldn't find anything in the changelog why that happens... so have I been doing this wrong all along or is it a bug?

Thx,
Martin

Re: Gradient masks - any recent changes?

Posted: 2015-03-29T09:09:35-07:00
by fmw42
I would have to agree. Assuming you are using a 3 image composite and the last is the mask, then all three of these show the same results for me on IM 6.9.1.0 Q16 Mac OSX, which is identical to just the sigmoidal-contrast image.

Code: Select all

convert -size 1x256 gradient: -rotate 90 -write mpr:gradient \
\( mpr:gradient -sigmoidal-contrast 8x50% \) \( mpr:gradient \) \
-compose over -composite miff:- | profile -f 1 - show:

Code: Select all

convert -size 1x256 gradient: -rotate 90 \
\( -clone 0 -sigmoidal-contrast 8x50% \) \( -clone 0 \) \
-compose over -composite miff:- | profile -f 1 - show:

Code: Select all

convert -size 1x256 gradient: -rotate 90 -sigmoidal-contrast 8x50% miff:- | profile -f 1 - show:

whereas swapping the first two images leads to a linear profile

Code: Select all

[code]convert -size 1x256 gradient: -rotate 90 -write mpr:gradient \
\( mpr:gradient -sigmoidal-contrast 8x50% \) +swap \( mpr:gradient \) \
-compose over -composite miff:- | profile -f 1 - show:
[/code]


That would indicate to me that the masked composite is not working correctly.

Re: Gradient masks - any recent changes?

Posted: 2015-03-29T11:19:27-07:00
by gnidam
Btw, thresholding the composite mask works as expected:

Code: Select all

convert -size 1x265 gradient: -flip \
    \( -clone 0 -sigmoidal-contrast 8x50% \) \
    \( -clone 0 -threshold 50% \) \
    -composite imtest3.tif
Image

...so midtones in the mask don't have any effect, just maxval give full opacity?

Re: Gradient masks - any recent changes?

Posted: 2015-03-29T11:39:36-07:00
by snibgo
I agree there is a bug. It is a weird one. Comparing v6.9.0-0 with 6.9.1-0, Windows BAT syntax:

These give the same correct outputs:

Code: Select all

%IMG690%convert ^
  -size 1x4096 ^
  xc:black ^
  ( xc:white ) ^
  ( gradient:black-white ) ^
  -compose Over -composite imtest4.tif

%IMG691%convert ^
  -size 1x4096 ^
  xc:black ^
  ( xc:white ) ^
  ( gradient:black-white ) ^
  -compose Over -composite imtest4a.tif
If we change "xc:black" to "gradient:black-black" ...

Code: Select all

%IMG690%convert ^
  -size 1x4096 ^
  gradient:black-black ^
  ( xc:white ) ^
  ( gradient:black-white ) ^
  -compose Over -composite imtest5.tif

%IMG691%convert ^
  -size 1x4096 ^
  gradient:black-black ^
  ( xc:white ) ^
  ( gradient:black-white ) ^
  -compose Over -composite imtest5a.tif
... the 691 output is entirely white.

Re: Gradient masks - any recent changes?

Posted: 2015-03-29T14:27:56-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.9.1-1 Beta within the next few days. Thanks.