{"id":13816929,"url":"https://github.com/LinusU/cwasm-lodepng","last_synced_at":"2025-05-15T18:32:40.943Z","repository":{"id":57105090,"uuid":"152873313","full_name":"LinusU/cwasm-lodepng","owner":"LinusU","description":"PNG decoding for Node.js, using LodePNG compiled to WebAssembly","archived":false,"fork":false,"pushed_at":"2022-09-26T20:38:48.000Z","size":70,"stargazers_count":37,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T16:49:30.868Z","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":"2018-10-13T13:13:04.000Z","updated_at":"2023-04-30T14:39:01.000Z","dependencies_parsed_at":"2022-08-21T03:00:29.792Z","dependency_job_id":null,"html_url":"https://github.com/LinusU/cwasm-lodepng","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fcwasm-lodepng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fcwasm-lodepng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fcwasm-lodepng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fcwasm-lodepng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinusU","download_url":"https://codeload.github.com/LinusU/cwasm-lodepng/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254397956,"owners_count":22064588,"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-08-04T06:00:26.987Z","updated_at":"2025-05-15T18:32:40.487Z","avatar_url":"https://github.com/LinusU.png","language":"JavaScript","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# LodePNG\n\nPNG decoding/encoding for Node.js, using [LodePNG][LodePNG] compiled to [WebAssembly][WebAssembly].\n\n[LodePNG]: https://lodev.org/lodepng/\n[WebAssembly]: https://webassembly.org\n\n## Installation\n\n```sh\nnpm install --save @cwasm/lodepng\n```\n\n## Usage\n\n```js\nconst fs = require('fs')\nconst lodepng = require('@cwasm/lodepng')\n\nconst source = fs.readFileSync('image.png')\nconst image = lodepng.decode(source)\n\nconsole.log(image)\n// { width: 128,\n//   height: 128,\n//   data:\n//    Uint8ClampedArray [ ... ] }\n\nconst data = lodepng.encode(image)\n\nconsole.log(data)\n// Uint8Array [ 137, 80, 78, 71, ... ]\n```\n\n## API\n\n### `decode(source)`\n\n- `source` ([`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), required) - The PNG data\n- returns [`ImageData`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData) - Decoded width, height and pixel data\n\n### `encode(source)`\n\n- `source` (`ImageLike`, required) - The image data\n- returns [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) - Encoded data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLinusU%2Fcwasm-lodepng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLinusU%2Fcwasm-lodepng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLinusU%2Fcwasm-lodepng/lists"}