[Matplotlib-users] Two circles with “exponential decay” coloring, and alpha < 1, having trouble with color mixing?

Thomas Caswell tcaswell at gmail.com
Mon Nov 23 21:06:41 EST 2015


Please keep all emails on-list.

I am actually not sure this is possible.  The problem is even if the
background is transparent, the first image is still composited on to it
first, thus the bottom value still comes in with alpha ** 2 when the second
layer is added.

Why are you trying to do this?  You might be a better to add your data into
one image and then use shapely to compute the union of the paths for
clipping.

Tom


On Mon, Nov 23, 2015 at 8:07 PM Brian Merchant <bhmerchant at gmail.com> wrote:

> Hi Thomas,
>
> Ah, so should I somehow set the background to be transparent? Put another
> way, how would I remove the influence of the background on the compositing?
>
> On Mon, Nov 23, 2015 at 2:41 PM, Thomas Caswell <tcaswell at gmail.com>
> wrote:
>
>> The way we do the alpha blending, the output value is (alpha * v1) +
>> ((alpha-1) * v2).  All of the artists are compsited down on top of a white
>> background so the compositing is not commutative.
>>
>> (a * .5) + (.5 * (b * .5 + .5))  =/= (b * .5) + (.5 * (a * .5 + .5))
>>
>>
>> On Mon, Nov 23, 2015 at 1:55 PM Sterling Smith <smithsp at fusion.gat.com>
>> wrote:
>>
>>> Maybe the issue is with the colormap not having an alpha?  Does this
>>>
>>> http://stackoverflow.com/questions/10127284/overlay-imshow-plots-in-matplotlib
>>> help?
>>>
>>> Otherwise, you might file a bug at
>>> https://github.com/matplotlib/matplotlib/issues/new
>>>
>>> -Sterling
>>>
>>> On Nov 20, 2015, at 4:46PM, Brian Merchant <bhmerchant at gmail.com> wrote:
>>>
>>> > Hi all,
>>> >
>>> > In order to get circles such that their coloring is radially
>>> symmetric, with center being the darkest, and exponential decay in color as
>>> one moves farther away from the center along the radius, I used imshow with
>>> clip_path using Circle patches.
>>> >
>>> > Here's a toy script that overlaps two such circles:
>>> https://gist.github.com/bmer/7063cc2dd09f1b80a252
>>> >
>>> > As you can see if you run the script (or, if you follow this link:
>>> http://i.imgur.com/H9jEAZ3.png), even though the alpha is set at 0.5,
>>> there doesn't seem to be proper "color mixing" occurring (we should see a
>>> result that is symmetric along the x-axis).
>>> >
>>> > Why is that, and what could I do to fix this issue?
>>> >
>>> > Kind regards,
>>> > Brian
>>> >
>>> ------------------------------------------------------------------------------
>>> > _______________________________________________
>>> > Matplotlib-users mailing list
>>> > Matplotlib-users at lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Go from Idea to Many App Stores Faster with Intel(R) XDK
>>> Give your users amazing mobile app experiences with Intel(R) XDK.
>>> Use one codebase in this all-in-one HTML5 development environment.
>>> Design, debug & build mobile apps & 2D/3D high-impact games for multiple
>>> OSs.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Matplotlib-users at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20151124/5568f3f6/attachment.html>


More information about the Matplotlib-users mailing list