All Projects → foobaz → pngloss

foobaz / pngloss

Licence: other
Lossy compression of PNG images

Programming Languages

shell
77523 projects
c
50402 projects - #5 most used programming language
Makefile
30231 projects
go
31211 projects - #10 most used programming language
HTML
75241 projects
Roff
2310 projects

Projects that are alternatives of or similar to pngloss

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 (+4110.96%)
Mutual labels:  png, png-compression, image-compression, lossy-compression
zImageOptimizer
Simple image optimizer for JPEG, PNG and GIF images on Linux, MacOS and FreeBSD.
Stars: ✭ 108 (+47.95%)
Mutual labels:  png, png-compression, image-compression, image-optimization
Pngquant
Lossy PNG compressor — pngquant command based on libimagequant library
Stars: ✭ 4,086 (+5497.26%)
Mutual labels:  png, png-compression, image-optimization
pngquant
A Python Wrapper of Pngquant
Stars: ✭ 27 (-63.01%)
Mutual labels:  png, png-compression, image-optimization
Compress Images
Minify size your images. Image compression with extension: jpg/jpeg, svg, png, gif. NodeJs
Stars: ✭ 331 (+353.42%)
Mutual labels:  png, image-compression, image-optimization
Essential Image Optimization
Essential Image Optimization - an eBook
Stars: ✭ 1,950 (+2571.23%)
Mutual labels:  png, image-compression, image-optimization
Emage
🧙‍♂️ From developers to developers: a cross-platform tool for losslessly image compression.
Stars: ✭ 99 (+35.62%)
Mutual labels:  image-compression, image-optimization
Tinify Java
Java client for the Tinify API.
Stars: ✭ 107 (+46.58%)
Mutual labels:  image-compression, image-optimization
Tinify Php
PHP client for the Tinify API.
Stars: ✭ 204 (+179.45%)
Mutual labels:  image-compression, image-optimization
Imgp
📸 High-performance cli batch image resizer and rotator
Stars: ✭ 744 (+919.18%)
Mutual labels:  image-compression, image-optimization
nimPNG
PNG (Portable Network Graphics) decoder and encoder written in Nim
Stars: ✭ 81 (+10.96%)
Mutual labels:  png, image-compression
create-optimize-images
♻️ Reusable, scalable, bash scripts to create and optimize images.
Stars: ✭ 39 (-46.58%)
Mutual labels:  png, image-optimization
Mediancut Posterizer
Lossy PNG compressor for RGBA PNGs. Has two modes: lossy averaging filter (blurizer) that denoises the image and optimal posterization using Median Cut quantization to reduce number of unique colors in the image with minimal visual distortion
Stars: ✭ 203 (+178.08%)
Mutual labels:  png, image-optimization
Tinify Python
Python client for the Tinify API.
Stars: ✭ 95 (+30.14%)
Mutual labels:  image-compression, image-optimization
Optimize Images
A command-line interface (CLI) utility written in pure Python to help you reduce the file size of images.
Stars: ✭ 141 (+93.15%)
Mutual labels:  image-compression, image-optimization
Image Resizer
On-the-fly image resizing using Node.js and libvips. Heroku Ready!
Stars: ✭ 59 (-19.18%)
Mutual labels:  image-compression, image-optimization
Optimizt
CLI image optimization tool
Stars: ✭ 594 (+713.7%)
Mutual labels:  png, image-compression
Imager
Automated image compression for efficiently distributing images on the web.
Stars: ✭ 266 (+264.38%)
Mutual labels:  image-compression, image-optimization
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 (+902.74%)
Mutual labels:  image-compression, image-optimization
Image Optimizer
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.
Stars: ✭ 785 (+975.34%)
Mutual labels:  png, image-optimization

pngloss

Lossily compress your PNG images with pngloss. The program reads the original PNG file and modifies the pixels to make them more compressible. The resulting PNGs are fully backwards compatible with existing PNG decoders. You can use the command line tool on your own machine, or compress images using the interactive website.

The compression technique relies on making small adjustments to pixel colors. It works best on true-color images with a wide variety of colors, like photographs or computer generated graphics with realistic lighting. It does not do a good job on paletted images or images with large areas of flat color.

Heritage

The lossy compression in pngloss is based on an algorithm in Michael Vinther's graphics editor, Image Analyzer.

The command line tool is based on Kornel Lesiński's PNG quantization tool, pngquant. Additionally, pngloss includes his work to port the lossy compression algorithm from Go to C as part of his PNG compression suite, ImageOptim.

William MacKay brought these pieces together and made improvements to the original compression algorithm, including:

  • Diffuse color error using Sierra dithering.
  • Instead of using a static, evenly spaced symbol table (e.g. 0, 20, 40...), pngloss chooses symbols which are more frequent in the original file.
  • Instead of using only PNG's "average" filter, pngloss tries all five PNG filters for each row, keeping whichever has the best quality/size ratio.
  • Explicitly tell libpng which filter to use for each row instead of hoping its adaptive filter selection algorithm will choose the correct one.

Installation

git clone https://github.com/foobaz/pngloss.git
cd pngloss
./configure
make
sudo make install

The only dependency is libpng.

Synopsis

pngloss [options] <file> [<file>...]

Options

-s, --strength How much quality to sacrifice, from 0 to 85 (default 19). Strength 0 is lossless and does not modify the pixel data, although it may convert colorspace or strip PNG chunks. The maximum is 85 because the algorithm needs at least three symbols to perform well and 256 / 3 ~= 85. One symbol near zero is used for the majority of pixels, plus one positive and one negative to insert when color error builds up enough that they are needed.

-b, --bleed Color bleed divider, from 1 to 32767 (default 2). A divider of 1 propagates all of the error from quantization to neighboring pixels, which improves visual quality but also increases filesize. The default of 2 propagates half (1/2) of the error, which is usually a good tradeoff.

-v, --verbose Verbose - print additional information about compression.

-q, --quiet Quiet - don't print information about compression (the default).

-f, --force Force - overwrite existing output image.

--no-force Don't overwrite existing output image - overrides an earlier "force" argument.

--ext Specify filename extension. Defaults to "-loss.png". Use -f --ext .png to overwrite original files in-place if the original has the extension ".png".

--skip-if-larger Don't write compressed image if it's larger than the original.

-o, --output Output filename. When this option is given only one input file is accepted.

--strip Remove unnecessary chunks (metadata) from input file when writing output.

-V, --version Print version number.

-h, --help Display usage information.

Examples

Original -s 20 -s 40
David, original David, s20 David, s40
18kB 7kB (36%) 5kB (23%)
Original -s 20 -s 40
Lena, original Lena, s20 Lena, s40
475kB 65kB (13%) 35kB (7%)
Original -s 20 -s 40
Tenko, original Tenko, s20 Tenko, s40
234kB 47kB (20%) 30kB (13%)
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].