-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
pygame.transform.pixelate #2354
base: main
Are you sure you want to change the base?
pygame.transform.pixelate #2354
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great.
Before & After
Code
import pygame
screen = pygame.display.set_mode((500, 500))
creeper = pygame.image.load("creeper.jpg")
creeper = pygame.transform.scale_by(creeper, 0.5)
creeper = pygame.transform.pixelate(creeper, 50)
running = True
while running:
for e in pygame.event.get():
if e.type == pygame.QUIT:
running = False
screen.fill((0, 0, 0))
screen.blit(creeper, (0, 0))
pygame.display.update()
…into transform.pixelate
…ygame-ce into transform.pixelate
Could this effect be replicated with a smoothscale down and a scale up? It could even do that in C code, and it might be faster because those are SIMD optimized? Initial testing is promising that it replicates the effect, I didn't test performance. |
Shouldn't even need smoothscale for this, a bit of math with Would probably be worth a look at least to see if it is faster than this current method. |
I've converted this to a draft due to large open questions about how the implementation should work. |
I'll revive this soon, I promise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing #2302
TODO: