{"id":47957173,"url":"https://github.com/nhauber99/degradr","last_synced_at":"2026-04-04T09:35:26.897Z","repository":{"id":192886653,"uuid":"687135440","full_name":"nhauber99/degradr","owner":"nhauber99","description":"Python library for realistically degrading images.","archived":false,"fork":false,"pushed_at":"2024-02-19T14:02:28.000Z","size":9119,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-02-19T15:29:30.411Z","etag":null,"topics":["blur","computer-vision","data-augmentation","data-preprocessing","image-degradation","image-processing","image-quality","machine-learning","noise","python"],"latest_commit_sha":null,"homepage":"https://www.photometric.io/blog/realistic-image-degradation/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nhauber99.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}},"created_at":"2023-09-04T17:39:57.000Z","updated_at":"2024-02-19T15:29:30.412Z","dependencies_parsed_at":null,"dependency_job_id":"33c17a0f-7152-4a89-838a-e213d790d49a","html_url":"https://github.com/nhauber99/degradr","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":0.4242424242424242,"last_synced_commit":"d0256e2fc4a9ee2120fe7e82ae552abe51b2f48f"},"previous_names":["nhauber99/degradr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nhauber99/degradr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhauber99%2Fdegradr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhauber99%2Fdegradr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhauber99%2Fdegradr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhauber99%2Fdegradr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nhauber99","download_url":"https://codeload.github.com/nhauber99/degradr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhauber99%2Fdegradr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31395007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T09:13:02.600Z","status":"ssl_error","status_checked_at":"2026-04-04T09:13:01.683Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["blur","computer-vision","data-augmentation","data-preprocessing","image-degradation","image-processing","image-quality","machine-learning","noise","python"],"created_at":"2026-04-04T09:35:26.260Z","updated_at":"2026-04-04T09:35:26.889Z","avatar_url":"https://github.com/nhauber99.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# degradr\nPython library for realistically degrading images.\n\nA blog post explaining the theory behind it a bit more can be found [here](https://www.photometric.io/blog/realistic-image-degradation/).\n\nThe Demo.py file provides an example usage of the library and should degrade the included test image if you set up everything correctly.\n\nFor building the Intel Integrated Performance Primitives Python wrapper, which is needed for demosaicing, please download the IPP libraries (or the whole oneAPI Base Toolkit). Then adapt the additional library and include directories of the Visual Studio project to point to the targeted python version and compile as a Release x64 library. Copy the PyIPP.pyd file somewhere into your pythonpath / adapt the pythonpath (more info in this issue thread: [https://github.com/nhauber99/degradr/issues/2](https://github.com/nhauber99/degradr/issues/2)). \nWhen running into trouble, [this guide](https://learn.microsoft.com/en-us/visualstudio/python/working-with-c-cpp-python-in-visual-studio?view=vs-2022) might help which is what I used for creating the wrapper library. If building on Linux, you're unfortunately on your own, but it should absolutely be doable as well.\n\nThe set of matrices for conversions between the camera and sRGB color space was derived from the [LibRaw](https://github.com/LibRaw/LibRaw) library and does NOT fall under the license of this project.\n\nA sample usage of the library can be found in the Test.py script, which applies all steps necessary for degrading a \"perfect\" image. Before that, you'll need to run the ZernikePSF.py and PrepKernels.py script to prepare the convolution kernels.\nThe applied steps are as follows (assuming the image is already in the camera color space):\n\u003col\u003e\n\u003cli\u003eConvert the input image to the assumed camera color space if needed.\u003c/li\u003e\n\u003cli\u003eConvolve by random blur kernel. (a combination of defocus blur, gaussian blur, PSFs generated from Zernike polynomials to model the lens aberrations, chromatic aberration)\u003c/li\u003e\n\u003cli\u003eColor filter array (in practice applied directly before the demosaicing for simplicity, but this doesn't affect the output)\u003c/li\u003e\n\u003cli\u003ePoison noise\u003c/li\u003e\n\u003cli\u003eGain\u003c/li\u003e\n\u003cli\u003eRead Noise\u003c/li\u003e\n\u003cli\u003eQuantization\u003c/li\u003e\n\u003cli\u003eCamera white balance\u003c/li\u003e\n\u003cli\u003eDemosaicing (3 different methods using the Intel Integrated Performance Primitives)\u003c/li\u003e\n\u003cli\u003eColor space transformation (from white balance corrected camera color space to sRGB)\u003c/li\u003e\n\u003cli\u003eJPEG Compression\u003c/li\u003e\n\u003c/ol\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n**Examples:**\n| Input | ![Image](Examples/in.png) |\n|:-:|-|\n| **Blur** | ![Image](Examples/blur.png) | \n| Blur \u003cbr\u003e **Noise** | ![Image](Examples/noise_blur.png) |\n| Blur \u003cbr\u003e Noise \u003cbr\u003e **CFA** | ![Image](Examples/noisy_blur_bayer.png) |\n| Blur \u003cbr\u003e Noise \u003cbr\u003e CFA \u003cbr\u003e **AHD Demosaicing** | ![Image](Examples/noise_blur_ahd.png) |\n| Blur \u003cbr\u003e Noise \u003cbr\u003e CFA \u003cbr\u003e AHD Demosaicing \u003cbr\u003e **JPEG Compression** | ![Image](Examples/noise_blur_ahd_jpg.png) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhauber99%2Fdegradr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhauber99%2Fdegradr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhauber99%2Fdegradr/lists"}