Skip to content

presentformyfriends/shot-cropper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shot Cropper

Python script to perfectly crop your Instagram screenshots. Written for Windows but can be adapted for other OS.

The crop function starts from the middle of the image and iterates over the pixels up and down the y-axis until it finds the top and bottom white lines. It also detects and crops out any vertical black bars that may exist on either side of the image.

The function then saves a copy of the image with "_CROPPED" appended to the filename.

❤️ Usage

The uncommented code block labeled "CONTEXT MENU" under the main section is, in my opinion, the best way to set this up. For this to work, you must edit the Windows registry to add the .py file to the context menu. You can then right click any image to run the script from the context menu. This works with multiple images as well.

If you would rather run this from the Python shell, just comment out the "CONTEXT MENU" block, and uncomment either the block labeled "CROP SINGLE IMAGE" for a single image, or the block labeled "BATCH CROP" for an entire folder of images.

memeCrop.gif

Depending on the presence of a specific shade of white within the screenshot, it's possible that the crop function will fail, as in the example below.

memeCropError.gif

That being said, the script works very well for most Instagram screenshots.

🐍 Dependencies

This script requires Image and ImageChops (from PIL module), as well as the following Python modules: os, sys, pyautogui

About

Python script to perfectly crop your Instagram screenshots

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages