Kilian Valkhof

Front-end & user experience developer, Jedi.

Trimage image compressor

Apps, Web, 24 March 2010, 3 minute read

As a front-end developer, minimizing your images is important. Compressed images load faster and take less time to download. However, most current tools that can do that are command line applications that only support one type of image, and oftentimes do not have the same API. To scratch my own itch I build a cross-platform GUI image compressor.

Trimage

Trimage is a GUI front-end to a couple of command line tools available on most linux based systems (though it should work on mac and windows, too), and can losslessy compress both PNG and JPG files. It looks native, (dare I say) pretty and is very easy to use.

That’s why Trimage has multiple ways of accepting files: You can drop them onto the app, you can open them via a file dialog, and you can feed it images or entire directories via the command line. So you can pick the method you find most comfortable, and use that.

More information can be found on the website: Trimage.org.

screenshot of trimage

How to install

For the moment, I only have installation guides for Ubuntu and other linux-based systems. If you can help me with Mac and Windows, please e-mail me at help@trimage.org!

Ubuntu

Ubuntu is by far the easiest to install. If you’re on karmic or lucid, simply enter this into your console:

  1. sudo add-apt-repository ppa:kilian/trimage
  2. sudo apt-get update
  3. sudo apt-get install trimage

If you are still on Jaunty, read this guide on installing PPA’s.

Other Linux:

I’m still looking for help with making .debs, .rpms and the like, but you can install Trimage via python as well:

  1. Download the source via GitHub or Launchpad
  2. Make sure you have all the requirements installed: python 2.6, python-qt4 4.4, optipng 0.6.2.1, advancecomp 1.15, jpegoptim 1.2.2, or higher versions
  3. Enter python setup.py install into your console
  4. Launch by executing trimage

Why and how

As I said in the intro, I wrote this mostly to scratch my own itch. I wanted an easier way to compress my files that didn’t involve mucking about on the command line or uploading all my images to some server far away via a crappy flash application.

Trimage was inspired by ImageOptim. It is made using python and the PyQt GUI framework. The choice for PyQt was made for a couple of reasons: the Qt4 designer is very easy to use, it’s available cross-platform and most importantly, it provides native widgets. As the latter is my number one annoyance, and I actively avoid using programs that do not look like they belong in my gnome desktop, this was a big issue for me. Paul Chaplin helped me with a lot of the python stuff.

However, PyQt has some downsides as well. For one. The documentation is bad. It’s not complete, hard to read and sometimes isn’t even correct. That’s not to say it’s unusable, but it clearly needs some more love.

Where the documentation lacks however, the #pyqt IRC channel on freenode is awesome. There are a bunch of really smart and nice people there that go out of their way to help you. Every community should be like this.

If you want to build a GUI app for Ubuntu using python, the best start you can get is PyAppTemplate by Neil Wallace, which takes care of all the Hoohaa and voodoo that goes into a setup.py and the debian build files. It took me a day to try and figure it all out by myself, and then an hour to get it working using PyAppTemplate.

Future development

As you can see on the website, I have a bunch of features lined up for the coming versions. All development is done on GitHub, so if you want to help out, add more options or scratch an item from the todo, I appreciate all help!

Thanks for Reading!

I am Kilian Valkhof, a front-end and user experience developer from the Netherlands.
Contact me or ping me on twitter.

  1. Social comments and analytics for this post…

    This post was mentioned on Hackernews by kilian: I got the idea for this a while ago while writing a comment on HN: http://news.ycombinator.com/item?id=1032135 and it’s done now :)…

  2. […] This post was mentioned on Twitter by news.yc Popular, Hacker News Bot, Kilian Valkhof, Web Startup Group, Dirk Sidney Jansen and others. Dirk Sidney Jansen said: RT Trimage image compressor: As a front-end developer, minimizing your images is important. Compressed images load… http://bit.ly/aQnaFI […]

  3. Nickolai Leschov

    Tried to use it on my Ubuntu 9.04. Unfortunately, it doesn’t work for me.

    It is not working for gif files, which I understand is by design. But I think it’d better give a note that it won’t process gif instead of just doing nothing.

    For files that I tested it on, it either doesn’t do anything, or says “Compressing” forever. I managed to find a jpg file that it did compress for a gain of 5% though.

Be the first to know about new releases!

Newsletter subscribers will be the first to know about new apps I release or new articles I write, here or elsewhere.

Low-volume. I will only email you when I have something exciting to share.