{"id":15412890,"url":"https://github.com/ascorbic/get-pixels","last_synced_at":"2025-04-19T03:20:05.597Z","repository":{"id":92642534,"uuid":"595016284","full_name":"ascorbic/get-pixels","owner":"ascorbic","description":"🌈 🦕 Get the decoded pixel data from a JPG or PNG image","archived":false,"fork":false,"pushed_at":"2024-02-18T21:39:18.000Z","size":31,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-19T22:35:34.741Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ascorbic.png","metadata":{"files":{"readme":"README-npm.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2023-01-30T08:09:47.000Z","updated_at":"2024-03-05T23:48:46.000Z","dependencies_parsed_at":"2023-04-28T04:24:52.275Z","dependency_job_id":"8e7ef562-bdbc-4cbc-a0a2-57038f823b40","html_url":"https://github.com/ascorbic/get-pixels","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascorbic%2Fget-pixels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascorbic%2Fget-pixels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascorbic%2Fget-pixels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ascorbic%2Fget-pixels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ascorbic","download_url":"https://codeload.github.com/ascorbic/get-pixels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223696445,"owners_count":17187628,"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-01T16:54:45.275Z","updated_at":"2024-11-08T14:03:48.578Z","avatar_url":"https://github.com/ascorbic.png","language":"TypeScript","readme":"# 🌈 `@unpic/pixels`\n\n**Load and decode the pixels for a PNG or JPEG image in Node**\n\nThis module will take the raw data or URL of a PNG or JPEG image and return the\ndecoded pixels and dimensions of the image.\n\n## Usage\n\n```ts\nimport { getPixels } from \"@unpic/pixels\";\n\n// From a URL\nconst { width, height, data } = await getPixels(\n\t\"https://placecats.com/100/100\",\n);\n\n// From a file\n\nconst file = await fs.readFile(\"kitten.png\");\n\nconst { width, height, data } = await getPixels(file);\n```\n\nThere is also a `getFormat` function that will return the format of the image\ndata. This is detected by the first magic bytes at the start of the data.\n\n```ts\nimport { getFormat } from \"@unpic/pixels\";\n\nconst file = await fs.readFile(\"kitten.png\");\nconst format = getFormat(file);\n// format === \"png\"\n```\n\n## License\n\n© 2023-2024 [Matt Kane](https://github.com/ascorbic). This project is MIT\nlicensed.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascorbic%2Fget-pixels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fascorbic%2Fget-pixels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascorbic%2Fget-pixels/lists"}