pygame image get height

Solutions on MaxInterview for pygame image get height by the best coders in the world

showing results for - "pygame image get height"
Niclas
23 Apr 2020
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)))