Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha blending is incorrect in OffsetImage #5004

Closed
Wendly opened this issue Aug 28, 2015 · 5 comments
Closed

Alpha blending is incorrect in OffsetImage #5004

Wendly opened this issue Aug 28, 2015 · 5 comments

Comments

@Wendly
Copy link

Wendly commented Aug 28, 2015

456

The bottom left icon is drawing by figure.figimage (image.FigureImage). It is correct.
The top right icon is drawing by OffsetImage (image.BboxImage). It is incorrect.

What's wrong?

The version of matplotlib is 1.4.3. The OS is windows7.

This is test.png
test3

This is example code.

import matplotlib
import matplotlib.pyplot as plt
import matplotlib.image as image
from matplotlib.offsetbox import TextArea, DrawingArea, OffsetImage, AnnotationBbox

if __name__ == '__main__':
    matplotlib.rcParams['figure.facecolor'] = 'ffffff'

    fig, ax = plt.subplots()

    ax.set_title('Draw image')
    ax.set_xlim((-2,2))
    ax.set_ylim((-2,2))

    img = image.imread('test.png')
    fig.figimage(img, 0, 0)

    imagebox = OffsetImage(img, zoom=1)
    annotation = AnnotationBbox(imagebox, (-1.5, -1.5), frameon=False, xycoords='data', boxcoords="offset points", pad=0)
    ax.add_artist(annotation)

    plt.show()
@tacaswell
Copy link
Member

Can you please provide a minimal example code which reproduces the bug, what version of mpl you are using, and which backend?

There is not enough information here yet to start debugging this.

@Wendly
Copy link
Author

Wendly commented Aug 28, 2015

I have already updated some information. Thanks for your friendly reminder.

@tacaswell tacaswell added this to the proposed next point release milestone Aug 28, 2015
@tacaswell
Copy link
Member

Thanks. Can confirm this on almost-current-master as well.

@WeatherGod
Copy link
Member

Wouldn't alpha blending be different in the two because one has a white
background and the other has a transparent background?
On Aug 28, 2015 1:01 PM, "Thomas A Caswell" notifications@github.com
wrote:

Thanks. Can confirm this on almost-current-master as well.


Reply to this email directly or view it on GitHub
#5004 (comment)
.

@anntzer
Copy link
Contributor

anntzer commented Jul 8, 2017

Fixed as of 2.0.2, unless I am mistaken (in which case feel free to request a reopen).

@anntzer anntzer closed this as completed Jul 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants