squarepix
squarepix is a simple Python tool that prepares images for computer vision and deep learning projects. Instead of just resizing an image (which can stretch and distort it), squarepix first crops it evenly from the center to make it a perfect square, then resizes it smoothly. This is useful when you're building datasets for image classification, object detection, or image segmentation, where images need to be the same size without looking stretched or squished. You can process a whole folder of images with one command, or use it directly in your own Python code.
Install
pip install squarepix
Usage (command line)
squarepix "D:\InputImages" "D:\OutputImages"
squarepix "D:\InputImages" "D:\OutputImages" --size 512 512
Usage (Python)
from squarepix import process_folder
process_folder("D:/InputImages", "D:/OutputImages", output_size=(640, 640))
Supported formats
.jpg .jpeg .png .bmp .tif .tiff .webp
Release files for squarepix 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| squarepix-0.1.3.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| squarepix-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.8 kB
Release files / squarepix-0.1.3.tar.gz
| Download URL | squarepix-0.1.3.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f07863889df742e2f86892c1d16ec3d500453d12103250e503e198ec2ecb5f42
|
|
BLAKE2b-256 checksum How to use checksums |
3fd1135d1cc652682dc7366ee586ae013292dab9c25632765cbf4f5ccccad2ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / squarepix-0.1.3-py3-none-any.whl
| Download URL | squarepix-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5b0274e12909fa3a24158f77d5fd8a3fcf3434b05590ea03e7c438e2ab866bb
|
|
BLAKE2b-256 checksum How to use checksums |
68023c564912576a2ce71dcdbc6c0b14cf557a553155f744fe10154385a70385
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|