Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
img_resizer is a simple command-line Python tool that batch-resizes all images in a folder. You can resize images by specifying a new width, with the height calculated automatically to maintain the aspect ratio — or provide both dimensions manually. You can also overwrite the original images or save resized versions to a separate folder.
- Python
- Pillow image library
These are instructions for setting up the project locally. To get a local copy up and running, follow these simple steps.
Ensure you have the following software installed before proceeding:
-
Python 3.6 or higher: Check with:
python3 --version
-
The Pillow image library
Install Pillow using pip:
pip install pillow
-
Clone the repository:
git clone https://github.com/mattsteen14/img_resizer.git
-
In the terminal, navigate into the project directory:
cd img_resizer -
Install the required Python packages:
pip install -r requirements.txt
-
Run the script from the terminal using:
python3 datxt.py <folder_path> --width <new_width> [--height <new_height>] [--inplace]
- folder_path — The folder containing images to resize (must be quoted if it contains spaces)
- --width — Required. The new width for the images (in pixels)
- --height — Optional. If provided, will force images to resize to this exact height
- --inplace — Optional. If included, the original images will be overwritten. If omitted, resized images will be saved to a new folder (<original_folder>_resized)
Hint:
Instead of typing the full paths, just drag & drop the folder into the terminal.
- Plan project.
- Write code.
- Test on images folder.
- Version control. Set up on GitHub.
- Push to GitHub.
- Testing and dubugging.
- Additional features.
- Create simple GUI interface.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
-
Fork the Project.
-
Create your Feature Branch:
git checkout -b feature/AmazingFeature
-
Commit your Changes:
git commit -m "Add some AmazingFeature" -
Push to the Branch:
git push origin feature/AmazingFeature
-
Open a Pull Request.
Distributed under the MIT License. See LICENSE.txt for more information.
Matt Steen-Brookes - @mattsteen14 - [email protected]
Project Link: https://github.com/mattsteen14/img_resizer
- Mo Ashqar for introducing me to Codecademy in the first place.
- Othneil Drew for the README template.
- Choose an Open Source License