Problem with "gradient:[WxH]" - IM7.0.8-11

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
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Problem with "gradient:[WxH]" - IM7.0.8-11

Post by GeeMack »

Using ImageMagick 7.0.8-11 Q16 x64 HDRI on Windows 10...

I'm getting unexpected results creating gradients using square brackets to specify the canvas size like this...

Code: Select all

magick gradient:[200x200] test.png
It generates an all white image, no gradient. These commands also show the problem...

Code: Select all

magick gradient:red-green[200x200] redgreen.png

magick gradient:yellow-purple[200x200] yellowpurple.png

magick gradient:orange-lime[200x200] orangelime.png
They generate squares of solid red, yellow, or orange. Again, no gradients.

It will still produce a proper gradient by specifying the canvas size using "-size" like this...

Code: Select all

magick -size 200x200 gradient: test.png
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Problem with "gradient:[WxH]" - IM7.0.8-11

Post by GeeMack »

This problem also occurs with ImageMagick 6.9.10-11 Q16 x64 HDRI.

These three commands should produce gradients, but instead the outputs are an all white square, an all red square, and an all yellow square...

Code: Select all

convert gradient:[100x100] test1.png

convert gradient:red-yellow[100x100] test2.png

convert gradient:yellow-red[100x100] test3.png
It was not a problem in v6.9.10-1. I didn't test any between 6.9.10-1 and 6.9.10-11 to see exactly where it started.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem with "gradient:[WxH]" - IM7.0.8-11

Post by magick »

See https://www.imagemagick.org/script/comm ... hp#anatomy and then scroll to the Inline Image Resize / Inline Image Crop sections. We don't want to overload this feature and break this functionality:

Code: Select all

convert -size 400x400 'gradient:[200x200]' gradient.png
Post Reply