{"id":40976685,"url":"https://github.com/jedypod/debayer","last_synced_at":"2026-01-22T06:52:58.198Z","repository":{"id":45009606,"uuid":"163247307","full_name":"jedypod/debayer","owner":"jedypod","description":"Debayer raw images automatically, with the option of outputting scene-linear aces exrs.","archived":false,"fork":false,"pushed_at":"2023-10-30T01:14:22.000Z","size":431,"stargazers_count":44,"open_issues_count":2,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2023-10-30T02:31:41.396Z","etag":null,"topics":["autoexposure-calculation","colorspace","commandline","dcraw","debayering","openimageio","python","rawtherapee"],"latest_commit_sha":null,"homepage":"","language":"Python","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/jedypod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-27T04:32:51.000Z","updated_at":"2023-10-20T13:08:47.000Z","dependencies_parsed_at":"2022-08-29T12:40:38.180Z","dependency_job_id":null,"html_url":"https://github.com/jedypod/debayer","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/jedypod/debayer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedypod%2Fdebayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedypod%2Fdebayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedypod%2Fdebayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedypod%2Fdebayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jedypod","download_url":"https://codeload.github.com/jedypod/debayer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jedypod%2Fdebayer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28657378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["autoexposure-calculation","colorspace","commandline","dcraw","debayering","openimageio","python","rawtherapee"],"created_at":"2026-01-22T06:52:57.288Z","updated_at":"2026-01-22T06:52:58.186Z","avatar_url":"https://github.com/jedypod.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Debayer\nDebayer is a commandline tool to convert camera raw images into scene-linear exr.\n\n# Dependencies\nThe only required dependency is oiiotool. However other \"debayer engines\" are also supported.\n\n- [OpenImageIO](https://github.com/OpenImageIO/oiio) - oiiotool is used for converting debayered tif images to exr.\n- **Debayer Engines**\n  - [RawTherapee](https://rawtherapee.com/downloads) - Powerful raw development software used to decode raw images. High quality, good selection of debayer algorithms, and more advanced raw processing like chromatic aberration removal.\n  - [LibRaw](https://www.libraw.org/download) - dcraw_emu commandline utility included with LibRaw. Optional alternative for debayer. Simple, fast and effective.\n  - [Darktable](https://www.darktable.org) - Uses darktable-cli plus an xmp config to process.\n  - [vkdt](https://jo.dreggn.org/vkdt) - uses vkdt-cli to debayer. Pretty experimental still. Uses Vulkan for image processing. Stupidly fast. Pretty limited.\n\n\n\n## Configuration\nYou need to configure a few things in the debayer python file. At the top are some variables you need to customize. Described below are the important ones and what they do.\n\nFirst you need to choose which debayer engine you will use. `DEBAYER_ENGINES` lists all possibilities. `DEBAYER_ENGINE` is where you set which debayer software will be used.\n```\n# Debayer engine options\nDEBAYER_ENGINES = ['rt', 'art', 'dc', 'dcrcd', 'dt', 'vkdt', 'oiio'] \n# Debayer engine to use\nDEBAYER_ENGINE = 'rt'\n```\nThis configuration will use RawTherapee as the debayer engine.\n\nIMPORTANT: If you are using RawTherapee 5.8 or lower, you need to [install an output icc profile](docs/RawTherapee.md).\n\nNext you need to set the paths to the binary executable files. oiiotool is required. You only need to specify paths for the debayer engine you will use.\n\n```\n# Binary executable locations\nOIIO_BIN    = '/usr/bin/oiiotool'\nRT_BIN      = '/usr/bin/rawtherapee-cli'\nART_BIN     = '/usr/bin/ART-cli'\nDCRAW_BIN   = '/usr/bin/dcraw_emu'\nDT_BIN      = '/usr/bin/darktable-cli'\nVKDT_BIN    = '/opt/vkdt/vkdt/vkdt-cli'\n```\n\nYou also need to specify a temp directory for debayer to use as a location for intermediate files (don't worry they are cleaned up automatically). It speeds things up if this is on a fast local drive.\n\n```\nCACHE_DIR = '/var/tmp/debayer'\n```\n\nYou can set other options as well:\n`THREADS = 2` - Number of simultaneous jobs (Useful if using a single-threaded debayer engine like dcraw).\n\n`EXR_COMPRESSION = 'dwaa:15'` - Type of compression to use for output exr files.\n\n`DEFAULT_EXPOSURE = '4.0'` - Default multiply value to get from raw linear to scene-linear.\n\n`RT_DEFAULT_PROFILE = ''` - Path to the default RawTherapee pp3 preset to use. There is one included and set by default, but you can override this path if desired. There are similar variables for the other debayer engines that need config files as well.\n\n## Debayer Engine Configuration\nHere is some more information about how to configure custom debayer settings for each of the debayer engines. I've included quite a bit of extra information here about the decisions I've made and why. \n\n- [RawTherapee](docs/RawTherapee.md)\n- [dcraw](docs/dcraw.md)\n- [DarkTable](docs/Darktable.md)\n- [vkdt](docs/vkdt.md)\n\n## Usage\nUsing debayer is very simple if you are familiar with commandline utilities. In the simplest possible form, you could write\n\n```\ndebayer rawfile.cr2\n```\n\nThis will process the raw file into the directory you are currently in.\n\nIf you want to specify a custom directory you could do\n```\ndebayer rawfile.cr2 -o /path/to/output_dir\n```\n\nYou can also process an entire source directory recursively. For example say you have this source directory structure:\n```\n/media/footage/20211012\n└── dng\n    ├── M22-1558\n    │   ├── M22-1558.000000.dng\n    │   ├── M22-1558.000001.dng\n    │   ├── M22-1558.000002.dng\n    │   ├── M22-1558.000003.dng\n    │   ├── M22-1558.000004.dng\n    └── M22-1600\n        ├── M22-1600_000000.dng\n        ├── M22-1600_000001.dng\n        ├── M22-1600_000002.dng\n        ├── M22-1600_000003.dng\n        └── M22-1600_000004.dng\n```\n\nSay you want to recursively process all raw files inside /media/footage/20211012/dng, and output the results, including subfolders, into /media/footage/20211012/exr. You could run\n```\ndebayer /media/footage/20211012/dng -o /media/footage/20211012/exr\n\n# or alternatively, you can use relative paths\ncd /media/footage/20211012\ndebayer dng -o exr\n```\n\n## Commandline Options\n```\n$ debayer -h\nusage: debayer [-h] [-o OUTPUT] [-w] [-p PROFILE] [-en ENGINE] [-ca]\n               [-r RESIZE] [-e EXPOSURE] [-j JOBS] [-f FILTER]\n               input_paths [input_paths ...]\n\nDebayer is a commandline tool to convert camera raw images into scene-linear\nexr.\n\npositional arguments:\n  input_paths           Source(s) to process. Can be one or more images or\n                        directories containing images.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -o OUTPUT, --output OUTPUT\n                        Output directory. If not specified, the current\n                        directory will be used.\n  -w, --overwrite       Overwrite existing output files.\n  -p PROFILE, --profile PROFILE\n                        Optional override to specify a custom profile to use.\n                        If none, the default config file will be used. Could\n                        be a pp3 file for rawtherapee, xmp for darktable, or\n                        cfg for vkdt.\n  -en ENGINE, --engine ENGINE\n                        Debayer engine to use: If none, the DEBAYER_ENGINE\n                        variable in will be used. one of: 'rt', 'art', 'dc',\n                        'dcrcd', 'dt', 'vkdt', 'oiio'\n  -ca, --aberration     Remove chromatic aberration (rawtherapee or ART only)\n  -r RESIZE, --resize RESIZE\n                        Apply a resize to the output image. Aspect ratio is\n                        not preserved if both width and height are specified.\n                        \u003cwidth\u003ex\u003cheight\u003e Or preserve aspect ratio if w or h =\n                        0: e.g. \"1920x0\" Can also be a percentage like\n                        \"50%\"(For Magic Lantern 1x3 anamorphic) 1920x2340 -\u003e\n                        5760x2340 -\u003e 2880x1170 (ML 1x3 2.35) - 1808x2300 -\u003e\n                        (unsqueeze) 5424x2300 -\u003e (0.5) 2712x1150 Or 1280x2160\n                        (1x3) -\u003e 3840x2160 -\u003e 2560x1440 -\u003e 1920x1080\n  -e EXPOSURE, --exposure EXPOSURE\n                        Raw to scene-linear exposure adjustment. Default is\n                        4.0\n  -j JOBS, --jobs JOBS  Number of simultaneous jobs.\n  -f FILTER, --filter FILTER\n                        Include only files that match regex. Can be comma\n                        separated list.\n```\n\n## Exposure\nOne important parameter when debayering to scene-linear is how much to expose up with the `-e` parameter. Camera raw files are usually stored in an integer data format, which means the data is contained in a 0-1 container. How many bits of precision that data has within that container varies with the camera and sensor. \n\nTo get this 0-1 data range into sensible scene-linear data, we need to expose up the raw data so that an 18% grey diffuse reflector will live at a scene-linear value of around 0.18. How much we need to expose up will of course depend on how the image was exposed in the camera. This also determines how much headroom you will have in highlights. A default value of 4.0 is provided as a starting point, but you will probably want to customize this depending on your source raw images.\n\n## Custom Profile\nYou can specify a custom config file for your debayer engine with `-p path/to/file`. This is useful if you need to customize whitebalance or sharpening settings for example.\n\nA default config is included in the repo for most debayer engines is used by default there is a -p switch enabled.\n\n## Debayer Algorithms\nIf you are curious about the different available debayer algorithms in open software I have put together a big set of comparison images in jpg and exr available at this [mega.nz link](https://mega.nz/folder/ZEYg1bwL#jD1ED7P-D5srWdYR0PdP8A).\n\nThe images are processed with `dcraw_emu` for AHD, AAHD, DHT and VNG, and with `rawtherapee-cli` for RCD, DCB and AMaZE. The test images are a selection of 256x128 pixel crops of interesting image regions for judging debayer quality. My subjective ranking would be\n\n```\nRCD \u003e DCB \u003e AMaZE \u003e DHT \u003e AAHD \u003e AHD \u003e VNG\n```\n\nIf you're curious, I wrote a [more in-depth discussion](docs/Debayer_Algorithms.md).\n\n# Installation\n\n## OpenImageIO\noiiotool can be installed with common pacakge managers on all platforms. [See this documentation](https://github.com/OpenImageIO/oiio/blob/master/INSTALL.md#installing-from-package-managers) for help.\n## Rawtherapee\n[Packages are provided](http://rawtherapee.com) for all platforms. However if you are on linux, the appimage won't give you access to the rawtherapee-cli commandline utility. You will need to install or compile it (or extract the contents of the appimage with ./Rawtherapee-5.8.Appimage --appimage-extract ). Note if you are on Centos 7, the Appimage will not work because it was compiled with a newer version of GLIBC. There is however a copr for many fedora and rhel distros including el7 [here](https://download.copr.fedorainfracloud.org/results/scx/rawtherapee/).  \n\nIMPORTANT: For Rawtherapee 5.8 and below, you need to [install a custom icc output profile](docs/RawTherapee.md) in order to work around a [posterization bug](https://github.com/Beep6581/RawTherapee/issues/6378).\n\n## LibRaw\n[LibRaw provides](https://www.libraw.org/download) packages for Windows and Mac, and for Linux it is easy to compile with minimal dependencies. I would recommend compiling from [master](https://github.com/LibRaw/LibRaw) to get the latest raw formats like Canon CR3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedypod%2Fdebayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedypod%2Fdebayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedypod%2Fdebayer/lists"}