Page 1 of 1

7.0.8-60 issue with "-background none" and "-swirl"

Posted: 2019-08-11T15:54:03-07:00
by GeeMack
Using ImageMagick 7.0.8-60 Q16 x64 HDRI on Windows 10, I've been getting unexpected results if I set "-background none" somewhere in the command ahead of a "-swirl" operation.

This command produces the following result...

Code: Select all

magick wizard: -background none -swirl 90 result.png
Image

Rather than just properly swirl the image, it creates a moire pattern of mixed magenta, yellow, and transparent.

The problem only occurs when setting "background none" before "-swirl", but not when setting the background to any other color. It seems to affect any output format, not necessarily with transparent areas of course, and it happens with any amount of swirl.

The problem still occurs when setting "-channel RGB" or "-alpha off" ahead of the "-swirl" operation. Interestingly enough, it doesn't occur if I use "-alpha set" ahead of "-swirl".

The immediately previous version, 7.0.8.-59 had the same issue. My most recent version of IM 6, ImageMagick 6.9.10-11 Q16 x64 HDRI, doesn't have this issue and produces expected results.

Re: 7.0.8-60 issue with "-background none" and "-swirl"

Posted: 2019-08-11T16:13:39-07:00
by fmw42
Why do you need the -background none? I see the same thing with IM 7.0.8.59 Q16 MAC OSX. But I do not understand why you would want the background set to none. Swirl is not going to leave transparency or empty places. Nevertheless, I would not expect it to be affected by the -background setting. (However, note that IM 7 by default processed the alpha like r,g,b channels. IM 6 ignores the alpha unless explicitly requested)

What happens if you do:

Code: Select all

magick image.png -background none -alpha set -channel rgba -swirl 90 result.png
For me, this does not show the odd pattern.

Re: 7.0.8-60 issue with "-background none" and "-swirl"

Posted: 2019-08-11T16:44:26-07:00
by GeeMack
fmw42 wrote: 2019-08-11T16:13:39-07:00Why do you need the -background none? I see the same thing with IM 7.0.8.59 Q16 MAC OSX. But I do not understand why you would want the background set to none.
The example is just reduced to the fewest operations to show the issue. I often use dozens of operations in a single command, and frequently set the background to "none" near the beginning to accommodate almost everything that follows. It doesn't seem it should be necessary to "-alpha set" ahead of "-swirl" just to make sure it works as I'd expect.
What happens if you do:

Code: Select all

magick image.png -background none -alpha set -channel rgba -swirl 90 result.png
I guess I'm not seeing a connection between the alpha state and the swirl operation, so although that eliminates the issue with the moire pattern, I'd think of it as a workaround instead of a solution.

Re: 7.0.8-60 issue with "-background none" and "-swirl"

Posted: 2019-08-11T17:44:48-07:00
by magick
The swirl option responds to the interpolate option, e.g. -interpolate background.

Re: 7.0.8-60 issue with "-background none" and "-swirl"

Posted: 2019-08-11T17:46:43-07:00
by fmw42
Thanks. That explains the background connection. But what is the default interpolation? And if the default is not background, then why would it be affected by setting it to none

Re: 7.0.8-60 issue with "-background none" and "-swirl"

Posted: 2019-08-12T09:52:04-07:00
by magick
That would be a bug. Fixed in the github trunk.