{"id":15423014,"url":"https://github.com/letmaik/rawpy","last_synced_at":"2025-04-10T23:26:50.516Z","repository":{"id":20483771,"uuid":"23761821","full_name":"letmaik/rawpy","owner":"letmaik","description":"📷 RAW image processing for Python, a wrapper for libraw","archived":false,"fork":false,"pushed_at":"2025-03-01T10:14:00.000Z","size":85249,"stargazers_count":667,"open_issues_count":20,"forks_count":73,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-03T14:45:21.670Z","etag":null,"topics":["camera-calibration","camera-image","image-optimization","image-processing","python"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/rawpy","language":"Cython","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/letmaik.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":"2014-09-07T14:32:12.000Z","updated_at":"2025-04-02T21:33:46.000Z","dependencies_parsed_at":"2023-02-19T03:00:18.409Z","dependency_job_id":"4241a298-d99d-4667-aaab-a292ca3fbb4f","html_url":"https://github.com/letmaik/rawpy","commit_stats":{"total_commits":367,"total_committers":14,"mean_commits":"26.214285714285715","dds":0.0953678474114441,"last_synced_commit":"d368d56f2eb9e7bd1f4c2f783bc4873d177e321b"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letmaik%2Frawpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letmaik%2Frawpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letmaik%2Frawpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letmaik%2Frawpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letmaik","download_url":"https://codeload.github.com/letmaik/rawpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248313934,"owners_count":21082945,"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":["camera-calibration","camera-image","image-optimization","image-processing","python"],"created_at":"2024-10-01T17:40:09.591Z","updated_at":"2025-04-10T23:26:50.495Z","avatar_url":"https://github.com/letmaik.png","language":"Cython","readme":"\u003cp align=\"center\"\u003e\n\u003ca href=\"https://en.wikipedia.org/wiki/Bayer_filter\"\u003e\u003cimg width=\"500\" src=\"https://raw.githubusercontent.com/letmaik/rawpy/main/logo/logo.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nrawpy is an easy-to-use Python wrapper for the [LibRaw library][libraw].\nIt also contains some extra functionality for finding and repairing hot/dead pixels.\n\n[API Documentation](https://letmaik.github.io/rawpy/api/)\n\n[Jupyter notebook tutorials](https://github.com/letmaik/rawpy-notebooks/blob/master/README.md)\n\n## Sample code\n\nLoad a RAW file and save the postprocessed image using default [parameters](https://letmaik.github.io/rawpy/api/rawpy.Params.html):\n\n```python\nimport rawpy\nimport imageio.v3 as iio\n\npath = 'image.nef'\nwith rawpy.imread(path) as raw:\n    rgb = raw.postprocess()\niio.imwrite('default.tiff', rgb)\n```\n\nSave as 16-bit linear image:\n\n```python\nwith rawpy.imread(path) as raw:\n    rgb = raw.postprocess(gamma=(1,1), no_auto_bright=True, output_bps=16)\niio.imwrite('linear.tiff', rgb)\n```\n\nExtract embedded thumbnail/preview image and save as JPEG:\n\n```python\nwith rawpy.imread(path) as raw:\n    # raises rawpy.LibRawNoThumbnailError if thumbnail missing\n    # raises rawpy.LibRawUnsupportedThumbnailError if unsupported format\n    thumb = raw.extract_thumb()\nif thumb.format == rawpy.ThumbFormat.JPEG:\n    # thumb.data is already in JPEG format, save as-is\n    with open('thumb.jpeg', 'wb') as f:\n        f.write(thumb.data)\nelif thumb.format == rawpy.ThumbFormat.BITMAP:\n    # thumb.data is an RGB numpy array, convert with imageio\n    iio.imwrite('thumb.jpeg', thumb.data)\n```\n\nFind bad pixels using multiple RAW files and repair them:\n\n```python\nimport rawpy.enhance\n\npaths = ['image1.nef', 'image2.nef', 'image3.nef']\nbad_pixels = rawpy.enhance.find_bad_pixels(paths)\n\nfor path in paths:\n    with rawpy.imread(path) as raw:\n        rawpy.enhance.repair_bad_pixels(raw, bad_pixels, method='median')\n        rgb = raw.postprocess()\n    iio.imwrite(path + '.tiff', rgb)\n```\n\n## Installation\n\nInstall rawpy by running:\n```sh\npip install rawpy\n```\n\n64-bit binary wheels are provided for Linux, macOS, and Windows.\n\n### Stable vs. pre-release\n\nAll stable rawpy releases are always built against a stable LibRaw library release.\nYou can output the LibRaw version with `print(rawpy.libraw_version)`.\n\nrawpy pre-releases have version numbers like `0.15.0a1` and are built against\na recent LibRaw snapshot. To install a pre-release, run:\n```sh\npip install --pre rawpy\n```\n\n### Optional features\n\nThe underlying [LibRaw library][libraw] supports several optional features.\nThe following table shows which PyPI binary wheels support which features.\n\n| Feature            | Windows | macOS | Linux |\n| ------------------ | ------- | ----- | ----- |\n| LCMS color engine  | yes     | yes   | yes   |\n| RedCine codec      | yes     | yes   | yes   |\n| DNG deflate codec  | yes     | yes   | yes   |\n| DNG lossy codec    | yes     | yes   | yes   |\n| Demosaic Pack GPL2 | no      | no    | no    |\n| Demosaic Pack GPL3 | no      | no    | no    |\n| OpenMP             | yes     | no    | yes   |\n\nTip: You can dynamically query supported features by inspecting the `rawpy.flags` dictionary.\n\nNote on GPL demosaic packs: The GPL2 and GPL3 demosaic packs are not included as rawpy is licensed\nunder the MIT license which is incompatible with GPL.\n\n### Installation from source on Linux/macOS\n\nFor macOS, LibRaw is built as part of the rawpy build (see external/).\nFor Linux, you need to install the LibRaw library on your system.\n\nOn Ubuntu, you can get (an outdated) version with:\n\n```sh\nsudo apt-get install libraw-dev\n```\n\nOr install the latest release version from the source repository:\n\n```sh\ngit clone https://github.com/LibRaw/LibRaw.git libraw\ngit clone https://github.com/LibRaw/LibRaw-cmake.git libraw-cmake\ncd libraw\ngit checkout 0.20.0\ncp -R ../libraw-cmake/* .\ncmake .\nsudo make install\n```\n    \nAfter that, install rawpy using:\n\n```sh\ngit clone https://github.com/letmaik/rawpy\ncd rawpy\npip install numpy cython\npip install .\n```\n    \nOn Linux, if you get the error \"ImportError: libraw.so: cannot open shared object file: No such file or directory\"\nwhen trying to use rawpy, then do the following:\n\n```sh\necho \"/usr/local/lib\" | sudo tee /etc/ld.so.conf.d/99local.conf\nsudo ldconfig\n```\n\nThe LibRaw library is installed in /usr/local/lib (if installed manually) and apparently this folder is not searched\nfor libraries by default in some Linux distributions.\n\n### Installation from source on Windows\n\nThese instructions are experimental and support is not provided for them.\nTypically, there should be no need to build manually since wheels are hosted on PyPI.\n\nYou need to have Visual Studio installed to build rawpy.\n\nIn a PowerShell window:\n```sh\n$env:USE_CONDA = '1'\n$env:PYTHON_VERSION = '3.7'\n$env:PYTHON_ARCH = '64'\n$env:NUMPY_VERSION = '1.14.*'\ngit clone https://github.com/letmaik/rawpy\ncd rawpy\n.github/scripts/build-windows.ps1\n```\nThe above will download all build dependencies (including a Python installation)\nand is fully configured through the four environment variables.\nSet `USE_CONDA = '0'` to build within an existing Python environment.\n\n\n[libraw]: https://www.libraw.org\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletmaik%2Frawpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletmaik%2Frawpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletmaik%2Frawpy/lists"}