Forum Discussion
How can I flip an image in Windows without Photoshop?
Certainly! If you're interested in a quick and free way to flip an image on Windows 11 PC using Python, a one-liner script can do the trick, provided you have Python installed along with the Pillow library.
Here's how to flip an image on Windows 11 PC:
1. First, ensure you have Python installed. If not, download it from python.org.
2. Install the Pillow library if you haven't already:
pip install pillow
3. Now, to flip an image, you can use this simple Python one-liner in your command prompt:
python -c "from PIL import Image; img=Image.open('input.jpg'); img.transpose(Image.FLIP_LEFT_RIGHT).save('flipped.jpg')"
How to flip an image using this command:
* Replace 'input.jpg' with the path to your original image.
* The transpose(Image.FLIP_LEFT_RIGHT) part flips the image horizontally.
* To flip vertically, replace it with Image.FLIP_TOP_BOTTOM.
Example for vertical flip:
python -c "from PIL import Image; img=Image.open('input.jpg'); img.transpose(Image.FLIP_TOP_BOTTOM).save('flipped.jpg')"