possible bug -poly with alpha channel IM 6.8.5.4

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.
Locked
User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug -poly with alpha channel IM 6.8.5.4

Post by fmw42 »

In response to viewtopic.php?f=1&t=23342

There may be a bug in alpha processing with -poly.

This is just making the image transparent where white:

convert logo: -transparent white show:


This does the same and applies -poly as a no-op, e.g. wt=1 and exponent=1. But it has preserved the white and made the rest transparent. That is, it seems to negate the alpha channel.

convert logo: -transparent white -poly "1,1" show:

This does the same even with -channel rgba applied:

convert logo: -transparent white -channel rgba -poly "1,1" show:


I never gave any thought to transparency with -poly when I proposed it, especially when multiple images are involved. But I do not think it should negate the alpha channel.

This seems to show that the result gets the alpha channel (although negated) from the first image. The third example has no alpha channel.

convert logo: logo: -transparent white -poly "0.5,1 0.5,1" show:
convert \( logo: -transparent white \) logo: -poly "0.5,1 0.5,1" show:
convert logo: \( logo: -transparent white \) -poly "0.5,1 0.5,1" show:

This seems to show that the alpha channel is processed by the exponent as well as negated. Compare these. They show different alpha channels.

convert -size 256x256 gradient: \( -clone 0 \) -alpha off -compose copy_opacity -composite -poly "1,1" -alpha extract show:
convert -size 256x256 gradient: \( -clone 0 \) -alpha off -compose copy_opacity -composite -poly "1,3" -alpha extract show:

Just trying to understand what is happening with the alpha channel with -poly. Perhaps it should only process the alpha channel if using -channel rgba.

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

Re: possible bug -poly with alpha channel IM 6.8.5.4

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.5-5 Beta available by sometime tomorrow. Thanks.

Locked