Skip to main content

Crop images to a square and resize them in bulk, without stretching or distortion.

Project description

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

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

squarepix-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

squarepix-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file squarepix-0.1.2.tar.gz.

File metadata

  • Download URL: squarepix-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for squarepix-0.1.2.tar.gz
Algorithm Hash digest
SHA256 db3a8d9905ae69328e82d77cf4a1186d3eb8e9f6f03a503efb72c22acbb9bae7
MD5 be9c12bd5d514fe09d04f3144ead061f
BLAKE2b-256 c49cff0858b492d43df81479e7fa05239862eb19cec1447d6eb5b0cfe9030088

See more details on using hashes here.

File details

Details for the file squarepix-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: squarepix-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for squarepix-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eda3b95f357c36566b355a407fbf1a0e85ce0185b258772774017689969b17a9
MD5 1feb90bd84c6b44f9d3ffa5f3d2cfaa9
BLAKE2b-256 c004d0f239f063b2aeec797db9df8e849f9f7b9f0158f9e6ed71edf574677a71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page