recently started coding with python using pycharm / python IDLE on mac osx.
When it comes to showing / blitting images onto a defined pygame display, png and jpg formats don't appear properly (see images).
Only bmp formats appear properly.
Any suggestions to make jpg and png appear correctly in pygame?
Thank you
how it appears on pygame display
import pygame, sys
from pygame.locals import *
pygame.init()
width = 640
height = 480
screen = pygame.display.set_mode((width,height))
pygame.display.set_caption('hello piggy')
white = (255,255,255)
image = pygame.image.load("flpig.jpg")
x=160
y=120
running = True
while running:
screen.fill(white)
screen.blit(image, (x, y))
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame.display.update()