Skip to content
Sign upLog in
← Back to Community

flipping image

Profile icon
stuartmilde

Hello,

I am wondering how I may flip an image upside down. So far I have uploaded my image and have had success with changing RGB values, but have not been able to flip the image upside down. Does anyone have any suggestions?

Cheers, Stuart

Voters
Profile icon
Sovann-EmilyEmi
Profile icon
ryanbrwr
Profile icon
stuartmilde
Comments
hotnewtop
Profile icon
FloCal35

You could take a screen shot and use a photo editor to flip it then download it and put it on whatever

Profile icon
Geocube101

What language
You could iterate over every pixel in the image (a rather slow process) and move each pixel keeping its x position and changing its y position
It would be better to scan the pixel, change its position, and then paste that pixel onto a new image as to not mess up the original

Profile icon
stuartmilde

@Geocube101

hello,
I am using python with pygame here in repl.it.
Are you able to share the code used to change pixel position.
Thus far I am capable in recreating the image using the nested loop
: for x in range(width)
for y in range(height)
pixel = img[x][y]

Profile icon
Geocube101