{"id":15693563,"url":"https://github.com/qnighy/libwebp-rs","last_synced_at":"2025-05-07T23:40:21.437Z","repository":{"id":52442692,"uuid":"138021678","full_name":"qnighy/libwebp-rs","owner":"qnighy","description":"Rust binding to libwebp","archived":false,"fork":false,"pushed_at":"2025-04-17T18:47:55.000Z","size":2831,"stargazers_count":7,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T04:34:09.981Z","etag":null,"topics":["libwebp","rust","webp"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/qnighy.png","metadata":{"files":{"readme":"README.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,"zenodo":null}},"created_at":"2018-06-20T11:11:01.000Z","updated_at":"2024-02-06T08:04:51.000Z","dependencies_parsed_at":"2025-04-21T09:49:05.544Z","dependency_job_id":null,"html_url":"https://github.com/qnighy/libwebp-rs","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/qnighy%2Flibwebp-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Flibwebp-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Flibwebp-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Flibwebp-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qnighy","download_url":"https://codeload.github.com/qnighy/libwebp-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973616,"owners_count":21834105,"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":["libwebp","rust","webp"],"created_at":"2024-10-03T18:45:46.698Z","updated_at":"2025-05-07T23:40:21.401Z","avatar_url":"https://github.com/qnighy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libwebp\n\nThis is a binding to [the libwebp library](https://developers.google.com/speed/webp/download).\n\n## Usage\n\n### Preparation\n\n```toml\n# Cargo.toml\n\n[dependencies]\nlibwebp = { version = \"0.1.2\", features = [\"0_6\"] }\n```\n\n### Simple decoding\n\n```rust\nuse libwebp::WebPDecodeRGBA;\n\nlet data: \u0026[u8];\n\nlet (width, height, buf) = WebPDecodeRGBA(data).unwrap();\neprintln!(\"width = {}, height = {}\", width, height);\neprintln!(\n    \"top-left pixel: rgba({}, {}, {}, {})\",\n    buf[0],\n    buf[1],\n    buf[2],\n    buf[3] as f64 / 255.0,\n)\n```\n\n### Simple encoding\n\n```rust\nuse libwebp::WebPEncodeRGBA;\n\nlet buf: \u0026[u8] = \u0026[\n    255, 255, 255, 255, // white\n    255, 0, 0, 255, // red\n    0, 255, 0, 255, // green\n    0, 0, 255, 255, // blue\n];\nlet data = WebPEncodeRGBA(buf, 2, 2, 8, 75.0).unwrap();\nlet lossless_data = WebPEncodeLosslessRGBA(buf, 2, 2, 8).unwrap();\n```\n\n## Minimum Supported Rust Version (MSRV)\n\nRust 1.31.0\n\n## Features\n\n- `demux` ... enables `libwebpdemux` functions.\n- `mux` ... enables `libwebpmux` functions.\n- `0_5` ... enables functions introduced in libwebp 0.5.0.\n- `0_6` ... enables functions introduced in libwebp 0.6.0.\n- `1_1` ... enables functions introduced in libwebp 1.1.0.\n- `static` ... statically link against the bundled libwebp.\n- `extern-types` ... enables `#![feature(extern_types)]`.\n\n## Linking\n\nIf libwebp is found in the system, it links against the library.\nOtherwise it builds and links against the bundled libwebp.\n\nIn these cases, static link is preferred:\n\n- For musl target.\n- When cross-compiling.\n- `static` feature is turned on.\n- `LIBWEBP_SYS_STATIC` environment variable is set to `1` when building.\n\n## Related repositories\n\n- https://github.com/qnighy/libwebp-sys2-rs\n- https://github.com/qnighy/libwebp-image-rs\n\n## Completeness\n\n- `types.h`\n  - [ ] `WebPMalloc`\n  - [x] `WebPFree`\n- `decode.h`\n  - [x] `WebPGetDecoderVersion`\n  - [x] `WebPGetInfo`\n  - [x] `WebPDecode*`\n  - [x] `WebPDecodeYUV`\n  - [x] `WebPDecode*Into`\n  - [x] `WebPDecodeYUVInto`\n  - [x] `WEBP_CSP_MODE`\n  - [x] `WebPIsPremultipliedMode`\n  - [x] `WebPIsAlphaMode`\n  - [x] `WebPIsRGBMode`\n  - [ ] `WebPRGBABuffer`\n  - [ ] `WebPYUVABuffer`\n  - [ ] `WebPDecBuffer`\n  - [ ] `WebPInitDecBuffer`\n  - [ ] `WebPFreeDecBuffer`\n  - [x] `VP8StatusCode`\n  - [x] `WebPIDecoder` (internal memory)\n  - [ ] `WebPIDecoder` (external memory)\n  - [x] `WebPINewDecoder` (internal memory)\n  - [ ] `WebPINewDecoder` (external memory)\n  - [x] `WebPINewRGB` (internal memory)\n  - [ ] `WebPINewRGB` (external memory)\n  - [x] `WebPINewYUVA` (internal memory)\n  - [ ] `WebPINewYUVA` (external memory)\n  - [x] `WebPIDelete`\n  - [x] `WebPIAppend`\n  - [ ] `WebPIUpdate`\n  - [x] `WebPIDecGetRGB`\n  - [x] `WebPIDecGetYUVA`\n  - [ ] `WebPIDecodedArea`\n  - [ ] `WebPBitstreamFeatures`\n  - [ ] `WebPGetFeatures`\n  - [ ] `WebPDecoderOptions`\n  - [ ] `WebPDecoderConfig`\n  - [ ] `WebPInitDecoderConfig`\n  - [ ] `WebPIDecode`\n  - [ ] `WebPDecode`\n- `encode.h`\n  - [x] `WebPGetEncoderVersion`\n  - [x] `WebPEncode*`\n  - [x] `WebPEncodeLossless*`\n  - [ ] `WebPImageHint`\n  - [ ] `WebPConfig`\n  - [ ] `WebPPreset`\n  - [ ] `WebPConfigInit`\n  - [ ] `WebPConfigPreset`\n  - [ ] `WebPConfigLosslessPreset`\n  - [ ] `WebPValidateConfig`\n  - [ ] `WebPAuxStats`\n  - [ ] `WebPWriterFunction`\n  - [ ] `WebPMemoryWriter`\n  - [ ] `WebPMemoryWriterInit`\n  - [ ] `WebPMemoryWriterClear`\n  - [ ] `WebPMemoryWrite`\n  - [ ] `WebPProgressHook`\n  - [ ] `WebPEncCSP`\n  - [ ] `WebPEncodingError`\n  - [ ] `WEBP_MAX_DIMENSION`\n  - [ ] `WebPPicture`\n  - [ ] `WebPPictureInit`\n  - [ ] `WebPPictureAlloc`\n  - [ ] `WebPPictureFree`\n  - [ ] `WebPPictureCopy`\n  - [ ] `WebPPlaneDistortion`\n  - [ ] `WebPPictureDistortion`\n  - [ ] `WebPPictureCrop`\n  - [ ] `WebPPictureView`\n  - [ ] `WebPPictureIsView`\n  - [ ] `WebPPictureRescale`\n  - [ ] `WebPPictureImportRGB`\n  - [ ] `WebPPictureImportRGBA`\n  - [ ] `WebPPictureImportRGBX`\n  - [ ] `WebPPictureImportBGR`\n  - [ ] `WebPPictureImportBGRA`\n  - [ ] `WebPPictureImportBGRX`\n  - [ ] `WebPPictureARGBToYUVA`\n  - [ ] `WebPPictureARGBToYUVADithered`\n  - [ ] `WebPPictureSharpARGBToYUVA`\n  - [ ] `WebPPictureSmartARGBToYUVA`\n  - [ ] `WebPPictureYUVAToARGB`\n  - [ ] `WebPCleanupTransparentArea`\n  - [ ] `WebPPictureHasTransparency`\n  - [ ] `WebPBlendAlpha`\n  - [ ] `WebPEncode`\n- `mux_types.h`\n  - Not at all\n- `demux.h`\n  - Not at all\n- `mux.h`\n  - Not at all\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqnighy%2Flibwebp-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqnighy%2Flibwebp-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqnighy%2Flibwebp-rs/lists"}