Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

imshow alpha interpolation looks wrong #11316

Closed
Assignees
tacaswell
Milestone
@fargiolas

Description

@fargiolas

Hi, not much of an issue, but it seems thatimshow is not interpolating RGBA images in the proper way. There was some discussion about a similar issue in#9906 which ended up on a documentation note:

imshow expects RGB images adopting the straight (unassociated) alpha representation.

If that's the caseimshow should still switch to associated colors (premultiply alpha) before interpolation to avoid artefacts like the one below, shouldn't it?

import matplotlib.pyplot as pltimport numpy as npfig, (axl, axr) = plt.subplots(1, 2)# full green imageimg = np.zeros((5, 5, 4))img[...,1] = np.ones((5, 5))# transparent above main diagonalimg[...,3] = np.tril(np.ones((5, 5), dtype=np.uint8))axl.imshow(img, interpolation="none")axr.imshow(img, interpolation="bilinear")plt.show()

bug

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp