A GUI tool to apply perspective transformations to images.
Project description
Image Perspective Transformer
This project provides a PyQt-based GUI application for marking four points on an image to apply a perspective transformation. Users can preview the transformed image and reselect points if the result is unsatisfactory.
Features
- Load and Display Image: Load an image and scale it to fit the screen while maintaining its aspect ratio.
- Mark Points: Click on the image to select four points for transformation.
- Clear Points: Reset the marked points and start over without restarting the application.
- Preview Transformation: Display the transformed image and check its quality before saving.
- Iterative Workflow: If the transformation is not satisfactory, reselect the points and apply the transformation again.
- Save Image: Save the transformed image to a file.
- Exit Application: Close the application. (Ctrl+Q / Command+Q)
Ensure the following are installed on your system:
- Python 3.7+
Install Steps
- Clone the repository:
git clone https://github.com/zangjiucheng/Perspective-Transformer.git
- Install the required packages:
pip install -r requirements.txt
- Run the application:
python perspective.py <image_path> [output_path]
How to Use
-
Run the Application:
-
Replace image.jpg in the code with the path to your image or place your image in the same directory as the script.
-
Start the application:
python perspective.py <image_path> [output_path]
-
-
Mark Points:
Click on the image to select four points in any order. These points define the region for perspective transformation.
-
Confirm Points:
After selecting four points, click "Confirm Points" to apply the transformation.
-
Preview Transformed Image:
Click "Preview Transformed Image" to see the transformed result in the same window. If the result is unsatisfactory, click "Clear Points" to reset and reselect points.
-
Save Transformed Image:
When satisfied, the application automatically saves the transformed image as transformed_image.jpg or the specified output path.
License
This project is open-source and can be modified and used for personal or educational purposes. Attribution to the original creator is appreciated. (MIT License)
Enjoy transforming your images! 🚀
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file perspective_transformer-1.0.1.tar.gz
.
File metadata
- Download URL: perspective_transformer-1.0.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19c44c70e3dbd3e597639fa23a73a37f1a9839347fdfc42f995838e53c1fd2e8 |
|
MD5 | be0506e366e3095feaf72d7126df6d7e |
|
BLAKE2b-256 | f878cd1f4a8874d493da6a0efd3a63098c5c00cc40f1725c19c702ae1f657693 |
Provenance
The following attestation bundles were made for perspective_transformer-1.0.1.tar.gz
:
Publisher:
publish-to-pypi.yml
on zangjiucheng/Perspective-Transformer
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
perspective_transformer-1.0.1.tar.gz
- Subject digest:
19c44c70e3dbd3e597639fa23a73a37f1a9839347fdfc42f995838e53c1fd2e8
- Sigstore transparency entry: 149362346
- Sigstore integration time:
- Predicate type:
File details
Details for the file perspective_transformer-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: perspective_transformer-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 847785de207b4b9405fffafe53231c01ac090e601c6d83ab38446435713f64b9 |
|
MD5 | 267d852a56bb1893860031f0f8f7e8d8 |
|
BLAKE2b-256 | d059853bbd12dc6729f8f9596d9e93f6e26d56e3430819b123b4fea851c23b22 |
Provenance
The following attestation bundles were made for perspective_transformer-1.0.1-py3-none-any.whl
:
Publisher:
publish-to-pypi.yml
on zangjiucheng/Perspective-Transformer
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
perspective_transformer-1.0.1-py3-none-any.whl
- Subject digest:
847785de207b4b9405fffafe53231c01ac090e601c6d83ab38446435713f64b9
- Sigstore transparency entry: 149362347
- Sigstore integration time:
- Predicate type: