{"id":23592627,"url":"https://github.com/filipnet/optimize-images","last_synced_at":"2026-04-26T22:31:15.629Z","repository":{"id":134496139,"uuid":"320376938","full_name":"filipnet/optimize-images","owner":"filipnet","description":"Optimize and Compress JPEG or PNG Images in Linux Command line","archived":false,"fork":false,"pushed_at":"2021-09-24T18:06:57.000Z","size":40,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T12:13:30.892Z","etag":null,"topics":["compression","image","jpeg","jpeg-image-compression","jpegoptim","jpg","linux","optimization","optipng","png","png-compression"],"latest_commit_sha":null,"homepage":"https://www.filipnet.de","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/filipnet.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-10T20:01:49.000Z","updated_at":"2023-04-06T17:50:27.000Z","dependencies_parsed_at":"2023-06-16T12:15:40.844Z","dependency_job_id":null,"html_url":"https://github.com/filipnet/optimize-images","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/filipnet/optimize-images","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Foptimize-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Foptimize-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Foptimize-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Foptimize-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filipnet","download_url":"https://codeload.github.com/filipnet/optimize-images/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipnet%2Foptimize-images/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32315711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T21:09:39.134Z","status":"ssl_error","status_checked_at":"2026-04-26T21:09:21.240Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["compression","image","jpeg","jpeg-image-compression","jpegoptim","jpg","linux","optimization","optipng","png","png-compression"],"created_at":"2024-12-27T08:14:56.528Z","updated_at":"2026-04-26T22:31:15.606Z","avatar_url":"https://github.com/filipnet.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# optimize-images\nOptimize and compress JPEG or PNG images in Linux command line\n\n\u003e **⚠ WARNING, IMPORTANT NOTICE BEFORE USE**  \n\u003e Before running any of this script, please make sure you have a valid backup, cause the script will replaces the original file, so you no longer have the original.\n\n\u003c!-- TOC --\u003e\n\n- [optimize-images](#optimize-images)\n    - [FEATURES](#features)\n    - [INSTALL PREREQUISITES](#install-prerequisites)\n    - [INSTALL SCRIPT](#install-script)\n    - [SETUP A TEST ENVIRONMENT](#setup-a-test-environment)\n    - [USAGE](#usage)\n    - [WORDPRESS EXAMPLE](#wordpress-example)\n    - [ADD TO CRONTAB](#add-to-crontab)\n    - [LICENSE](#license)\n\n\u003c!-- /TOC --\u003e\n\n## FEATURES\nYou have a lot of images and would like to optimize and compress the images without losing its original quality?\n\nThis script solution can be used:\n- before uploading images to any cloud storages or content management system \n- to optimize and compress images, that are already uploaded and active on a webserver\n\nI use WordPress and love it, but the Image Optimization Plugins are not free, limited or buggy. If you have root access to your webserver, this script will help you to optimize the images. The following command line utilities to optimize images are used:\n\n- jpegoptim – is a utility to optimize/compress JPEG files without loosing quality\n- OptiPNG – is a small program that optimize PNG images to smaller size without losing any information\n\nPlease note that OptiPNG evaluates and processes the PNG image file individually on each call and acts much slower here than is the case with JPG files.\n\n## INSTALL PREREQUISITES\nOn Debian and it’s derivatives\n```\nsudo apt-get install jpegoptim\nsudo apt-get install optipng\n```\nOn RedHat based systems\n```\nyum install epel-release\nyum install jpegoptim\nyum install optipng\n```\n\n## INSTALL SCRIPT\n```\ncd /root; git clone https://github.com/filipnet/optimize-images.git\n```\n\n## SETUP A TEST ENVIRONMENT\nIt allows you to download a World Wide Web site from the Internet to a local directory, building recursively all directories, getting HTML, images, and other files from the server to your computer. HTTrack arranges the original site's relative link-structure. Simply open a page of the \"mirrored\" website in your browser, and you can browse the site from link to link, as if you were viewing it online. HTTrack can also update an existing mirrored site, and resume interrupted downloads. HTTrack is fully configurable, and has an integrated help system. (Source: https://www.httrack.com/)\n```\n# Install httrack\nyum install httrack | apt install httrack\n# Clone productive website to any working folder\nhttrack https://www.filipnet.de -O /var/www/html/\n```\n\u003cimg src=\"images/httrack_run.png\" alt=\"HTTrack Website Copier - Run\" width=\"1000\"/\u003e\n\nAfterwards you should see the HTTrack Index as followed after browsing your webserver\n\n\u003cimg src=\"images/httrack_index.png\" alt=\"HTTrack Website Copier - Run\" width=\"1000\"/\u003e\n\n## USAGE\nOptimization images newer 24 hours for cronjob batch processing (this is the default setting)\n```\noptimize-images.sh /path/to/image-directory/\n```\nForce optimization for all images inside given folder (for initial image optimization)\n```\noptimize-images.sh /path/to/image-directory/ -force\n```\n\n## WORDPRESS EXAMPLE\nDetermine the image directory size before image optimization:\n```\ndu -s /var/www/html/www.filipnet.de/wp-content/uploads/\n7276    /var/www/html/www.filipnet.de/wp-content/uploads/\n```\nPerforming image optimization with the -force parameter to include all images:\n```\n.\\optimize-images.sh /var/www/html/www.filipnet.de/wp-content/uploads -force \n```\nDetermine the image directory size after image optimization:\n```\ndu -s /var/www/html/www.filipnet.de/wp-content/uploads/\n5452    /var/www/html/www.filipnet.de/wp-content/uploads/\n```\nAs you can see, the total size has been reduced from 7276 kb to 5452 kb, visually there are no noticeable changes to the image files in the browser.\n\n``As a result, a total of 33.46% of storage space was saved in this test.``\n\n## ADD TO CRONTAB\nAdd that to your crontab and you never have to think about it again.\n```\n$ crontab -l\n@daily root /root/optimize-images/optimize-images.sh /path/to/image-directory/ \u003e/dev/null 2\u003e\u00261\n```\n\n## LICENSE\noptimize-images and all individual scripts are under the BSD 3-Clause license unless explicitly noted otherwise. Please refer to the LICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipnet%2Foptimize-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilipnet%2Foptimize-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipnet%2Foptimize-images/lists"}