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

Pixel manipulation functions #30

Open
acbart opened this issue Jan 5, 2022 · 1 comment
Open

Pixel manipulation functions #30

acbart opened this issue Jan 5, 2022 · 1 comment
Labels
enhancement New feature or request major work This represents a major investment of time and energy research There is a need to do research (preferably experimental) to determine how to solve this problem

Comments

@acbart
Copy link
Collaborator

acbart commented Jan 5, 2022

It's entirely possible to do pixel manipulation and retrieval with pygame surfaces. We need an easy-to-use api for this. Something vaguely like this:

frog = emoji('frog face')
# Get the pixels as a pseudo 2d array
pixels = get_pixels(frog)
# Modify
pixels[0][3] = 'red'
# Check it out
for row in pixels:
    for pixel in row:
        print(pixel)
# And back
modded_frog = image_from_pixels(pixels)

There's a lot of questions here about the best interface, but my thought is that you should be able to assign either strings or color-tuples to specific indices, replace entire rows with a list of the same, generally treat them like a 2-d list of tuples. Then there should also be a way to turn one of those back into an image.

@acbart acbart added enhancement New feature or request major work This represents a major investment of time and energy research There is a need to do research (preferably experimental) to determine how to solve this problem labels Jan 5, 2022
@acbart
Copy link
Collaborator Author

acbart commented Mar 5, 2022

Ultimately, we need to make sure we support the same set of functionality that you can do with Media Comp: http://personal.denison.edu/~bressoud/cs110-f12/Supplements/JESHelp/7_Picture_Functions.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request major work This represents a major investment of time and energy research There is a need to do research (preferably experimental) to determine how to solve this problem
Projects
None yet
Development

No branches or pull requests

1 participant