Skip to main content

A basic PyQt image cropping tool

Project description

QCrop

A basic PyQt image cropping tool.

Install

pip install qcrop

Usage

As an application

Start with the command:

qcrop path/to/image.ext

The supported image formats are those handled by the Qt framework: BMP, GIF, JPG, PNG, PBM, PGM, PPM, XBM and XPM.

As a python module

Sample code:

from PyQt5.QtGui import QPixmap
from qcrop.ui import QCrop

original_image = QPixmap(...)
crop_tool = QCrop(original_image)
status = crop_tool.exec()

if status == Qt.Accepted:
    cropped_image = crop_tool.image
# else crop_tool.image == original_image

User interface

Use the mouse to select the image area to crop. You can also use the X, Y, Width and Height fields to precisely adjust the area (you can use mouse wheel hovering the field).

Click the reset button to set the crop area to the full image.

Once done click ok to validate the crop, cancel to go back to the original image.

screenshot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for qcrop, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size qcrop-0.0.1-py3-none-any.whl (20.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size qcrop-0.0.1.tar.gz (7.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page