1width = surface.get_width()
2height = surface.get_height()
3
4#Example
5import pygame
6
7imageInput = pygame.image.load("test.png")
8
9#Loop through every pixel in the image, and print the colour at that position
10for y in range(imageInput.get_height()):
11 for x in range(imageInput.get_width()):
12 print (imageInput.get_at((x, y)))