{"id":13574459,"url":"https://github.com/tarampampam/tinifier","last_synced_at":"2025-04-06T19:13:22.027Z","repository":{"id":38359890,"uuid":"213881983","full_name":"tarampampam/tinifier","owner":"tarampampam","description":"🐼 CLI tool for compressing images using the TinyPNG","archived":false,"fork":false,"pushed_at":"2025-03-11T16:59:46.000Z","size":43290,"stargazers_count":82,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T18:08:41.565Z","etag":null,"topics":["cli","docker","golang","tinify"],"latest_commit_sha":null,"homepage":"https://tinypng.com/third-party","language":"Go","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/tarampampam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-09T09:54:59.000Z","updated_at":"2025-03-25T13:50:33.000Z","dependencies_parsed_at":"2024-01-16T20:24:57.303Z","dependency_job_id":"cce635b6-5b5c-4d09-b479-2cc585825958","html_url":"https://github.com/tarampampam/tinifier","commit_stats":{"total_commits":180,"total_committers":8,"mean_commits":22.5,"dds":0.6222222222222222,"last_synced_commit":"8d913e7e99aff47c0426f1628bf151dd45b04ae8"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarampampam%2Ftinifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarampampam%2Ftinifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarampampam%2Ftinifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarampampam%2Ftinifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarampampam","download_url":"https://codeload.github.com/tarampampam/tinifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535520,"owners_count":20954576,"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":["cli","docker","golang","tinify"],"created_at":"2024-08-01T15:00:51.761Z","updated_at":"2025-04-06T19:13:21.994Z","avatar_url":"https://github.com/tarampampam.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tarampampam/tinifier#readme\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://socialify.git.ci/tarampampam/tinifier/image?description=1\u0026font=Raleway\u0026forks=1\u0026issues=1\u0026logo=https%3A%2F%2Ftinypng.com%2Fimages%2Fapng%2Fpanda-waving.png\u0026owner=1\u0026pulls=1\u0026pattern=Solid\u0026stargazers=1\u0026theme=Dark\"\u003e\n      \u003cimg align=\"center\" src=\"https://socialify.git.ci/tarampampam/tinifier/image?description=1\u0026font=Raleway\u0026forks=1\u0026issues=1\u0026logo=https%3A%2F%2Ftinypng.com%2Fimages%2Fapng%2Fpanda-waving.png\u0026owner=1\u0026pulls=1\u0026pattern=Solid\u0026stargazers=1\u0026theme=Light\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# Tinifier\n\n`tinifier` is a CLI tool for compressing images using the [TinyPNG](https://tinypng.com) API, with parallel\nprocessing to speed up the workflow.\n\n\u003e TinyPNG uses intelligent lossy compression techniques to reduce the file size of your WEBP, AVIF, JPEG, and\n\u003e PNG files. By selectively decreasing the number of colors in an image, fewer bytes are needed to store the\n\u003e data. The effect is nearly imperceptible, but it significantly reduces file size.\n\u003e\n\u003e Images uploaded to TinyPNG are automatically removed after a maximum of 48 hours, and only you are allowed\n\u003e to download them.\n\n![demo](art/demo.gif)\n\n## 🔥 Features list\n\n- Compress images in **parallel** (configurable number of threads)\n- Support for **multiple API keys** (automatically switches if a key exceeds its quota)\n- Automatic **retries** for failed operations\n- **Recursive search** for images in directories (configurable file extensions)\n- Skip files if the difference between the original and compressed file sizes is below a specified percentage\n- **Preserve the original file modification date/time** (including EXIF metadata), ensuring correct photo\n  ordering (e.g., from smartphones) after compression\n\n## 🧩 Installation\n\n### 📦 Debian/Ubuntu-based (.deb) systems\n\nExecute the following commands in order:\n\n```shell\n# setup the repository automatically\ncurl -1sLf https://dl.cloudsmith.io/public/tarampampam/tinifier/setup.deb.sh | sudo -E bash\n\n# install the package\nsudo apt install tinifier\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eUninstalling\u003c/summary\u003e\n\n```shell\nsudo apt remove tinifier\nrm /etc/apt/sources.list.d/tarampampam-tinifier.list\n```\n\n\u003c/details\u003e\n\n### 📦 RedHat (.rpm) systems\n\n```shell\n# setup the repository automatically\ncurl -1sLf https://dl.cloudsmith.io/public/tarampampam/tinifier/setup.rpm.sh | sudo -E bash\n\n# install the package\nsudo dnf install tinifier # RedHat, CentOS, etc.\nsudo yum install tinifier # Fedora, etc.\nsudo zypper install tinifier # OpenSUSE, etc.\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eUninstalling\u003c/summary\u003e\n\n```shell\n# RedHat, CentOS, Fedora, etc.\nsudo dnf remove tinifier\nrm /etc/yum.repos.d/tarampampam-tinifier.repo\nrm /etc/yum.repos.d/tarampampam-tinifier-source.repo\n\n# OpenSUSE, etc.\nsudo zypper remove tinifier\nzypper rr tarampampam-tinifier\nzypper rr tarampampam-tinifier-source\n```\n\n\u003c/details\u003e\n\n### 📦 Alpine Linux\n\n```shell\n# bash is required for the setup script\nsudo apk add --no-cache bash\n\n# setup the repository automatically\ncurl -1sLf https://dl.cloudsmith.io/public/tarampampam/tinifier/setup.alpine.sh | sudo -E bash\n\n# install the package\nsudo apk add tinifier\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eUninstalling\u003c/summary\u003e\n\n```shell\nsudo apk del tinifier\n$EDITOR /etc/apk/repositories # remove the line with the repository\n```\n\n\u003c/details\u003e\n\n### 📦 AUR (Arch Linux)\n\nThere are three packages available in the AUR:\n\n- Build from source: [tinifier](https://aur.archlinux.org/packages/tinifier)\n- Precompiled: [tinifier-bin](https://aur.archlinux.org/packages/tinifier-bin)\n\n```shell\npamac build tinifier\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eUninstalling\u003c/summary\u003e\n\n```shell\npacman -Rs tinifier\n```\n\n\u003c/details\u003e\n\n### 📦 Binary (Linux, macOS, Windows)\n\nDownload the latest binary for your architecture/OS from the [releases page][link_releases]. For example, to install\nthe latest version to the `/usr/local/bin` directory on an **amd64** system (e.g., Debian, Ubuntu), you can run:\n\n```shell\n# download and install the binary\ncurl -SsL \\\n  https://github.com/tarampampam/tinifier/releases/latest/download/tinifier-linux-amd64.gz | \\\n  gunzip -c | sudo tee /usr/local/bin/tinifier \u003e /dev/null\n\n# make the binary executable\nsudo chmod +x /usr/local/bin/tinifier\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eUninstalling\u003c/summary\u003e\n\n```shell\nsudo rm /usr/local/bin/tinifier\n```\n\n\u003c/details\u003e\n\n\u003e [!TIP]\n\u003e Each release includes binaries for **linux**, **darwin** (macOS) and **windows** (`amd64` and `arm64` architectures).\n\u003e You can download the binary for your system from the [releases page][link_releases] (section `Assets`). And - yes,\n\u003e all what you need is just download and run single binary file.\n\n[link_releases]:https://github.com/tarampampam/tinifier/releases\n\n### 📦 Docker image\n\nAlso, you can use the Docker image:\n\n| Registry                               | Image                          |\n|----------------------------------------|--------------------------------|\n| [GitHub Container Registry][link_ghcr] | `ghcr.io/tarampampam/tinifier` |\n| [Docker Hub][link_docker_hub] (mirror) | `tarampampam/tinifier`         |\n\n\u003e [!NOTE]\n\u003e It’s recommended to avoid using the `latest` tag, as **major** upgrades may include breaking changes.\n\u003e Instead, use specific tags in `:X.Y.Z` or only `:X` format for version consistency.\n\n[link_ghcr]:https://github.com/tarampampam/tinifier/pkgs/container/tinifier\n[link_docker_hub]:https://hub.docker.com/r/tarampampam/tinifier/\n\n## ⚙ Configuration\n\nYou can configure `tinifier` using a YAML file. Refer to [this example](tinifier.example.yml) for\navailable options.\n\nYou can specify the configuration file's location using the `--config-file` option. By default, however, the\ntool searches for the file in the user's configuration directory:\n\n- **Linux**: `~/.configs/tinifier.yml`\n- **Windows**: `%APPDATA%\\tinifier.yml`\n- **macOS**: `~/Library/Application Support/tinifier.yml`\n\n## 🚀 Use Cases (usage examples)\n\n\u003e [!IMPORTANT]\n\u003e A [TinyPNG](https://tinypng.com) API key is required. To obtain one:\n\u003e - Visit [tinypng.com/developers](https://tinypng.com/developers)\n\u003e - Fill out the form (enter your name and email address) and click \"Get your API key\"\n\u003e - Check your email and click the verification link\n\u003e - Activate your API key on the dashboard and save it\n\n\u003e [!TIP]\n\u003e If you need to process a large number of files and have a Gmail account, you can use the following\n\u003e trick - register multiple accounts on tinypng.com using aliases such as `your_mailbox+key1@gmail.com`,\n\u003e `your_mailbox+key2@gmail.com`, etc. This allows you to use a single mailbox to retrieve as many free API\n\u003e keys as needed.\n\n#### ☝ Compress a Single Image\n\n```shell\ntinifier -k 'YOUR-API-KEY-GOES-HERE' ./img.png\n```\n\n#### ☝ Compress All PNG Images in a Directory and Two Other Images\n\n```shell\ntinifier -k 'API-KEY-1,API-KEY-2' -e png ./images-directory ./img-1.png ./img-2.png\n```\n\n#### ☝ Compress JPG and PNG Images in a Directory (Recursively) Using 20 Threads\n\n```shell\ntinifier -k 'YOUR-API-KEY-GOES-HERE' --ext png,jpg --threads 20 -r ./some-dir\n```\n\n\u003c!--GENERATED:APP_README--\u003e\n## 💻 Command line interface\n\n```\nDescription:\n   CLI tool for compressing images using the TinyPNG.\n\nUsage:\n   tinifier [\u003coptions\u003e] [\u003cfiles-or-directories\u003e]\n\nVersion:\n   0.0.0@undefined\n\nOptions:\n   --config-file=\"…\", -c=\"…\"    Path to the configuration file (default: depends/on/your-os/tinifier.yml) [$CONFIG_FILE]\n   --api-key=\"…\", -k=\"…\"        TinyPNG API keys \u003chttps://tinypng.com/dashboard/api\u003e (separated by commas) [$API_KEYS]\n   --ext=\"…\", -e=\"…\"            Extensions of files to compress (separated by commas) (default: png,jpeg,jpg,webp,avif) [$FILE_EXTENSIONS]\n   --threads=\"…\", -t=\"…\"        Number of threads to use for compressing (default: 16) [$THREADS]\n   --max-errors=\"…\"             Maximum number of errors to stop the process (set 0 to disable) (default: 10) [$MAX_ERRORS]\n   --retry-attempts=\"…\"         Number of retry attempts for upload/download/replace operations (default: 3) [$RETRY_ATTEMPTS]\n   --delay-between-retries=\"…\"  Delay between retry attempts (default: 1s) [$DELAY_BETWEEN_RETRIES]\n   --recursive, -r              Search for files in listed directories recursively [$RECURSIVE]\n   --skip-if-diff-less=\"…\"      Skip files if the diff between the original and compressed file sizes \u003c N% (default: 1) [$SKIP_IF_DIFF_LESS]\n   --preserve-time, -p          Preserve the original file modification date/time (including EXIF) [$PRESERVE_TIME]\n   --help, -h                   Show help\n   --version, -v                Print the version\n```\n\u003c!--/GENERATED:APP_README--\u003e\n\n## 📜 License\n\nThis is open-sourced software licensed under the [MIT License][link_license].\n\n[link_license]:https://github.com/tarampampam/tinifier/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarampampam%2Ftinifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarampampam%2Ftinifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarampampam%2Ftinifier/lists"}