Giter Site home page Giter Site logo

simple-guetzli's Introduction

Simple Guetzli

A Guetzli compression helper

go get github.com/romainmenke/simple-guetzli

or download from the latest release.

This requires : Guetzli


Why?

Guetzli is cpu intensive and waiting for builds / compiles /... is something we all like to avoid. This little tool keeps a log of compressed files and skips those that have already been done.

Now you can safely watch a folder with images and compress only that what needs to be done.

In short :

  • compresses an entire folder at once
  • executes compressions in parallel
  • tracks what has been compressed
  • determines file changes and recompresses

Useful :

  • cancel at any time, finished compressions will not need to be redone.
  • manage max threads.
  • max memory is divided by number of Guetzli instances (so 1000mb ram with 4 threads will give 250mb ram for each)
  • dontgrow flag deletes image files that got bigger because Geutzli failed to shrink them.
  • copy flag to keep your input and output dirs in sync despite Guetzli errors or files that grew.

Options

Flags:
      --help           Show context-sensitive help (also try --help-long and --help-man).
  -q, --quality=95     Visual quality to aim for, expressed as a JPEG quality value. Default value is 95.
      --log="info"     Log level
  -m, --memlimit=6000  Memory limit in MB. Guetzli will fail if unable to stay under the limit. Default limit is 6000
      --nomemlimit     Do not limit memory usage.
  -f, --force          Force recompression
      --force-quality  Force recompression if quality changed
  -t, --threads=3      Max concurrent threads. Default limit is 3
  -g, --dontgrow       Delete compressed files that got bigger
  -c, --copy           Copy all files from source folder to output, without overwriting compression results
  -v, --version        Guetzli Version

Args:
  [<source>]  Source directory
  [<output>]  Output directory
  [<log>]     Log directory, the log is used to prevent duplicate compressions

simple-guetzli's People

Contributors

romainmenke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

simple-guetzli's Issues

Copying EXIF/IPTC/XMP data

Thank you very much for the "helper"!
Nice tool for testing.

Running following command:
simple-guetzli --verbose -q90 -m24000 -t4 ./src_in ./src_out ./logging

jpeg-exif-guetzli
It will be compressed, but the EXIF/IPTC/XMP data get lost. This is normal with guetzli...

It would be nice if you can add (like) exiftool and copying the data.

go get github.com/romainmenke/simple-guetzli

@romainmenke I am trying to download the simple-guetzli via the above command on redhat 6 (uname -a
Linux redhatcompression 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Mar 21 12:19:18 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
) after the packages are downloaded. see the partial du -a result

2052 ./src/github.com
2168 ./src
2172 .

Is there anything we need to do furthure? Thank you very much!

Add EXIF data instead of log file?

There's an issue for guetzli suggesting the use of an EXIF comment to track whether an image has already been compressed by guetzli.

Even if this isn't accepted into the main guetzli, this would be a great addition for simple-guetzli. It would remove the dependency on a single, separate log file.

Add Request for a Few More Options

This is already a great utility, and I appreciate its simplicity. It makes using guetzli much easier.

I have a couple of suggestions for additional options that would make it more versatile without complicating it too much.

The options:

  • -recursive: so that it will recurse into subdirectories and compress all images found in there.
  • -overwrite: to replace the original with the compressed image.
  • -originals: where to move the original images when using the -overwrite option.

Force .jpg file extension on output

Hi, great utility. I know you haven't touched it in a couple of years but since guetzli can take in PNGs as a source, simple-guetzli will spit out the converted jpegs as .png files because it's copying the original file name and extension.

Is there an existing way to achieve this or would you consider patching it in? Might have to patch the log checker too? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.