Effortlessly split images into Instagram-friendly grids without distorting the main subject. InstaGridify is a powerful Python script that allows you to seamlessly split images into grids suitable for Instagram, ensuring that the main subjects in the images are not distorted. Perfect for creating stunning and eye-catching Instagram posts and stories. It can be used for platforms other than Instagram but proportions may not be correct.
- Split images into customizable grid sizes (e.g., 3x3, 2x2, etc.).
- Preserve the integrity of the main subject in the image.
- Easy-to-use command-line interface.
- Flexible grid size recommendations based on image dimensions.
- Option for custom grid sizes.
- Error handling for various edge cases (e.g., non-existing images, non-image files, etc.).
To use InstaGridify, you need Python installed on your system Download Python. When installing Python check off [x] Add python.exe to PATH on the first page and use default selections the rest of the time. Clone or download this repository to your local machine and have any packages installed for Python.
git clone https://github.com/rpduggan/InstaGridify.git
cd InstaGridify
python -m pip install -r requirements.txt
Navigate to the directory containing insta_gridify.py
and run the script with the following command:
python insta_gridify.py <image_path> [optional: columns rows]
<image_path>
: Path to the image you want to split.optional: columns rows
: Optional grid size. If not provided, the script will recommend grid sizes.
for example:
python insta_gridify.py image.png 3 3
If you leave off the optional column and row numbers, it will estimate the best grids for you and give you some options to choose from.
InstaGridify supports a wide range of image file formats. Below is a list of commonly supported formats:
- JPEG (
*.jpg
,*.jpeg
) - PNG (
*.png
) - GIF (
*.gif
) - BMP (
*.bmp
) - TIFF (
*.tiff
) - Windows ICO (
*.ico
) - WEBP (
*.webp
) - PCX (
*.pcx
) - PPM (
*.ppm
) - PSD (
*.psd
) - TGA (
*.tga
)
Note: For SVG and multi-page PDFs, specialized libraries may be required as these are not natively supported by Pillow.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.