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

Add files via upload#30156

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
A-n-sh wants to merge1 commit intomatplotlib:mainfromA-n-sh:main
Closed

Add files via upload#30156

A-n-sh wants to merge1 commit intomatplotlib:mainfromA-n-sh:main

Conversation

A-n-sh
Copy link

@A-n-shA-n-sh commentedJun 10, 2025
edited
Loading

Three-way handler:

                # CHANGE START                alpha = self.get_alpha()                if alpha is not None and np.ndim(alpha) > 0:                    # 2S array a -> pack into 4th channel                    if A.shape[2] == 3:                        A = np.dstack([A, alpha])                    else:                        A[..., 3] = alpha                elif alpha is not None:                    # scalar a -> broadcast or multiply existing                    if A.shape[2] == 3:                        A = np.dstack([A, np.full(A.shape[:2], alpha, dtype=A.dtype)])                    else:                        A[..., 3] = A[..., 3] * alpha                # CHANGE END
  1. 2D mask (alpha.ndim>0)
  • RGB input -> stack mask as new 4th channel
  • RGBA input -> overwrite existing alpha channel
  1. Scalar alpha:
  • RGB input -> broadcast into full alpha channel
  • RGBA input -> multiply existing alpha channel by this value
  1. No alpha (alpha is None): leave image's own alpha untouched.

After handling, code premultiplies RGB by updated alpha and resamples-ensuring per-pixel transparency works for both grayscale and RGB images.

Standalone script for isolating issue. Creates a random 10x10 array.
Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

@jklymak
Copy link
Member

Sorry, are you trying to report an issue? A Pull Request is probably not the right way to do that. Please open an issue instead.

@jklymakjklymak added the status: needs clarificationIssues that need more information to resolve. labelJun 10, 2025
@A-n-sh
Copy link
Author

A-n-sh commentedJun 10, 2025 via email

I am so so sorry for that. I'm still adjusting to Gtihub and I was taking a software development course where one of my assignments was to contribute to an open-source project.I was trying to work on issue#26092 for the assignment and I opened a pull request.I am so sorry if I messed anything up I was just trying to complete my assignment.From: Jody Klymak ***@***.***>Sent: Monday, June 9, 2025 11:53 PMTo: matplotlib/matplotlib ***@***.***>Cc: Gupta, Ansh ***@***.***>; Author ***@***.***>Subject: Re: [matplotlib/matplotlib] Add files via upload (PR#30156)[External Email][Image removed by sender.]jklymak left a comment (matplotlib/matplotlib#30156)<#30156 (comment)>Sorry, are you trying to report an issue? A Pull Request is probably not the right way to do that. Please open an issue instead.-Reply to this email directly, view it on GitHub<#30156 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BDU7GYLJ2BOO3AL5A7BCMYT3CZJAJAVCNFSM6AAAAAB66NXCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNJXGU4TSOJUGQ>.You are receiving this because you authored the thread.Message ID: ***@***.***>

@jklymak
Copy link
Member

You didn't fix anything, you just uploaded a file that doesn't do anything.

While we think it is important for students to learn, we don't have the bandwidth to be your class teaching assistants or to walk you though how to make a proper contribution. Please ask your class instructors for help. We also have a very comprehensive development guide that you should read carefully before contributing.

@A-n-sh
Copy link
Author

A-n-sh commentedJun 10, 2025 via email

Of course, once again I’m really sorry for that.Please disregard any changes I’ve made
________________________________From: Jody Klymak ***@***.***>Sent: Tuesday, June 10, 2025 12:13:38 PMTo: matplotlib/matplotlib ***@***.***>Cc: Gupta, Ansh ***@***.***>; Author ***@***.***>Subject: Re: [matplotlib/matplotlib] Add files via upload (PR#30156)[External Email][https://avatars.githubusercontent.com/u/1562854?s=20&v=4]jklymak left a comment (matplotlib/matplotlib#30156)<#30156 (comment)>You didn't fix anything, you just uploaded a file that doesn't do anything.While we think it is important for students to learn, we don't have the bandwidth to be your class teaching assistants or to walk you though how to make a proper contribution. Please ask your class instructors for help. We also have a very comprehensive development guide that you should read carefully before contributing.—Reply to this email directly, view it on GitHub<#30156 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BDU7GYI7NR3MYFR2B6NVJL33C373FAVCNFSM6AAAAAB66NXCPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSNJZHA4DMNBTGI>.You are receiving this because you authored the thread.Message ID: ***@***.***>

@jklymak
Copy link
Member

OK thanks for your interest in Matplotlib, and feel free to resubmit when you have things sorted out.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

Assignees
No one assigned
Labels
status: needs clarificationIssues that need more information to resolve.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@A-n-sh@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp