Python and Gtk code to reduce file size and resize images for web usage.

squeasy banner

I needed a tool for my wife to resize images for her blog and I found one called Trimage. I wasn’t much fond of it so I wrote my own, it’s fast and stable for only a days worth of coding. To run the code directly you’ll need GObject and PIL, you might want Pillow over PIL. A download exists below for a binary with all dependencies included if you just want to use it like any other application without any trouble.

Get the App for Linux

Download a binary with all the dependencies.

Download Size: 102.7mb (yes it’s big but it contains all the depends!)
SHA256: 323d117f2f1f75327df702e74a4f3b92b85210e6aff1029cd2b9ec2acce76b35
Download: http://www.darkartistry.com/Public/Squeasy.tar.xz

Features

Features bulk image load or individual image selection, user preferred settings, quick preview of loaded images, META data removal, resize width or height keeping aspect ratio or set both width and height for custom size, optimize setting, and size reduction setting so you can choose the best quality for your needs.

Learning

Some things you can learn from this code: Python Threading, saving binary user data in pickle, Gtk Liststore, and Treeview row events. It was fun to write. Screenshots follow the code.

Compiling

Alternatively, to freeze as a binary with all the depends you can install pyinstaller with PIP and issue this command while in the same folder as squeasy.py: pyinstaller squeasy.py

You may be able to make a binary for Windows with py2exe and OS X using py2app. I have also had great results on OS X using Platypus in the past. To get Gtk on Windows and OS X see this page.

Source Code

Python