Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7417753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:45:29+00:00 2026-05-29T07:45:29+00:00

I am trying to flip a picture on its vertical axis, I am doing

  • 0

I am trying to flip a picture on its vertical axis, I am doing this in python, and using the Media module.

like this:
enter image description here

i try to find the relationship between the original and the flipped. since i can’t go to negative coordinates in python, what i decided to do is use the middle of the picture as the reference.

so i split the picture in half,and this is what i am going to do:

[note i create a new blank picture and copy each (x,y) pixel to the corresponding to (-x,y), if the original pixel is after the middle.

if its before the middle, i copy the pixel (-x,y) to (x,y)

enter image description here

so i coded it in python, and this is the result.

Original:
enter image description here

i got this:

import media

pic=media.load_picture(media.choose_file())


height=media.get_height(pic)
width=media.get_width(pic)
new_pic=media.create_picture(width,height)

for pixel in pic:
   x_org=media.get_x(pixel)
   y_org=media.get_y(pixel)
   colour=media.get_color(pixel)
   new_pixel_0=media.get_pixel(new_pic,x_org+mid_width,y_org) #replace with suggested     
                                                              #answer below
   media.set_color( new_pixel_0,colour)


media.show(new_pic)

enter image description here

this is not what i wanted, but i am so confused, i try to find the relationship between the original pixel location and its transformed (x,y)->(-x,y). but i think that’s wrong. If anyone could help me with this method it would be great full.

at the end of the day i want a picture like this:

enter image description here

http://www.misterteacher.com/alphabetgeometry/transformations.html#Flip

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:45:30+00:00Added an answer on May 29, 2026 at 7:45 am

    Your arithmetic is incorrect. Try this instead…

    new_pixel_0 = media.get_pixel(new_pic, width - x_org, y_org)
    

    There is no need to treat the two halves of the image separately.

    This is essentially negating the x-co-ordinate, as your first diagram illustrates, but then slides (or translates) the flipped image by width pixels to the right to put it back in the range (0 – width).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make the flip-clock animation, I find this tutorial very interesting http://www.voyce.com/index.php/2010/04/10/creating-an-ipad-flip-clock-with-core-animation/
I'm trying to flip a bit field in SQL Server using an update query,
I'm trying to implement a flip animation to be used in board game like
Trying to get my css / C# functions to look like this: body {
I am trying to make a simple drawing program in python using pygame. I
I'm trying to implement a D Flip Flop in VHDL, using a D Latch
I'm trying to make sort of flip effect using CSS3. Here's an example: http://jsfiddle.net/MNhK7/
I'm trying to use ~ to flip bits of a 'Binary' class. This 'Binary'
i ran into a strange problem when trying to flip the y-axis of a
I'm trying to do a card flip animation...but nothing happens. this is what I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.