1"""Load image"""
2# I'm loading an image, but that does not matter.
3surface = pygame.image.load("path/to/file.png").convert()
4# Documentation for Surface.convert() and Surface.convert_alpha():
5# https://www.pygame.org/docs/ref/surface.html#pygame.Surface.convert
6
7"""Scale / resize surface"""
8surface = pygame.transform.scale(surface=surface, size=(50, 50))
9# In depth documentation:
10# https://www.pygame.org/docs/ref/transform.html#pygame.transform.rotate
1image = pygame.image.load("path/to/file.png") # load image
2
3width, height = image.get_width(), image.get_height() # get size
4print(width, height) # print size
5
6"""
7OUTPUT:
8(50, 50)
9"""