{"id":20710433,"url":"https://github.com/mobiletelesystems/image-optimize","last_synced_at":"2025-04-09T16:17:54.215Z","repository":{"id":39715414,"uuid":"436867641","full_name":"MobileTeleSystems/image-optimize","owner":"MobileTeleSystems","description":"Image optimization microservice for web request.","archived":false,"fork":false,"pushed_at":"2025-02-28T00:49:08.000Z","size":1685,"stargazers_count":72,"open_issues_count":4,"forks_count":9,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-09T16:17:50.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/MobileTeleSystems.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2021-12-10T05:57:53.000Z","updated_at":"2025-04-04T23:01:12.000Z","dependencies_parsed_at":"2023-12-02T19:31:40.711Z","dependency_job_id":"83a68250-2bb1-44dc-9b08-24b8d9181c7e","html_url":"https://github.com/MobileTeleSystems/image-optimize","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":"0.018867924528301883","last_synced_commit":"979f3d9c4a22d9d9cc86d841e97c410400a2dfd7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fimage-optimize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fimage-optimize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fimage-optimize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobileTeleSystems%2Fimage-optimize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MobileTeleSystems","download_url":"https://codeload.github.com/MobileTeleSystems/image-optimize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065282,"owners_count":21041872,"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":[],"created_at":"2024-11-17T02:11:57.685Z","updated_at":"2025-04-09T16:17:54.182Z","avatar_url":"https://github.com/MobileTeleSystems.png","language":"TypeScript","readme":"# Microservice for responsive resize, compression and optimization of images on the fly for web pages\n\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/042786e7f0304d1ea29d83f8c1522a55)](https://www.codacy.com/gh/MobileTeleSystems/image-optimize/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=MobileTeleSystems/image-optimize\u0026amp;utm_campaign=Badge_Grade)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n[![GitHub license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/MobileTeleSystems/image-optimize/blob/main/LICENSE)\n\nOptimizing images helps reduce image weight and increases website loading speed,\nwhich is very important for both users and search engines. For these purposes,\nwe have created a microservice that perfectly copes with this task.\n\nFeatures:\n    - Resize images for the user's screen size,\n    - Image compressions to reduce traffic,\n    - Converting images to modern formats such as webp and avif,\n    - Works with dynamically content, compression occurs on the fly,\n    - High compression speed, an average picture is processed in just 200 ms,\n    - Includes exporter of metrics for Prometheus,\n    - Supports basic authorization for multiple domains and endpoints,\n    - Supports security restrictions for allowed addresses.\n\n## Try\n\nTo try the microservice features, run the container with the command:\n\n```sh\ndocker run -it --rm -p 3000:3000 mtsrus/image-optimize\n```\n\nNow you can open the browser and check the work with the command:\n\n```sh\nhttp://localhost:3000/optimize?size=1060\u0026format=webp\u0026src=https://tb.mts.ru/static/landing/images-index2/banner/slider/partners.png\n```\n\nBy changing the src, size, format parameters,\nyou can choose the path to the image,\nthe final size and the image format.\n\n## Use\n\nTo start the microservice in production, use the command:\n\n```sh\ndocker run -d --restart always -p 3000:3000 mtsrus/image-optimize\n```\n\n## Container parameters\n\n- `-e PORT=3000` - the port on which the microservice will be launched, default 3000.\n- `-e ALLOW_SIZES=\"100,200,1024-1920\"` - an array of allowed sizes for the resulting images,\n    default 100-1920. Use specific values to prevent heavy loads on the server.\n\n- `-e ALLOW_SOURCES=\"https%3A%2F%2Ftb.mts.ru%2F\"` - url array of allowed addresses for image sources, default * (any).\n    Use comma as separator. It is recommended to apply encodeURIComponent to url.\n\n- `-e BASIC_AUTHS=\"https%3A%2F%2Ftb.mts.ru%2F\"` - an array of endpoints with basic authorization parameters, default empty.\n    Has format encodeURIComponent(\"url\"):encodeURIComponent(\"login\"):encodeURIComponent(\"password\"). Use comma as separator.\n\n- `-e SHARP_CONCURRENCY=0` - number of threads libvips' should create to process each image,\n    default 0 (will reset to the number of CPU cores).\n\n## Components for web\n\nTo optimize images in the browser, there is a component for React. You can find it\n[by following the link](https://github.com/MobileTeleSystems/image-optimize-react).\nThe component itself determines the most suitable image parameters and requests it from this microservice.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Fimage-optimize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobiletelesystems%2Fimage-optimize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobiletelesystems%2Fimage-optimize/lists"}