{"id":47424874,"url":"https://github.com/HalfstarDev/defold-webp","last_synced_at":"2026-04-05T03:01:11.046Z","repository":{"id":343600777,"uuid":"1178357670","full_name":"HalfstarDev/defold-webp","owner":"HalfstarDev","description":"Defold native extension for WebP images","archived":false,"fork":false,"pushed_at":"2026-03-11T15:31:11.000Z","size":8762,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-26T19:34:32.755Z","etag":null,"topics":["defold","defold-library","defold-native-extension","webp"],"latest_commit_sha":null,"homepage":"","language":"C","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/HalfstarDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"HalfstarDev","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2026-03-11T00:20:29.000Z","updated_at":"2026-03-12T11:32:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/HalfstarDev/defold-webp","commit_stats":null,"previous_names":["halfstardev/defold-webp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/HalfstarDev/defold-webp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HalfstarDev%2Fdefold-webp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HalfstarDev%2Fdefold-webp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HalfstarDev%2Fdefold-webp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HalfstarDev%2Fdefold-webp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HalfstarDev","download_url":"https://codeload.github.com/HalfstarDev/defold-webp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HalfstarDev%2Fdefold-webp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31422898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T02:22:46.605Z","status":"ssl_error","status_checked_at":"2026-04-05T02:22:33.263Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["defold","defold-library","defold-native-extension","webp"],"created_at":"2026-03-21T23:00:23.426Z","updated_at":"2026-04-05T03:01:11.016Z","avatar_url":"https://github.com/HalfstarDev.png","language":"C","funding_links":["https://github.com/sponsors/HalfstarDev"],"categories":["Libraries"],"sub_categories":["Programming Language"],"readme":"![banner](/docs/images/banner.webp)\n# Defold-WebP\n\nA Defold extension for using WebP images. Uses [libwebp-1.6.0](https://github.com/webmproject/libwebp).\n\n## Installation\n\nThis asset can be added as a [library dependency](https://defold.com/manuals/libraries/#setting-up-library-dependencies) in your project:\n\n* Use a specific version for development and release to avoid breaking changes: https://github.com/HalfstarDev/defold-webp/archive/refs/tags/1.0.0.zip\n* Use the latest version only while evaluating and testing the asset: https://github.com/HalfstarDev/defold-webp/archive/master.zip\n\nFor Android, the minimum SDK version is 21.\n\n## Usage\n\n#### webp.decode(image [, options])\n\nDecode a WebP image into an image buffer. Use optional Lua table with [WebPDecoderOptions](https://developers.google.com/speed/webp/docs/api#advanced_decoding_api) as keys. Returns buffer, width, and height.\n\n```lua\nlocal buf, w, h = webp.decode(sys.load_resource(\"/assets/image_1.webp\"))\nresource.set_texture(go.get(\"#sprite\", \"texture0\"), {\n    width        = w,\n    height       = h,\n    type         = resource.TEXTURE_TYPE_2D,\n    format       = resource.TEXTURE_FORMAT_RGBA,\n    num_mip_maps = 1\n}, buf)\n```\n\n#### webp.encode(buffer, width, height [, options])\n\nEncode a image buffer into a WebP image. Use optional Lua table with [WebPConfig](https://developers.google.com/speed/webp/docs/api#advanced_encoding_api) fields as keys. Returns string with WebP image.\n\n```lua\nlocal buf, w, h = webp.decode(image)\nlocal webp_image = webp.encode(buf, w, h, {quality = 50})\nlocal f = io.open(\"out.webp\", \"wb\")\nif f then\n    f:write(webp_image)\n    f:close()\nend\n```\n\n#### webp.get_info(image)\n\nGet information about a WebP image. Returns table with following fields: width, height, has_alpha, has_animation, lossy.\n```lua\nlocal info = webp.get_info(image)\nprint(info.width, info.height)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHalfstarDev%2Fdefold-webp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHalfstarDev%2Fdefold-webp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHalfstarDev%2Fdefold-webp/lists"}