{"id":21948730,"url":"https://github.com/nemtsov/tiny-canvas-image-scaler","last_synced_at":"2026-04-28T21:04:29.054Z","repository":{"id":138545275,"uuid":"82966414","full_name":"nemtsov/tiny-canvas-image-scaler","owner":"nemtsov","description":"Canvas-based image-scaling utility.","archived":false,"fork":false,"pushed_at":"2019-03-13T12:22:10.000Z","size":10,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-04-25T04:02:36.107Z","etag":null,"topics":["canvas","image","javascript","scaling"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nemtsov.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":"2017-02-23T20:04:46.000Z","updated_at":"2021-09-09T08:36:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"30f1c247-1337-43e9-a102-d744e478ba66","html_url":"https://github.com/nemtsov/tiny-canvas-image-scaler","commit_stats":null,"previous_names":["behance/tiny-canvas-image-scaler"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Ftiny-canvas-image-scaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Ftiny-canvas-image-scaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Ftiny-canvas-image-scaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemtsov%2Ftiny-canvas-image-scaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemtsov","download_url":"https://codeload.github.com/nemtsov/tiny-canvas-image-scaler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244991195,"owners_count":20543627,"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":["canvas","image","javascript","scaling"],"created_at":"2024-11-29T05:17:30.449Z","updated_at":"2026-04-28T21:04:24.028Z","avatar_url":"https://github.com/nemtsov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tiny Canvas Image Scaler [![Build Status](https://img.shields.io/travis/behance/tiny-canvas-image-scaler.svg)](http://travis-ci.org/behance/tiny-canvas-image-scaler) [![NPM version](https://img.shields.io/npm/v/tiny-canvas-image-scaler.svg)](https://www.npmjs.com/package/tiny-canvas-image-scaler)\n\nThe purpose of this library is to be the smallest canvas-based image-scaling utility.\n\n## Usage\n\n```js\nvar imageScaler = require('tiny-canvas-image-scaler')\nvar options = {\n  maxWidth: 300\n};\n\nimageScaler.getScaledUrl(imageUrl, options).then((scaledUrl) =\u003e {\n  const image = document.getElementById('my_image');\n  image.src = scaledUrl;\n});\n```\n\n```js\nvar imageScaler = require('tiny-canvas-image-scaler')\nvar options = {\n  maxWidth: 200\n};\n\nimageScaler.getScaledCanvas(imageUrl, options).then((canvas) =\u003e {\n  const container = document.getElementById('container');\n  container.appendChild(canvas);\n});\n```\n\n#### Options:\n\n  - `width` - to scale to (height will adjust proportionally)\n  - `canvas` - canvas DOM node that will be used to perform the scaling (one will be created, if not provided)\n  - `imageSmoothingEnabled` - property of the canvas context\n  - `imageSmoothingQuality` - property of the canvas context\n  - `imageFormat` - String, `.toDataURL(imageFormat)`, defaults to `image/png`\n  - `imageQuality` - Number, `.toDataURL(imageFormat, imageQuality)`, defaults to `0.92`\n\n\n## Browser Support\n\nAll evergreen browsers plus IE11.\n\n\n## License\n\n[Apache-2.0](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemtsov%2Ftiny-canvas-image-scaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemtsov%2Ftiny-canvas-image-scaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemtsov%2Ftiny-canvas-image-scaler/lists"}