Bug with gradient bounding-box?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
RigacciOrg
Posts: 1
Joined: 2018-04-06T06:52:36-07:00
Authentication code: 1152

Bug with gradient bounding-box?

Post by RigacciOrg »

Hi,

I'm trying to create an image with a black to transparent gradient region, which fills only half of the image. I have no problem to obtain the gradient in the left-half of the image, like this:

Code: Select all

convert -size 100x200 -define gradient:bounding-box=50x200+0+0 gradient:black-none test.png
but I am unable to create the same gradient in the right-half of the image:

Code: Select all

convert -size 100x200 -define gradient:bounding-box=50x200+50+0 gradient:black-none test.png
It seems that the +x parameter of the bounding-box does not work as expected. I expect e.g. that the gradient region moves 10 pixels to the right using bounding-box=50x200+10+0, but it does not. Am I missing something?

Running Imagemagick 6.9.7.4 on Debian GNU/Linux 9 64bit.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Bug with gradient bounding-box?

Post by snibgo »

The documentation http://www.imagemagick.org/script/gradient.php doesn't say clearly what "-define gradient:bounding-box WxH+X+Y" does. It gives no examples.

From the code draw.c DrawGradientImage(), the number of pixels that will be set isn't W columns by H rows, but (W-X) columns and (H-Y) rows. I suspect this is a bug. From experiment, it also doesn't start at (X,Y).
snibgo's IM pages: im.snibgo.com
Post Reply