Skip to content

princefishthrower/instagramize

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 

Instagramize

This is a Python 3 commandline tool which essentially automates what I was doing by hand before in GIMP.

It takes three arguments:

  1. (Required) the image file name to 'instagramize'
  2. (Optional) the pixel radius of the gaussian blur applied to the background. The default is 10.
  3. (Optional) the border radius around the image. The default is no border.

Ex:

python3 instagramize.py mycoolphoto.jpg

or to define gaussian blur:

python3 instagramize.py mycoolphoto.jpg 15

or to define gaussian blur and border radius:

python3 instagramize.py mycoolphoto.jpg 15 10

This will create an instagramized photo under the same directory with the name instagramized_mycoolphoto.jpg.

Visual examples (taken by yours truly :wink:):

  • Horizontal photo:

Horizontal photo before processing.

Horizontal photo after processing.

  • Vertical photo:

Vertical photo before processing.

Vertical photo after processing.

General Process

  1. Scale image to 2048px. What this means:
    • If the photo is landscape, the horizontal side should go to 2048 as background, and overlayed with the photo with height set to 2048px
    • The opposite is true for portrait photos
  2. Via some math, the image is pasted in a centered fashion over the background image, which is just the same image, but covering the 2048 x 2048 square, and blurred for nice effect
  3. The image is cropped to the correct 2048 x 2048 square and exported

That's it. Enjoy!

About

Nicely crop photos with same photo as blurred background to fit the max 2048 x 2048 Instagram picture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages