{"id":21374045,"url":"https://github.com/ainame/Swift-WebP","last_synced_at":"2025-07-13T08:32:11.933Z","repository":{"id":50990508,"uuid":"71067482","full_name":"ainame/Swift-WebP","owner":"ainame","description":"A thin libwebp wrapper in Swift that provides both encode/decode APIs","archived":false,"fork":false,"pushed_at":"2024-07-14T19:27:48.000Z","size":2526,"stargazers_count":161,"open_issues_count":4,"forks_count":38,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-28T12:54:57.688Z","etag":null,"topics":["image-processing","libwebp","swift","swift-wrapper","webp"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/ainame.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2016-10-16T17:59:20.000Z","updated_at":"2024-09-21T13:43:34.000Z","dependencies_parsed_at":"2024-06-21T19:13:34.858Z","dependency_job_id":"07adbdb3-acc7-4356-9eaf-fb8d3c23bc5b","html_url":"https://github.com/ainame/Swift-WebP","commit_stats":{"total_commits":174,"total_committers":4,"mean_commits":43.5,"dds":"0.017241379310344862","last_synced_commit":"545f908e01d14973bfb6d4231521cdde407af748"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ainame%2FSwift-WebP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ainame%2FSwift-WebP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ainame%2FSwift-WebP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ainame%2FSwift-WebP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ainame","download_url":"https://codeload.github.com/ainame/Swift-WebP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225868601,"owners_count":17537083,"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":["image-processing","libwebp","swift","swift-wrapper","webp"],"created_at":"2024-11-22T08:29:39.452Z","updated_at":"2024-11-22T08:30:09.020Z","avatar_url":"https://github.com/ainame.png","language":"Swift","funding_links":[],"categories":["OOM-Leaks-Crash"],"sub_categories":["WebP"],"readme":"# Swift-WebP\n\nSwift-WebP provides libwebp APIs in Swift manner for both encoding and decoding. \n\n### Support Versions:\n\n* libwebp: v1.2.0\n* iOS Deployment Target: 13.0\n* macOS Deployment Target: 11.0\n\n#### Features\n\n* [x] Support mutiplatform; iOS, macOS, and Linux (swift-docker)\n* [x] Support SPM\n* [x] [Advanced Encoder API](https://developers.google.com/speed/webp/docs/api#advanced_encoding_api) - WebPEncoder, WebPEncoderConfig\n* [x] [Advanced Decoding API](https://developers.google.com/speed/webp/docs/api#advanced_decoding_api) - WebPDecoder, WebPDecoderOptions\n* [x] Image inspection for WebP files  - WebPImageInspector\n\n#### TODO\n\n* [ ] Progressively encoding/decoding option\n* [ ] Animated WebP\n\n\n## Usage\n\n#### Encoding\n\n```swift\nlet image = UIImage(named: \"demo\")\nlet encoder = WebPEncoder()\nlet queue =  DispatchQueue(label: \"me.ainam.webp\")\n\n// should encode in background\nqueue.async {\n    let data = try! encoder.encode(image, config: .preset(.picture, quality: 95))\n    // using webp binary data...\n}\n```\n\n#### Decoding\n\n```swift\nlet data: Data = loadWebPData()\nlet encoder = WebPDecoder()\nlet queue =  DispatchQueue(label: \"me.ainam.webp\")\n\n// should decode in background\nqueue.async {\n    var options = WebPDecoderOptions()\n    options.scaledWidth = Int(originalWidth / 2)\n    options.scaledHeight = Int(originalHeight / 2)\n    let cgImage = try! decoder.decode(data, options: options)\n    let webpImage = UIImage(cgImage: cgImage)\n\n    DispatchQueue.main.async {\n        self.imageView.image = webpImage\n    }\n}\n```\n\n\n## Example\n\nPlease check example project\n\n## Installation\n\nSwift-WebP supports Swift Package Manager installation.\n\n```\n.package(url: \"https://github.com/ainame/Swift-WebP.git\", from: \"0.5.0\"),\n```\n\n\n## Author\n\nainame\n\n## License\n\nSwift-WebP is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fainame%2FSwift-WebP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fainame%2FSwift-WebP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fainame%2FSwift-WebP/lists"}