{"id":16125604,"url":"https://github.com/semibran/image-clip","last_synced_at":"2025-04-06T13:12:48.296Z","repository":{"id":130492043,"uuid":"83233232","full_name":"semibran/image-clip","owner":"semibran","description":"Clip out transparent pixels from an image","archived":false,"fork":false,"pushed_at":"2017-02-28T05:10:10.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T18:59:23.107Z","etag":null,"topics":["clip","crop","image"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/semibran.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-26T19:07:20.000Z","updated_at":"2017-03-12T04:29:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a5a74f3-c9b6-46ba-bdf3-ea519a0fadae","html_url":"https://github.com/semibran/image-clip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semibran%2Fimage-clip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semibran%2Fimage-clip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semibran%2Fimage-clip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semibran%2Fimage-clip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semibran","download_url":"https://codeload.github.com/semibran/image-clip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485291,"owners_count":20946398,"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":["clip","crop","image"],"created_at":"2024-10-09T21:30:09.815Z","updated_at":"2025-04-06T13:12:48.270Z","avatar_url":"https://github.com/semibran.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-clip\n\u003e Clip out transparent pixels from an image\n\nConverts an image or canvas like this:\n\n![Before clip](before.png)\n\nto a canvas with the edges clipped off:\n\n![After clip](after.png)\n\n## Installation\n```sh\nnpm install semibran/image-clip\n```\n\n## Usage\n```javascript\nconst clip = require('image-clip')\n```\n\n### `clip`\n```javascript\nclip(image, rect*) // =\u003e HTMLCanvasElement\n```\n\nGet the clipped version of an `Image` or `HTMLCanvasElement`. If `rect` is not provided, `clip.bounds` will be used instead.\n\n### `bounds`\n```javascript\nclip.bounds(image) // =\u003e Rect\n```\n\nGet the relative bounding box of a prospective clipped image in the form `{ x, y, width, height }`. See [`semibran/rect`](https://github.com/semibran/rect) for more details.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemibran%2Fimage-clip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemibran%2Fimage-clip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemibran%2Fimage-clip/lists"}