{"id":15652827,"url":"https://github.com/linusu/resize-image-data","last_synced_at":"2025-04-30T17:08:46.008Z","repository":{"id":44760539,"uuid":"100619984","full_name":"LinusU/resize-image-data","owner":"LinusU","description":"Resize a decoded raw image","archived":false,"fork":false,"pushed_at":"2021-10-27T12:23:22.000Z","size":813,"stargazers_count":30,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T17:08:38.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LinusU.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-17T15:43:19.000Z","updated_at":"2024-07-13T13:37:13.000Z","dependencies_parsed_at":"2022-09-05T10:50:13.037Z","dependency_job_id":null,"html_url":"https://github.com/LinusU/resize-image-data","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fresize-image-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fresize-image-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fresize-image-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fresize-image-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinusU","download_url":"https://codeload.github.com/LinusU/resize-image-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748950,"owners_count":21637418,"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-10-03T12:44:00.840Z","updated_at":"2025-04-30T17:08:45.985Z","avatar_url":"https://github.com/LinusU.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Resize Image Data\n\nResize a decoded raw image.\n\n## Installation\n\n```sh\nnpm install --save resize-image-data\n```\n\n## Usage\n\n```js\nconst resizeImageData = require('resize-image-data')\n\nconst result = resizeImageData(image, 128, 128, 'bilinear-interpolation')\n\nconsole.log(result.width)\n//=\u003e 128\n\nconsole.log(result.height)\n//=\u003e 128\n\nconsole.log(result.data)\n//=\u003e Uint8ClampedArray [ ... ]\n```\n\n## API\n\n### `resizeImageData(image, width, height[, algorithm])`\n\nResize the image to the supplied width and height, using the specified algorithm.\n\nThe `image` argument should be a `ImageData` instance, or any object with the following properties:\n\n- `width: Number` - The width of the image, in pixels\n- `height: Number` - The height of the image, in pixels\n- `data: Buffer | TypedArray | Array` - The image data, stored as raw pixel data in the RGBA order\n\nThe following algorithms is currently supported:\n\n- `nearest-neighbor`\n- `bilinear-interpolation`\n\nIf no algorithm is provided, it will currently default to `bilinear-interpolation`. This may however change in any subsequent release, so don't count on it being stable between even minor and patch releases. The goal is to provide the \"best\" experience when not supplying an algorithm, which could mean different default algorithms depending wether we are scaling up or down.\n\nReturns an `ImageData` instance.\n\n## Related\n\n- [`rotate-image-data`](https://github.com/LinusU/rotate-image-data) - Rotate a decoded raw image\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fresize-image-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinusu%2Fresize-image-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fresize-image-data/lists"}