This Python script allows you to select a JPEG image file, resize it based on the target size in kilobytes, and save the resized image to a chosen location.
- Python 3.x
- PIL (Python Imaging Library)
- tkinter (for file selection dialogs)
- Run the script.
- A file selection dialog will open. Choose a JPEG image file to resize.
- Another file selection dialog will open. Choose the location to save the resized image.
- Enter the target size in kilobytes.
- The script will resize the image, maintaining its aspect ratio, and save it to the specified location.
- The path where the resized image is saved and the new file size in kilobytes will be displayed.
Note: Make sure you have the required dependencies installed (PIL
, tkinter
).
Feel free to modify and improve the code according to your needs.