All Projects → victordomingos → Optimize Images

victordomingos / Optimize Images

Licence: mit
A command-line interface (CLI) utility written in pure Python to help you reduce the file size of images.

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Optimize Images

Imager
Automated image compression for efficiently distributing images on the web.
Stars: ✭ 266 (+88.65%)
Mutual labels:  image-processing, image-compression, image-optimization
Imgp
📸 High-performance cli batch image resizer and rotator
Stars: ✭ 744 (+427.66%)
Mutual labels:  image-processing, image-compression, image-optimization
Essential Image Optimization
Essential Image Optimization - an eBook
Stars: ✭ 1,950 (+1282.98%)
Mutual labels:  image-processing, image-compression, image-optimization
Gaussianblur
An easy and fast library to apply gaussian blur filter on any images. 🎩
Stars: ✭ 473 (+235.46%)
Mutual labels:  image-processing, image-compression
Colorgram.py
A Python module for extracting colors from images. Get a palette of any picture!
Stars: ✭ 289 (+104.96%)
Mutual labels:  image-processing, pillow
Compress Images
Minify size your images. Image compression with extension: jpg/jpeg, svg, png, gif. NodeJs
Stars: ✭ 331 (+134.75%)
Mutual labels:  image-compression, image-optimization
Rawpy
📷 RAW image processing for Python, a wrapper for libraw
Stars: ✭ 256 (+81.56%)
Mutual labels:  image-processing, image-optimization
Image Actions
A Github Action that automatically compresses JPEGs, PNGs and WebPs in Pull Requests.
Stars: ✭ 844 (+498.58%)
Mutual labels:  image-processing, image-compression
Imgbot
An Azure Function solution to crawl through all of your image files in GitHub and losslessly compress them. This will make the file size go down, but leave the dimensions and quality untouched. Once it's done, ImgBot will open a pull request for you to review and merge. [email protected]
Stars: ✭ 732 (+419.15%)
Mutual labels:  image-compression, image-optimization
Imagemin Module
Automatically optimize (compress) all images used in Nuxt.js
Stars: ✭ 37 (-73.76%)
Mutual labels:  image-processing, image-optimization
Tinify Python
Python client for the Tinify API.
Stars: ✭ 95 (-32.62%)
Mutual labels:  image-compression, image-optimization
Crunch
Crunch is a tool for lossy PNG image file optimization. It combines selective bit depth, color type, and color palette reduction with zopfli DEFLATE compression algorithm encoding using the pngquant and zopflipng PNG optimization tools. This approach leads to a significant file size gain relative to lossless approaches at the expense of a relatively modest decrease in image quality (see example images below).
Stars: ✭ 3,074 (+2080.14%)
Mutual labels:  image-processing, image-compression
Primify
Embed any image into a prime number.
Stars: ✭ 266 (+88.65%)
Mutual labels:  image-processing, pillow
Resizer
An image resizing library for Android
Stars: ✭ 406 (+187.94%)
Mutual labels:  image-processing, image-compression
Pillow
The friendly PIL fork (Python Imaging Library)
Stars: ✭ 9,241 (+6453.9%)
Mutual labels:  image-processing, pillow
Emage
🧙‍♂️ From developers to developers: a cross-platform tool for losslessly image compression.
Stars: ✭ 99 (-29.79%)
Mutual labels:  image-compression, image-optimization
Tinify Java
Java client for the Tinify API.
Stars: ✭ 107 (-24.11%)
Mutual labels:  image-compression, image-optimization
zImageOptimizer
Simple image optimizer for JPEG, PNG and GIF images on Linux, MacOS and FreeBSD.
Stars: ✭ 108 (-23.4%)
Mutual labels:  image-compression, image-optimization
docker-imgproxy
🌐 An ultra fast, production-grade on-the-fly image processing web server. Designed for high throughput with Nginx caching. Powered by imgproxy.
Stars: ✭ 45 (-68.09%)
Mutual labels:  image-compression, image-optimization
Image Resizer
On-the-fly image resizing using Node.js and libvips. Heroku Ready!
Stars: ✭ 59 (-58.16%)
Mutual labels:  image-compression, image-optimization

Optimize Images Github commits (since latest release) PyPI PyPI - Downloads

A command-line interface (CLI) utility written in pure Python to help you reduce the file size of images.

This application is intended to be pure Python, with no special dependencies besides Pillow, therefore ensuring compatibility with a wide range of systems, including iPhones and iPads running Pythonista 3. If you don't have the need for such a strict dependency management, you will probably be better served by any several other image optimization utilities that are based on some well known external binaries.

Some aditional features can be added which require the presence of other third-party packages that are not written in pure Python, but those packages and the features depending on them should be treated as optional.

optimize-images_screenshot

Full Documentation:

Please refer to the above links if you want to know about all the options available in this application. For a quick intro, just to get a feeling of what it can do, please keep reading below.

Installation and dependencies:

To install and run this application, you need to have a working Python 3.6+ installation. We try to keep the external dependencies at a minimum, in order to keep compatibility with different platforms, including Pythonista on iOS. At this moment, we require:

  • Pillow>=8.0.1
  • piexif>=1.1.3
  • watchdog>=0.10.3

The easiest way to install it in a single step, including any dependencies, is by using this command:

pip3 install pillow optimize-images

If you are able to swap Pillow with the faster version Pillow-SIMD, you should be able to get a considerably faster speed. For that reason, we provide, as a friendly courtesy, an optional shell script (replace_pillow__macOS.sh) to replace Pillow with the faster Pillow-SIMD on macOS. Please notice, however, that it usually requires a compilation step and it was not throughly tested by us, so your mileage may vary.

You can also use this application on iOS, using an called Pythonista 3 (which is, among other things, a very nice environment for developing and/or running pure Python applications on iOS). Please check the detailed install procedure full in the user documentation.

How to use

The most simple form of usage is to type a simple command in the shell, passing the path to an image or a folder containing images as an argument. The optional -nr or --no-recursion switch argument tells the application not to scan recursively through the subdirectories.

By default, this utility applies lossy compression to JPEG files using a variable quality setting between 75 and 80 (by Pillow's scale), that is dynamically determined for each image according to the amount of change caused in its pixels, then it removes any EXIF metadata, tries to optimize each encoder's settings for maximum space reduction and applies the maximum ZLIB compression on PNG.

You must explicitly pass it a path to the source image file or to the directory containing the image files to be processed. By default, it will scan recursively through all subfolders and process any images found using the default or user-provided settings, replacing each original file by its processed version if its file size is smaller than the original.

If no space savings were achieved for a given file, the original version will be kept instead.

There are many other features and command-line options, like downsizing, keeping EXIF data, color palete reduction, PNG to JPEG conversion. Please check the docs for further information.

DISCLAIMER:
Please note that the operation is done DESTRUCTIVELY, by replacing the original files with the processed ones. You definitely should duplicate the source file or folder before using this utility, in order to be able to recover any eventual damaged files or any resulting images that don't have the desired quality.

Basic usage

Try to optimize a single image file:

optimize-images filename.jpg

Try to optimize all image files in current working directory and all of its subdirectories:

optimize-images ./

Try to optimize all image files in current working directory, without recursion:

optimize-images -nr ./
optimize-images --no-recursion ./

Getting help

To check the list of available options and their usage, you just need to use one of the following commands:

optimize-images -h
optimize-images --help

Did you find a bug or do you have a suggestion?

Please let me know, by opening a new issue or a pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].