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

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

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

Post by GeeMack » 2019-08-11T15:54:03-07:00

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.

User avatar
fmw42
Posts: 25423
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2019-08-11T16:13:39-07:00

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.

User avatar
GeeMack
Posts: 714
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

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

Post by GeeMack » 2019-08-11T16:44:26-07:00

fmw42 wrote:
2019-08-11T16:13:39-07:00
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.
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.

User avatar
magick
Site Admin
Posts: 11043
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2019-08-11T17:44:48-07:00

The swirl option responds to the interpolate option, e.g. -interpolate background.

User avatar
fmw42
Posts: 25423
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2019-08-11T17:46:43-07:00

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

User avatar
magick
Site Admin
Posts: 11043
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2019-08-12T09:52:04-07:00

That would be a bug. Fixed in the github trunk.

Post Reply