{"id":21827880,"url":"https://github.com/dev0x13/pywuffs","last_synced_at":"2025-04-14T05:43:28.141Z","repository":{"id":179940602,"uuid":"654556846","full_name":"dev0x13/pywuffs","owner":"dev0x13","description":"Python bindings for Wuffs the Library","archived":false,"fork":false,"pushed_at":"2025-04-05T15:09:46.000Z","size":2979,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T16:22:37.347Z","etag":null,"topics":["image-decoding","python","wuffs"],"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/dev0x13.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":"2023-06-16T11:41:35.000Z","updated_at":"2025-04-05T15:09:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"b4a469f8-c9bc-4a8a-ac1d-deb7977f3457","html_url":"https://github.com/dev0x13/pywuffs","commit_stats":null,"previous_names":["dev0x13/pywuffs"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev0x13%2Fpywuffs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev0x13%2Fpywuffs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev0x13%2Fpywuffs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev0x13%2Fpywuffs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev0x13","download_url":"https://codeload.github.com/dev0x13/pywuffs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830420,"owners_count":21168272,"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-decoding","python","wuffs"],"created_at":"2024-11-27T18:14:32.514Z","updated_at":"2025-04-14T05:43:28.120Z","avatar_url":"https://github.com/dev0x13.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pywuffs: Python bindings for Wuffs the Library\n\n[![Linux CI](https://github.com/dev0x13/pywuffs/actions/workflows/linux.yml/badge.svg)](https://github.com/dev0x13/pywuffs/actions/workflows/linux.yml)\n[![Windows CI](https://github.com/dev0x13/pywuffs/actions/workflows/windows.yml/badge.svg)](https://github.com/dev0x13/pywuffs/actions/workflows/windows.yml)\n[![macOS CI](https://github.com/dev0x13/pywuffs/actions/workflows/macos.yml/badge.svg)](https://github.com/dev0x13/pywuffs/actions/workflows/macos.yml)\n[![Downloads](https://static.pepy.tech/badge/pywuffs)](https://pepy.tech/project/pywuffs)\n\nThis project is intended to enable using [Wuffs the Library](https://github.com/google/wuffs) from Python code. For now,\nit only provides bindings for image and JSON decoding parts of\nthe [Auxiliary C++ API](https://github.com/google/wuffs/blob/main/doc/note/auxiliary-code.md) as being of the most\ninterest since it provides for \"ridiculously fast\" decoding of images of some types.\n\nCurrent version of Wuffs library used in this project is **unsupported snapshot** taken from\n[this](https://github.com/google/wuffs/releases/tag/v0.4.0-alpha.9) tag. The primary\nrationale for using the snapshot version instead of a stable release is that it provides JPEG decoder.\n\n## Installation\n\n### Using pip\n\n```bash\npython3 -m pip install pywuffs\n```\n\n### Using CMake\n\nCMake build support is mostly intended for development purposes, so the process might be\nnot so smooth.\n\nBuilding the Python module using CMake requires `pybind11` library to be installed in the\nsystem, for example in Ubuntu it can be installed like this:\n\n```bash\nsudo apt install pybind11-dev\n```\n\n#### Linux\n\n```bash\nmkdir _build \u0026\u0026 cd _build\ncmake ..\nmake\n```\n\n#### Windows\n\n```shell\nmkdir _build \u0026\u0026 cd _build\ncmake -A x64 ..\ncmake --build .\n```\n\n## Usage example\n\nThe example below demonstrates how to decode a PNG image and its EXIF metadata:\n\n```python\nfrom pywuffs import ImageDecoderType, PixelFormat\nfrom pywuffs.aux import (\n    ImageDecoder,\n    ImageDecoderConfig,\n    ImageDecoderFlags\n)\n\nconfig = ImageDecoderConfig()\n\n# All decoders are enabled by default\nconfig.enabled_decoders = [ImageDecoderType.PNG]\n\n# No metadata is reported by default\nconfig.flags = [ImageDecoderFlags.REPORT_METADATA_EXIF]\n\n# Pixel format is PixelFormat.BGRA_PREMUL by default\nconfig.pixel_format = PixelFormat.BGR\n\ndecoder = ImageDecoder(config)\n\ndecoding_result = decoder.decode(\"lena.png\")\n\n# Decoded image data in BGR format\nimage_data = decoding_result.pixbuf\n\n# Shape of the decoded image\nimage_shape = decoding_result.pixbuf.shape\n\n# Parsed EXIF metadata\nmeta_minfo = decoding_result.reported_metadata[0].minfo\nmeta_bytes = decoding_result.reported_metadata[0].data.tobytes()\n```\n\n## API reference\n\nAPI documentation is available at https://pywuffs.readthedocs.io. \n\n## Implementation goals\n\n1. Bindings are supposed to be as close as possible to the original C and C++ Wuffs API. The differences are only\n   justified when it's hardly possible to transfer the API entries to Python as is.\n2. Bindings are not supposed to add much overhead. Because of that some parts of the API are not as convenient as they\n   expected to be.\n\n## Roadmap\n\n1. Bindings for other parts of `wuffs_aux` API (CBOR decoding).\n2. Bindings for the C API of Wuffs the Library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev0x13%2Fpywuffs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev0x13%2Fpywuffs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev0x13%2Fpywuffs/lists"}