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

proposal: image: add (*Uniform).SubImage #71463

Open
hajimehoshi opened this issue Jan 28, 2025 · 2 comments
Open

proposal: image: add (*Uniform).SubImage #71463

hajimehoshi opened this issue Jan 28, 2025 · 2 comments
Labels
LibraryProposal Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool Proposal
Milestone

Comments

@hajimehoshi
Copy link
Member

hajimehoshi commented Jan 28, 2025

Proposal Details

I propose to add SubImage method to image.Uniform, like other image types. SubImage takes a rectangle as a bound and returns an image.Image value. The underlying value of the returned value is a Uniform image with bounds, so we would need to add a (hidden) new member representing bounds to Uniform.

This is useful when I want to create a color-filled image and encode this as a PNG image for example.

@gopherbot gopherbot added this to the Proposal milestone Jan 28, 2025
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@gabyhelp gabyhelp added the LibraryProposal Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool label Jan 28, 2025
@ianlancetaylor ianlancetaylor moved this to Incoming in Proposals Jan 28, 2025
@ianlancetaylor
Copy link
Member

CC @nigeltao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LibraryProposal Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool Proposal
Projects
Status: Incoming
Development

No branches or pull requests

4 participants