{"id":15037208,"url":"https://github.com/jamiemason/imageoptim-cli","last_synced_at":"2025-05-13T23:08:55.689Z","repository":{"id":6969847,"uuid":"8222847","full_name":"JamieMason/ImageOptim-CLI","owner":"JamieMason","description":"Make optimisation of images part of your automated build process","archived":false,"fork":false,"pushed_at":"2024-09-13T07:35:45.000Z","size":43588,"stargazers_count":3494,"open_issues_count":9,"forks_count":126,"subscribers_count":52,"default_branch":"main","last_synced_at":"2025-05-10T17:42:15.172Z","etag":null,"topics":["advpng","compress","gifsicle","image-optimisation","imagealpha","imageoptim","jpegmini","jpegoptim","jpegtran","optimize","optipng","performance","pngcrush","pngout","pngquant","site-speed","webperf"],"latest_commit_sha":null,"homepage":"https://foldleft.io/image-tools","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamieMason.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"JamieMason"}},"created_at":"2013-02-15T17:33:52.000Z","updated_at":"2025-05-09T16:52:00.000Z","dependencies_parsed_at":"2023-11-06T14:46:41.351Z","dependency_job_id":"fbd9db13-f924-4362-b0eb-e28e71c6c979","html_url":"https://github.com/JamieMason/ImageOptim-CLI","commit_stats":{"total_commits":368,"total_committers":20,"mean_commits":18.4,"dds":0.0842391304347826,"last_synced_commit":"509d2ef8707b21be622d56ca25b653a0d9a593a2"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2FImageOptim-CLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2FImageOptim-CLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2FImageOptim-CLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamieMason%2FImageOptim-CLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamieMason","download_url":"https://codeload.github.com/JamieMason/ImageOptim-CLI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254041900,"owners_count":22004800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advpng","compress","gifsicle","image-optimisation","imagealpha","imageoptim","jpegmini","jpegoptim","jpegtran","optimize","optipng","performance","pngcrush","pngout","pngquant","site-speed","webperf"],"created_at":"2024-09-24T20:33:46.584Z","updated_at":"2025-05-13T23:08:50.667Z","avatar_url":"https://github.com/JamieMason.png","language":"TypeScript","readme":"# ImageOptim-CLI\n\n\u003e Automates [ImageOptim](http://imageoptim.com), [ImageAlpha](http://pngmini.com), and [JPEGmini for Mac](http://jpegmini.com/mac) to make batch optimisation of images part of your automated build process.\n\n[![NPM version](http://img.shields.io/npm/v/imageoptim-cli.svg?style=flat-square)](https://www.npmjs.com/package/imageoptim-cli)\n[![NPM downloads](http://img.shields.io/npm/dm/imageoptim-cli.svg?style=flat-square)](https://www.npmjs.com/package/imageoptim-cli)\n[![Build Status](https://github.com/JamieMason/ImageOptim-CLI/actions/workflows/ci.yaml/badge.svg)](https://github.com/JamieMason/ImageOptim-CLI/actions/workflows/ci.yaml)\n[![Maintainability](https://api.codeclimate.com/v1/badges/c7f41a90fa2c975cfd03/maintainability)](https://codeclimate.com/github/JamieMason/ImageOptim-CLI/maintainability)\n\n## Table of Contents\n\n-   [📣 Summary](#-summary)\n-   [🌩 Installation](#-installation)\n-   [🕹 Usage](#-usage)\n-   [⚠️ JPEGmini and support for assistive devices](#️-jpegmini-and-support-for-assistive-devices)\n-   [💡 Related Projects](#-related-projects)\n-   [❓ FAQs](#-faqs)\n-   [⚙️ Contributing](#️-contributing)\n-   [🙋🏿‍♀️ Getting Help](#♀️-getting-help)\n-   [👀 Other Projects](#-other-projects)\n-   [🤓 Author](#-author)\n\n## 📣 Summary\n\nWhile other image optimization tools are available from the command line, ImageOptim-CLI exists because the [current benchmarks](http://jamiemason.github.io/ImageOptim-CLI/) suggest that ImageOptim, ImageAlpha and JPEGmini currently outperform those alternatives over lossless and lossy optimizations.\n\nImageOptim-CLI is written in TypeScript and AppleScript but is distributed as a self-contained executable binary, you don't need Node.js installed to use ImageOptim-CLI.\n\nCheck out this short [video demo of ImageOptim-CLI](https://www.youtube.com/watch?v=HGBounRIzSs) to see how it works.\n\n## 🌩 Installation\n\n### [npm](https://npmjs.org/)\n\n    npm install -g imageoptim-cli\n\n### [homebrew](https://brew.sh/)\n\n    brew update\n    brew install imageoptim-cli\n\n### Manual\n\nOtherwise, you can install manually by downloading the latest release then adding ImageOptim-CLI to your [\\\\\\\\$PATH](https://en.wikipedia.org/wiki/PATH_(variable)).\n\n    # go to home directory\n    cd ~\n    # download the tarball (change 3.0.7 to latest version if available)\n    curl --output imageoptim-cli.tgz https://registry.npmjs.org/imageoptim-cli/-/imageoptim-cli-3.0.7.tgz\n    # extract the tarball\n    tar -xvzf ./imageoptim-cli.tgz\n    # delete the tarball\n    rm imageoptim-cli.tgz\n    # rename the directory extracted from the tarball\n    mv ./package ./imageoptim-cli\n    # make imageoptim command available in your terminal\n    export PATH=$PATH:imageoptim-cli/dist\n\n\u003e Saving somewhere in your home directory such as `~/imageoptim-cli` is recommended, but not essential. Saving to `/Applications` is **not** recommended, do not do this.\n\n## 🕹 Usage\n\n    $ imageoptim --help\n\n      Usage: imageoptim [options] [patterns...]\n\n      Options:\n\n        -V, --version           output the version number\n        -a, --imagealpha        enable ImageAlpha\n        -j, --jpegmini          enable JPEGmini\n        -C, --no-color          output to the terminal without colors\n        -I, --no-imageoptim     disable ImageOptim\n        -Q, --no-quit           do not quit apps once finished\n        -S, --no-stats          do not display file size savings and quality loss information\n        --number-of-colors \u003cn\u003e  ImageAlpha palette size, defaults to 256\n        --quality \u003cmin\u003e-\u003cmax\u003e   ImageAlpha quality range from 0-100, defaults to 65-80\n        --speed \u003cn\u003e             ImageAlpha speed from 1 (brute-force) to 10 (fastest), defaults to 1\n        -h, --help              output usage information\n\n      Supported Apps:\n\n        ImageAlpha: https://pngmini.com\n        ImageOptim: https://imageoptim.com\n        JPEGmini Lite: https://itunes.apple.com/us/app/jpegmini-lite/id525742250\n        JPEGmini Pro: https://itunes.apple.com/us/app/jpegmini-pro/id887163276\n        JPEGmini: https://itunes.apple.com/us/app/jpegmini/id498944723\n\n      Examples:\n\n        Run ImageOptim.app over every image in current directory\n        imageoptim\n\n        Run ImageAlpha.app and ImageOptim.app over every PNG in current directory\n        imageoptim --imagealpha '**/*.png'\n\n        Run JPEGmini.app and ImageOptim.app over every JPG in current directory\n        imageoptim --jpegmini '**/*.jpg' '**/*.jpeg'\n\n        Run ImageOptim.app over every image in a specific directory\n        imageoptim '~/Desktop'\n\n## ⚠️ JPEGmini and support for assistive devices\n\nYou may be presented with the following message the first time you run ImageOptim-CLI with the `--jpegmini` flag.\n\n\u003e To automate JPEGmini we need to add Terminal.app (or iTerm.app etc) to the 'support for assistive devices' whitelist.\n\nThe JPEGmini OS X Apps don't include a command line API, so a real user is simulated by entering synthetic clicks and keyboard commands instead. This requires your permission and is easily set up in System Preferences as shown by these guides.\n\n-   [Enable access for assistive devices in OS X](http://mizage.com/help/accessibility.html)\n-   [OS X Mavericks: Enable access for assistive devices and applications](http://support.apple.com/en-us/HT6026)\n\n## 💡 Related Projects\n\n### Grunt Plugin\n\nThe ImageOptim-CLI [Grunt](http://gruntjs.com) plugin is [grunt-imageoptim](https://github.com/JamieMason/grunt-imageoptim).\n\n### Comparison of image optimization tools\n\nImageOptim-CLI features in this comparison of the [performance of image optimisation tools](http://jamiemason.github.io/ImageOptim-CLI/) alongside Kraken.io, CodeKit, grunt-contrib-imagemin, Smush.it, and TinyPNG.\n\n### Article for Smashing Magazine\n\n[How Optimized Are Your Images? Meet ImageOptim-CLI, a Batch Compression Tool](http://www.smashingmagazine.com/2013/12/17/imageoptim-cli-batch-compression-tool/)\n\n### Alfred Workflow\n\nThe ImageOptim-CLI Workflow for Alfred app is [alfred-image-optim-workflow](https://github.com/ramiroaraujo/alfred-image-optim-workflow)\n\n## ❓ FAQs\n\n### General\n\n#### Do ImageOptim, ImageAlpha, or JPEGmini come bundled with the ImageOptim-CLI installation?\n\nYou will need to install these applications separately.\n\n#### Do I have to pay to use ImageOptim-CLI?\n\nThe CLI, ImageOptim and ImageAlpha are all free. JPEGmini is a paid-for product but you can use ImageOptim-CLI and choose not to run JPEGmini.\n\n#### The WebP image format looks promising, can you get ImageOptim-CLI to convert images to it?\n\nWebP looks great and may well overtake the formats handled by ImageOptim-CLI, but converting images to WebP is outside ImageOptim-CLI's chosen remit.\n\n#### Can you get ImageOptim-CLI to skip images it has already processed, if they haven't changed?\n\nJPEGmini does this today, but for ImageOptim and ImageAlpha I feel a feature like this belongs in those applications rather than this automator.\n\n### ImageOptim\n\n#### ImageOptim makes the fans on my Mac run at full power.\n\nOptimising images is a pretty intensive process, so instead of optimising one image at a time (which would take forever) — ImageOptim optimises many images at the same time until all of them are done.\n\nA side effect of this is that the fans come on at full power to keep your machine cool while it's maxed out.\n\n### ImageAlpha\n\n#### I don't think ImageAlpha is running, I can't see anything.\n\nImageOptim-CLI uses ImageAlpha's internal installation of [pngquant](http://pngquant.org) so it's normal that nothing is shown on screen.\n\nIt's also possible that if you look in the [Activity Monitor](http://support.apple.com/kb/HT5890) you will not see `pngquant` displayed but it _is_ being run. In my experience it's only when you run ImageOptim-CLI on a very large number of PNGs that you have enough time to spot it. ensure that Activity Monitor's **Update Frequency** is set to **Very Often (1 sec)**.\n\n### JPEGmini\n\n#### Can I use ImageOptim-CLI with JPEGmini Lite, the free version of JPEGmini?\n\nYes.\n\n#### I upgraded from JPEGmini Lite to JPEGmini but ImageOptim-CLI still says JPEGmini is not installed.\n\nPerforming the in-app upgrade leaves the app named as jpegmini-lite, so ImageOptim-CLI can't determine whether it's the free or full version. It is better to instead buy [the full version of JPEGmini](https://itunes.apple.com/us/app/jpegmini/id498944723) separately.\n\n#### ImageOptim-CLI says “To automate JPEGmini we need to enable GUI Scripting”, how do I do that?\n\nSee this tutorial on [how to manage Accessibility preferences and GUI Scripting](http://www.macosautomation.com/mavericks/guiscripting/index.html). In the case of OS X Mavericks, you will want to add the Applications JPEGmini and Terminal (or equivalent such as iTerm).\n\n### Windows and Linux\n\n#### Can I use ImageOptim-CLI on Windows or Linux?\n\nImageOptim-CLI is responsible for automating 3 OS X applications so is inherently bound to OS X for that reason.\n\n#### Are there any plans for ImageOptim-CLI to support Windows or Linux?\n\nIt would first require ImageOptim, ImageAlpha, and JPEGmini to be available for those platforms.\n\n#### I don't have OS X, can you recommend an alternative to ImageOptim-CLI?\n\n[@addyosmani](https://github.com/addyosmani) wrote a really thorough article on [tools for image optimization](http://addyosmani.com/blog/image-optimization-tools/) which discusses a wide range of options in great detail.\n\n## ⚙️ Contributing\n\nHave an idea? Found a bug? Please see the [Contributing Guide](/CONTRIBUTING.md) for information on how to install the project and start writing code.\n\n## 🙋🏿‍♀️ Getting Help\n\nGet help with issues by creating a [Bug Report] or discuss ideas by opening a [Feature Request].\n\n[bug report]: https://github.com/JamieMason/ImageOptim-CLI/issues/new?template=bug_report.md\n\n[feature request]: https://github.com/JamieMason/ImageOptim-CLI/issues/new?template=feature_request.md\n\n## 👀 Other Projects\n\nIf you find my Open Source projects useful, please share them ❤️\n\n-   [**eslint-formatter-git-log**](https://github.com/JamieMason/eslint-formatter-git-log)\u003cbr\u003eESLint Formatter featuring Git Author, Date, and Hash\n-   [**eslint-plugin-move-files**](https://github.com/JamieMason/eslint-plugin-move-files)\u003cbr\u003eMove and rename files while keeping imports up to date\n-   [**eslint-plugin-prefer-arrow-functions**](https://github.com/JamieMason/eslint-plugin-prefer-arrow-functions)\u003cbr\u003eConvert functions to arrow functions\n-   [**Jasmine-Matchers**](https://github.com/JamieMason/Jasmine-Matchers)\u003cbr\u003eWrite Beautiful Specs with Custom Matchers\n-   [**karma-benchmark**](https://github.com/JamieMason/karma-benchmark)\u003cbr\u003eRun Benchmark.js over multiple Browsers, with CI compatible output\n-   [**self-help**](https://github.com/JamieMason/self-help#readme)\u003cbr\u003eInteractive Q\u0026A Guides for Web and the Command Line\n-   [**syncpack**](https://github.com/JamieMason/syncpack#readme)\u003cbr\u003eManage multiple package.json files, such as in Lerna Monorepos and Yarn Workspaces\n\n## 🤓 Author\n\n\u003cimg src=\"https://www.gravatar.com/avatar/acdf106ce071806278438d8c354adec8?s=100\" align=\"left\"\u003e\n\nI'm [Jamie Mason] from [Leeds] in England, I began Web Design and Development in 1999 and have been Contracting and offering Consultancy as Fold Left Ltd since 2012. Who I've worked with includes [Sky Sports], [Sky Bet], [Sky Poker], The [Premier League], [William Hill], [Shell], [Betfair], and Football Clubs including [Leeds United], [Spurs], [West Ham], [Arsenal], and more.\n\n\u003cdiv align=\"center\"\u003e\n\n[![Follow JamieMason on GitHub][github badge]][github]      [![Follow fold_left on Twitter][twitter badge]][twitter]\n\n\u003c/div\u003e\n\n\u003c!-- images --\u003e\n\n[github badge]: https://img.shields.io/github/followers/JamieMason.svg?style=social\u0026label=Follow\n\n[twitter badge]: https://img.shields.io/twitter/follow/fold_left.svg?style=social\u0026label=Follow\n\n\u003c!-- links --\u003e\n\n[arsenal]: https://www.arsenal.com\n\n[betfair]: https://www.betfair.com\n\n[github]: https://github.com/JamieMason\n\n[jamie mason]: https://www.linkedin.com/in/jamiemasonleeds\n\n[leeds united]: https://www.leedsunited.com/\n\n[leeds]: https://www.instagram.com/visitleeds\n\n[premier league]: https://www.premierleague.com\n\n[shell]: https://www.shell.com\n\n[sky bet]: https://www.skybet.com\n\n[sky poker]: https://www.skypoker.com\n\n[sky sports]: https://www.skysports.com\n\n[spurs]: https://www.tottenhamhotspur.com\n\n[twitter]: https://twitter.com/fold_left\n\n[west ham]: https://www.whufc.com\n\n[william hill]: https://www.williamhill.com\n","funding_links":["https://github.com/sponsors/JamieMason"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiemason%2Fimageoptim-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiemason%2Fimageoptim-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiemason%2Fimageoptim-cli/lists"}