The transform module provides a function called scale.
https://www.pygame.org/docs/ref/transform.html#pygame.transform.scale
import pygame
img = pygame.image.load(file_name)
img_scale = pygame.transform.scale(img, (1280, 720)) # ScaleConversion
pygame.image.save(img_scale, new_file_name) #Save
© 2024 OneMinuteCode. All rights reserved.