hi, i am trying to wtite a program that takes an image file and then puts it into the pygame screen pixel by pixel, its working very well but it's extremely slow
import pygame
import time
iss = pygame.image.load('myimage.jpg')
pygame.init
sc = pygame.display
w,h = iss.get_width(), iss.get_height()
ds = sc.set_mode((w,h))
ru = True
cl = pygame.time.Clock()
sc.set_caption("hi")
x,y=0,0
for y in range(h):
for x in range(w):
for event in pygame.event.get():
if event.type == pygame.QUIT:
y=h
break
ds.set_at((x,y), iss.get_at((x,y)))
x +=1
print(x,y)
sc.flip()
y+=1
time.sleep(50)
pygame.quit()