{"id":16894566,"url":"https://github.com/freearhey/autocrop-js","last_synced_at":"2025-04-11T13:36:04.184Z","repository":{"id":65506791,"uuid":"580942409","full_name":"freearhey/autocrop-js","owner":"freearhey","description":"Node.js utility that crops the transparent background of an image.","archived":false,"fork":false,"pushed_at":"2023-01-13T09:43:51.000Z","size":1169,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T09:49:24.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/freearhey.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":"2022-12-21T21:12:10.000Z","updated_at":"2024-11-29T08:25:25.000Z","dependencies_parsed_at":"2023-02-09T15:31:06.517Z","dependency_job_id":null,"html_url":"https://github.com/freearhey/autocrop-js","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freearhey%2Fautocrop-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freearhey%2Fautocrop-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freearhey%2Fautocrop-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freearhey%2Fautocrop-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freearhey","download_url":"https://codeload.github.com/freearhey/autocrop-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248410137,"owners_count":21098772,"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-13T17:19:11.255Z","updated_at":"2025-04-11T13:36:04.142Z","avatar_url":"https://github.com/freearhey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# autocrop-js\n\n![Illustration of how autocrop-js works (Used image from https://pixabay.com/illustrations/ai-generated-generative-ai-fantasy-7700016/)](illustration.png)\n\nNode.js utility that crops the transparent background of an image.\n\n## Installation\n\n```bash\nnpm install autocrop-js\n```\n\n## Usage\n\n```js\nimport autocrop from 'autocrop-js'\n\nconst dataURL = 'data:image/png;base64,...'\n\nautocrop(dataURL, {\n  alphaThreshold: 10 // the lines and columns will be removed if the alpha channel is below the specified value (0-255). Default: 0\n}).then(result =\u003e {\n  console.log(result)\n})\n```\n\nOutput:\n\n```js\n{\n  bbox: { // bounding box of the cut image fragment\n    height: 188,\n    width: 232,\n    x: 26,\n    y: 0\n  },\n  dataURL: 'data:image/png;base64,iVB...' // Data URL of the cut image fragment\n}\n```\n\n## Testing\n\n```bash\nnpm test\n```\n\n## Linting\n\n```bash\nnpm run lint\n```\n\n## Contribution\n\nIf you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/freearhey/autocrop-js/issues) or a [pull request](https://github.com/freearhey/autocrop-js/pulls).\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreearhey%2Fautocrop-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreearhey%2Fautocrop-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreearhey%2Fautocrop-js/lists"}