This is a simple PyQt6 application to calculate and visualize aspect ratios. It allows you to input dimensions, select common aspect ratios, and drag-and-drop images to auto-fill dimensions. This project was inspired by Andrew Hedges' Aspect Ratio Calculator.
- Input custom dimensions to calculate aspect ratios.
- Select from a list of common aspect ratios.
- Drag and drop images to auto-fill dimensions.
- Option to round results to the nearest whole number.
- Visualize the aspect ratio result.
- Clone the repository:
git clone https://github.com/yourusername/aspect-ratio-calculator.git
- Navigate to the project directory:
cd aspect-ratio-calculator
- Install the required dependencies:
pip install -r requirements.txt
- Clone the repository:
git clone https://github.com/yourusername/aspect-ratio-calculator.git
- Navigate to the project directory:
cd aspect-ratio-calculator
- Install the dependencies individually:
pip install PyQt6 Pillow
Run the application using the following command:
python aspect_ratio_calculator.py
- Python 3.x
- PyQt6
- Pillow
-
Input Dimensions:
- Enter the width (W1) and height (H1) to calculate their aspect ratio.
- Optionally, enter the width (W2) or height (H2) to calculate the missing dimension based on the aspect ratio of W1 and H1.
-
Select Common Ratios:
- Use the dropdown to select a common aspect ratio. This will auto-fill W1 and H1 with the selected ratio.
-
Drag and Drop Images:
- Drag an image file into the designated area to auto-fill W1 and H1 with the image's dimensions.
- A thumbnail of the image will be displayed.
-
Rounding Option:
- Check the "Round results to the nearest whole number" checkbox if you prefer rounded results.
-
Calculate Button:
- Click the "Calculate" button to compute the aspect ratio based on the provided dimensions.
- Enter
1920
for W1 and1080
for H1. - Click "Calculate" to see the aspect ratio
16:9
. - Optionally, enter a value for W2 or H2 to compute the missing dimension based on the aspect ratio.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License.
This project was inspired by Andrew Hedges' Aspect Ratio Calculator. Thank you for providing the original idea and calculations.