A cross-platform tool for optimizing PNG and JPG files.

Related tags

Trimage
Overview

Made by @kilianvalkhof

Other projects:

  • ๐Ÿ’ป Polypane - Develop responsive websites and apps twice as fast on multiple screens at once
  • ๐Ÿ–Œ๏ธ Superposition - Kickstart your design system by extracting design tokens from your website
  • ๐Ÿ—’๏ธ FromScratch - A smart but simple autosaving scratchpad

Trimage image compressor

A cross-platform tool for optimizing PNG and JPG files.

Trimage is a cross-platform GUI and command-line interface to optimize image files via advpng, jpegoptim, optipng and pngcrush depending on the filetype (currently, PNG and JPG files are supported). It was inspired by imageoptim.

All image files are losslessly compressed on the highest available compression levels. Trimage gives you various input functions to fit your own workflow: a regular file dialog, dragging and dropping and various command line options.

Installation instructions

Visit Trimage.org to install Trimage as a package.

Building instructions

Prerequisites

  • PyQt5
  • advpng
  • jpegoptim
  • optipng
  • pngcrush

Build from source

Build and install by running:

python setup.py build
sudo python setup.py install
Issues
  • First try to adopt Python3 and PyQt5

    First try to adopt Python3 and PyQt5

    Here's my first bytes to adopt Python3 and PyQt5 in order to modernize this very useful application. @Kilian Are you interested in this approach?

    Here's the TODO that will be updated:

    • ~Find all possible regressions and missing changes.~

    I've also move the TODO file to the root directory for more visibility (standard practice) and convert it and the README files in markdown.

    It seems to works quite well. I let you test these changes and give me advices. If you want to commit directly in my fork to update this PR, don't hesitate ;).

    opened by Huluti 21
  • doesn't start with latest pngcrush

    doesn't start with latest pngcrush

    After upgrading pngcrush from 1.8.11 to 1.8.12, Trimage fails to start. This happens with both 1.0.5 and the current git version (I'm using the packages in AUR).

    $ trimage 
     pngcrush 1.8.12, uses libpng 1.6.31 and zlib 1.2.11
     Check http://pmt.sf.net/
     for the most recent version.
    
    usage: pngcrush [options except for -e -d] infile.png outfile.png
           pngcrush -e ext [other options] file.png ...
           pngcrush -d dir/ [other options] file.png ...
           pngcrush -ow [other options] file.png [tempfile.png]
           pngcrush -h or -v -v -h (for help or verbose help) 
           pngcrush -n -v file.png ... (to list chunks)
    [error] please install pngcrush
    
    opened by ikn 8
  • CentOS 6 - PyQt4.QtCore import * error

    CentOS 6 - PyQt4.QtCore import * error

    Hi all, I have just installed trimage on centos 6 and i got this when running the following command.

    trimage -v

    Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/trimage/trimage.py", line 14, in from PyQt4.QtCore import * ImportError: No module named PyQt4.QtCore

    opened by mhamzas 8
  • Getting No module named trimage error

    Getting No module named trimage error

    Just installed using apt-get and get the following error:

    screen shot 2017-08-29 at 11 19 59 am
    opened by shawnbro 7
  • Trouble using command line version

    Trouble using command line version

    Sometimes when running "trimage -q -f [file]" from command line / terminal, the command seems to hang with trimage in the systray. I have to rightclick the systray icon and quit manually. I'm trying to execute the command as part of a batch job in a web application.

    Are there any plans making a command line - only version (no dependecies on X/QT)?

    opened by magbyr 6
  • Use pngcrush for even smaller png's

    Use pngcrush for even smaller png's

    I've made (again) a small modification on trimage allowing it to use pngcrush. I've reached deeper levels in lossless compression.

    Again, interested ?

    opened by bistory 6
  • Using trimage on linux server edition

    Using trimage on linux server edition

    Hey guys!

    First of all, thanks for this awesome tool! It's really good :)

    I'm trying to use it on my web app and it runs on Ubuntu Lucid 64bit Server Edition. When I try to run it, I get the following error message:

    trimage.py: cannot connect to X server
    

    Is there a way to install this dependecty and start to work with it? Or is there another way? Thanks mates!

    opened by eberfreitas 6
  • wish: better jpeg compression level

    wish: better jpeg compression level

    This was previously discussed by email: Trimage losslessly compresses images, but jpeg format can't compress losslessly, even in top high quality. One thing that can satisfy everybody would be to add an option in the config file for jpeg default compression level. The config file could be located in user's home and (or) in /etc. That option, would not be available from graphical interface, and documented only in the man page and the Readme. Sysadmins loves these sort of features (Im sysadmin)!

    opened by zeroheure 6
  • Forced progressive JPEG encoding would further reduce file size for the vast majority of non-progressive JPEGs

    Forced progressive JPEG encoding would further reduce file size for the vast majority of non-progressive JPEGs

    By default jpegoptim keeps progressive JPEGs progressive and non-progressive JPEGs non-progressive. But unless images are extremely small, progressive encoding normally results in smaller file sizes. Most cameras encode non-progressively because it's less ressource-intensive and is much easier to do in hardware. Those images are currently not optimally compressed by Trimage.

    I think just adding "--all-progressive" to the jpegoptim command would be an improvement.

    opened by damian101 3
  • Tray icon fixes

    Tray icon fixes

    Fix Quit App in Tray.

    opened by pooh2pooh 4
  • Add a control to show progress / terminal output of compression

    Add a control to show progress / terminal output of compression

    When I use version 1.0.5-1.1 (on Ubuntu) the UI visually freezes sometimes when processing an image. Typically, this seems to be when the application crashes in the background. The UI keeps looking like it would still be processing, e.g.

    Screenshot from 2021-02-17 23-05-28

    It would be helpful in this case (and also when processing large files, I guess) to have a way to watch the progress of the compression and/or allow inspection of the terminal output of the tools that ran.

    A text area being filled with the terminal output would be just great, which can be expanded or collapsed using a chevron icon.

    opened by bittner 0
  • Can't quit Trimage without killing the process, system tray icon doesn't go away

    Can't quit Trimage without killing the process, system tray icon doesn't go away

    I'm using KDE Plasma on RebornOS (Arch Linux). Quitting Trimage will leave the icon in the system tray behind. Which ins't a big problem, but I can't quit it by normal means, clicking "Quit" doesn't do anything. I can still unhide the window but there's no way of quitting Trimage completely without killing the process.

    opened by damian101 3
  • FileNotFoundError: [Errno 2] No such file or directory: '/tmp/file.png'

    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/file.png'

    In command line mode trimage fails to handle files with the same name in different directory. Sample structure:

    _root __one ___image.png __two ___image.png

    command: trimage -d root

    Stacktrace:

    Traceback (most recent call last):
      File "/usr/local/lib/python3.9/site-packages/trimage/ThreadPool/ThreadPool.py", line 83, in execute
        return_value = self.callable(*self.arguments) #IGNORE:W0142
      File "/usr/local/lib/python3.9/site-packages/trimage/trimage.py", line 397, in compress
        remove(backupfullpath)
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/image.png'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 950, in _bootstrap_inner
        self.run()
      File "/usr/local/lib/python3.9/site-packages/trimage/ThreadPool/ThreadPool.py", line 124, in run
        job.execute()
      File "/usr/local/lib/python3.9/site-packages/trimage/ThreadPool/ThreadPool.py", line 86, in execute
        logger.warning("A job in the ThreadPool raised an exception: ", excep)
      File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1446, in warning
        self._log(WARNING, msg, args, **kwargs)
      File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1577, in _log
        self.handle(record)
      File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1587, in handle
        self.callHandlers(record)
      File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1648, in callHandlers
        if record.levelno >= hdlr.level:
    AttributeError: '_io.TextIOWrapper' object has no attribute 'level'
    

    Setup: Mac OS, trimage 1.0.6

    opened by diklimchuk 0
  • UI small font size

    UI small font size

    The UI has a small font size; looking at the source, I see font size is explicitly set in setPointSize(9) etc.

    Can the UI be set to the system default font size? as I understand from these answers https://stackoverflow.com/a/15176042, https://stackoverflow.com/a/30685158 :slightly_smiling_face:

    opened by rwanyoike 0
  • cli works but crashes at the end

    cli works but crashes at the end

    After running trimage with: trimage -d .

    It seems to successfully process all files, but ends with a crash:

    Exception ignored in: <function Worker.__del__ at 0x7fd26857d9d0>
    Traceback (most recent call last):
      File "/usr/lib/python3.8/site-packages/trimage/trimage.py", line 414, in __del__
      File "/usr/lib/python3.8/site-packages/trimage/ThreadPool/ThreadPool.py", line 172, in shutdown
    TypeError: 'NoneType' object is not callable
    

    Running the newest version, installed with yay -S trimage on Arch Linux.

    opened by dangelov 5
  • Trimage not working on Fedora 31

    Trimage not working on Fedora 31

    Hello,

    after installing Trimage 1.0.6-1 on Fedora 31 it is not starting up when executed.

    I used the binary from here.

    Regards,

    Af0x

    opened by Af0x 1
  • i cant nstall trimage

    i cant nstall trimage

    sudo apt-get install trimage

    Reading package lists... Done Building dependency tree
    Reading state information... Done E: Unable to locate package trimage

    opened by G33kNoob 1
  • Add more loseless PNG compression libraries

    Add more loseless PNG compression libraries

    Is it possible to add more loseless compression options for PNG files? I am comparing Image-Optimizer to FileOptimizer which is a great file compressor program for windows which works in Wine but I would always prefer to use a native linux application over using Windows apps in Wine.

    https://nikkhokkho.sourceforge.io/static.php?page=FileOptimizer

    opened by trymeouteh 0
Releases(1.0.6)
A beautiful and customizable wallpapers manager for Linux

Komorebi - Animated Wallpapers for Linux (n) sunlight filtering through trees. Watch demo What is Komorebi? Komorebi is an awesome animated wallpapers

null 2.2k Jun 5, 2021
Personal CRM. Remember everything about your friends, family and business relationships.

Personal Relationship Manager Monica is a great open source personal relationship management system. Introduction Purpose Features Who is it for? What

Monica 12.9k Jun 6, 2021
TMSU lets you tags your files and then access them through a nifty virtual filesystem from any other application.

Overview TMSU is a tool for tagging your files. It provides a simple command-line utility for applying tags and a virtual filesystem to give you a tag

Paul Ruane 1.5k Jun 1, 2021
A free open source IT asset/license management system

Snipe-IT - Open Source Asset Management System This is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was

snipe 5k Jun 3, 2021
Source code for Gramps Genealogical program

The Gramps Project ( https://gramps-project.org ) We strive to produce a genealogy program that is both intuitive for hobbyists and feature-complete f

Gramps Project 1.2k Jun 5, 2021
Online genealogy

webtrees - online collaborative genealogy Contents License Coding styles and standards Introduction System requirements Internet browser compatibility

Greg Roach 550 Jun 7, 2021
Display and control your Android device

scrcpy (v1.17) Read in another language This application provides display and control of Android devices connected on USB (or over TCP/IP). It does no

Genymobile 49.4k Jun 4, 2021
AlertHub is a simple tool written with NodeJS to get alerted from new GitHub and GitLab repository events.

AlertHub _ _ _ _ /_\ | | ___ _ __| |_ /\ /\_ _| |__ //_\\| |/ _ \ '__| __|/ /_/ / | | | '_ \ / _ \ | __/ | |

Arda KฤฑlฤฑรงdaฤŸฤฑ 96 Jun 3, 2021
Open source back-end server for web, mobile and IoT. The backend for busy developers. (self-hosted or hosted)

A scalable, multitenant backend for the cloud. Para is a scalable, multitenant backend server/framework for object persistence and retrieval. It helps

Erudika 395 May 26, 2021
Open source API management platform

About Fusio is an open source API management platform which helps to build and manage REST APIs. Fusio provides all tools to quickly build an API from

Apioo 970 Jun 5, 2021
Self Hosted Movie, Series and Anime Watch List

Flox Flox is a self hosted Movie, Series and Animes watch list. It's build on top of Laravel and Vue.js and uses The Movie Database API. The rating ba

Viktor Geringer 927 Jun 6, 2021
Read-only mirror of https://gitlab.gnome.org/GNOME/gparted

GPARTED ======= Gparted is the GNOME Partition Editor for creating, reorganizing, and deleting disk partitions. A hard disk is usually subdivided int

GNOME Github Mirror 169 Jun 6, 2021
Kimai v1 open source time-tracking - please switch to Kimai v2

?? Kimai v1 is not maintained any more Go ahead to https://github.com/kevinpapst/kimai2 and update to use the latest release, rewritten from scratch,

Kimai - Time Tracking Software 581 May 10, 2021
The Linux PowerTOP tool -- please post patches to the mailing list instead of using github pull requests

PowerTOP PowerTOP is a Linux* tool used to diagnose issues with power consumption and power management. In addition to being a diagnostic tool, PowerT

Arjan van de Ven 499 May 31, 2021