{"id":50506442,"url":"https://github.com/mapi68/optimize-svg-png","last_synced_at":"2026-06-02T16:30:53.632Z","repository":{"id":360341801,"uuid":"1249742875","full_name":"mapi68/optimize-svg-png","owner":"mapi68","description":"Batch optimisers for SVG and PNG files on Debian / WSL2 (Windows Subsystem for Linux)","archived":false,"fork":false,"pushed_at":"2026-05-26T02:15:45.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-26T03:27:28.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/mapi68.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-26T02:11:09.000Z","updated_at":"2026-05-26T02:15:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mapi68/optimize-svg-png","commit_stats":null,"previous_names":["mapi68/optimize-svg-png"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mapi68/optimize-svg-png","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Foptimize-svg-png","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Foptimize-svg-png/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Foptimize-svg-png/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Foptimize-svg-png/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapi68","download_url":"https://codeload.github.com/mapi68/optimize-svg-png/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Foptimize-svg-png/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33831622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-02T16:30:52.842Z","updated_at":"2026-06-02T16:30:53.627Z","avatar_url":"https://github.com/mapi68.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# optimize-svg-png\n\nBatch optimisers for SVG and PNG files on Debian / WSL2 (Windows Subsystem for Linux).\n\n---\n\n## optimize-svg\n\nConverts text to path, inlines CSS styles and optimises all SVG files in a folder.\nInkscape runs in shell mode (single launch), Python and scour run in parallel on all CPU cores.\n\n### What it does\n\n- **Step 1 – Inkscape:** converts `\u003ctext\u003e` to `\u003cpath\u003e`, preserves original canvas (use `--trim` to fit canvas to drawing)\n- **Step 2 – Python:** inlines CSS `fill` values, removes `\u003cstyle\u003e` block\n- **Step 3 – scour:** cleans and compresses SVG (metadata, comments, IDs, precision, viewBox)\n\nOriginal files are backed up to `\u003cfolder\u003e_backup_svg` before any modification.\n\n### Requirements\n\nInkscape, Python 3 and scour — installed automatically if missing.\n\n### Installation\n\n```bash\nmkdir -p ~/.local/bin\ncp optimize_svg.bash ~/.local/bin/optimize_svg\nchmod +x ~/.local/bin/optimize_svg\n```\n\n### Usage\n\n```bash\noptimize_svg [--trim] \u003cfolder\u003e\n```\n\nFor full documentation see [README_SVG.md](README_SVG.md).\n\n---\n\n## optimize-png\n\nTrims excess uniform background and strips unnecessary embedded data from all PNG files in a folder.\nImageMagick runs in parallel on all available CPU cores.\n\n### What it does\n\n- **ImageMagick:** trims uniform background pixels with zero colour tolerance, removes ICC profiles, EXIF data and PNG metadata chunks\n\nOriginal files are backed up to `\u003cfolder\u003e_backup_png` before any modification.\n\n### Requirements\n\nImageMagick (`magick` command) — installed automatically if missing.\n\n### Installation\n\n```bash\nmkdir -p ~/.local/bin\ncp optimize_png.bash ~/.local/bin/optimize_png\nchmod +x ~/.local/bin/optimize_png\n```\n\n### Usage\n\n```bash\noptimize_png \u003cfolder\u003e\n```\n\nFor full documentation see [README_PNG.md](README_PNG.md).\n\n---\n\n## Common features\n\nBoth scripts share the same design principles:\n\n- process all files in a folder with a single command\n- run in parallel on all available CPU cores\n- create a backup of originals before making any change\n- stop safely if the backup folder already exists\n- print a per-file size report with total space saved at the end\n- install missing dependencies automatically via `apt`\n\n## Windows users (WSL2)\n\nBoth scripts run on Windows via **WSL2** with a Debian distribution.\n\n```powershell\nwsl --install -d Debian\n```\n\nWindows drives are accessible under `/mnt/`:\n\n```bash\noptimize_svg /mnt/c/Users/YourName/Desktop/svg\noptimize_png /mnt/c/Users/YourName/Desktop/png\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapi68%2Foptimize-svg-png","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapi68%2Foptimize-svg-png","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapi68%2Foptimize-svg-png/lists"}