{"id":26923011,"url":"https://github.com/ij-plugins/ijp-dcraw","last_synced_at":"2025-08-03T16:38:40.962Z","repository":{"id":57737718,"uuid":"395483338","full_name":"ij-plugins/ijp-dcraw","owner":"ij-plugins","description":"ImageJ plugin to open camera raw images using dcraw","archived":false,"fork":false,"pushed_at":"2023-05-16T23:56:50.000Z","size":27194,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-09-07T18:20:53.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ij-plugins.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":"2021-08-13T01:08:34.000Z","updated_at":"2022-11-05T20:12:21.000Z","dependencies_parsed_at":"2023-02-09T09:47:20.559Z","dependency_job_id":null,"html_url":"https://github.com/ij-plugins/ijp-dcraw","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ij-plugins%2Fijp-dcraw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ij-plugins%2Fijp-dcraw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ij-plugins%2Fijp-dcraw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ij-plugins%2Fijp-dcraw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ij-plugins","download_url":"https://codeload.github.com/ij-plugins/ijp-dcraw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246735376,"owners_count":20825223,"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":[],"created_at":"2025-04-02T00:38:31.123Z","updated_at":"2025-04-02T00:38:31.672Z","avatar_url":"https://github.com/ij-plugins.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"ijp-dcraw\n=========\n\n[![Scala CI](https://github.com/ij-plugins/ijp-dcraw/actions/workflows/scala.yml/badge.svg)](https://github.com/ij-plugins/ijp-dcraw/actions/workflows/scala.yml)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sf.ij-plugins/ijp_dcraw/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sf.ij-plugins/ijp_dcraw)\n[![Javadoc](https://javadoc.io/badge2/net.sf.ij-plugins/ijp_dcraw/javadoc.svg)](https://javadoc.io/doc/net.sf.ij-plugins/ijp_dcraw)\n\n`ijp-dcraw` provides ImageJ plugin \"DCRaw Reader\" to open raw images from digital cameras. Originally the backend was\nprovided by [dcraw] tool. Current versions is using [LibRaw]/`dcraw_emu` tool. The hundreds of supported cameras are\nlisted on [LibRaw Supported Cameras] page.\n\nThere are two plugins:\n\n* __DCRaw Reader__ - reads images in camera raw format\n* __DCRaw Identify__ - provides info about the raw image, like camera make and metadata contained in the raw file\n* __DCRaw Unprocessed__ - reads mostly unprocessed raw image, it may be still before demosaicing. You may need a plugin\n  like [ijp-DeBayer2SX] to convert it to a color image.\n\n![Image Calibrator](assets/DCRaw_Reader_Dialog.png)\n\n`ijp-dcraw` distribution, available from [Releases] page, provides native binaries for Windows and macOS. Binaries for\nother\nsystem can be added manually.\n\nBy default, the \"DCRaw Reader\" plugin looks for the `dcraw_emu` and `raw-identify` executables in the\nsubdirectory `dcraw` of ImageJ plugins folder.\nAlternative location can be specified by one of:\n\n1. Setting Java system property `dcrawExecutable.path`, `raw-identifyExecutable.path`,\n   and `unprocessed_rawExecutable.path` to location of the `dcraw`, `raw-identify`, and `unprocessed_raw` executables,\n   for instance:\n\n  ```\n    -DdcrawExecutable.path=bin/dcraw_emu.exe -Draw-identifyExecutable.path=bin/raw-identify.exe\n  ```\n\n2. or adding property `.dcrawExecutable.path` to ImageJ properties file `IJ_Props.txt`. Note period at the beginning of\n   property name, it is required by ImageJ. Example line that should be added to `IJ_Props.txt`\n\n  ```\n    .dcrawExecutable.path=C:/apps/bin/dcraw_emu.exe\n    .raw-identifyExecutable.path==C:/apps/bin/raw-identify.exe\n    .unprocessed_rawExecutable.path==C:/apps/bin/unprocessed_raw.exe\n  ```\n\nInstallation\n------------\n\n1. Download `ijp-dcraw_plugins_*_win_macos.zip` from the [Releases] page. Binaries, taken from the [LibRaw] release are\n   provided for Windows and macOS.\n2. Unzip to ImageJ plugins directory. By default, the DCRaw Reader looks for the `dcraw_emu` and `raw-identify`\n   executables in the\n   subdirectory \"dcraw\" of the ImageJ plugins folder.\n3. Restart ImageJ\n\nThe plugin installs under `Plugins` \u003e `Input-Output` \u003e `DCRaw Reader...`.\n\nRelated Plugins\n---------------\n\n* [ijp-color] Contains plugin [IJP Color Calibrator] that can be used to color calibrated raw images. For instance, it\n  works well with \"16-bit linear\" images.\n* [ijp-DeBayer2SX] an alternative way to demosaic raw images\n\nTips and Tricks\n---------------\n\n### See What Backend Options Passed to `dcraw_emu`\n\nIf you wander what is going on behind the scenes, how `dcraw_emu` executable is used, you can see the exact command line\nij-dcraw is executing by turning on the \"Debug Mode\". Select in ImageJ menu: \"Edit\" \u003e \"Options\" \u003e \"Misc\" and select \"\nDebug Mode\". Now open an image using DCRaw Reader and watch the Log window, it will show the command line with the\noptions used and the output log generated by `dcraw_emu`.\n\n### White Balance Options\n\nDCRaw offers a couple of options for applying white balance to processed raw image. In the backend they are implemented\nas separate options. In the front end we try to bring some consistency and clarity. The front end provides following\nwhite balance options:\n\n* __Disable__ - force not to use any white balance - all channels are scaled the same way. This is the same as command\n  line option `-r 1 1 1 1` (white balance multiplier set to 1 for all channels). This useful to for best preservation of\n  the raw image data, for instance, when multiple images need to be compared.\n* __Derived__ - white balance multipliers are derived from the color conversion matrices embedded in the raw image\n  metadata. This is done without utilizing the information about camera recorded white balance. This is the default\n  behaviour of DCRaw. This option was in the past called \"None\". The name was changes as could indicate all channels\n  have the same multipliers. You can see what are the channel multipliers using the \"Raw Identify\" with the \"verbose\"\n  option. In the output look to an entry named \"Derived multipliers\". It maybe at the very end of the output and look\n  something like this:\n  ```\n  Derived D65 multipliers: 2.441519 0.995024 1.658339\n  ```\n  This may recover manufacturers \"default white balance\" for the camera, but in some cases may lead to issues, like\n  image saturation (in example above the red channel is multiplied significantly more than other channels and may get\n  saturated for bright pixels)\n* __Camera__ - use white balance coefficients recorded by the camera. They also can be seen using the \"Raw Identify\"\n  plugin.\n* __Averaging__ - compute white balance multiplier by averaging the entire image.\n\n### Sample ImageJ macro for batch image conversion\n\nExample of using \"DCRaw Reader\" plugin from an ImageJ macro. The macro converts all images in an input directory,\nassumed to be some supported raw format, to TIFF saved in the output directory. The source code for the macro is located\nin [macros/Batch_convert_dcraw.ijm].\n\n```javascript\n//Get File Directory and file names\ndirSrc = getDirectory(\"Select Input Directory\");\ndirDest = getDirectory(\"Select Output Directory\");\nfileList = getFileList(dirSrc);\ncaption = \"dcraw batch converter\";\n\nprint(caption + \" - Starting\");\nprint(\"Reading from : \" + dirSrc);\nprint(\"Writing to   : \" + dirDest);\n\n// Create output directory\nFile.makeDirectory(dirDest);\n\nsetBatchMode(true);\nfileNumber = 0;\nwhile (fileNumber \u003c fileList.length) {\n    id = fileList[fileNumber++];\n\n    print(toString(fileNumber) + \"/\" + toString(fileList.length) + \": \" + id);\n\n    // Read input image\n    run(\"DCRaw Reader...\",\n        \"open=\" + dirSrc + id + \" \" +\n        \"use_temporary_directory \" +\n        \"white_balance=[Camera white balance] \" +\n        //            \"do_not_automatically_brighten \" +\n        \"output_colorspace=[sRGB] \" +\n        \"read_as=[8-bit] \" +\n        \"interpolation=[DHT] \" +\n        //            \"half_size \" +\n        //            \"do_not_rotate \" +\n        \"\");\n    idSrc = getImageID();\n\n    // Save result\n    saveAs(\"Tiff\", dirDest + id);\n\n    // Cleanup\n    if (isOpen(idSrc)) {\n        selectImage(idSrc);\n        close();\n    }\n}\nprint(caption + \" - Completed\");\n```\n\n### Using ij-dcraw directly from Java\n\nExample of using `DCRawReader` API from a Java code. The source code is located\nin [src/test/java/demo/DCRawReaderDemo.java].\n\n```java\nimport ij.ImagePlus;\nimport ij_plugins.dcraw.DCRawException;\nimport ij_plugins.dcraw.DCRawReader;\n\nimport java.io.File;\n\nclass DCRawReaderDemo {\n\n    public static void main(String[] args) throws DCRawException {\n\n        final File inFile = new File(\"../test/data/IMG_5604.CR2\");\n        final ImagePlus imp = new DCRawReader().read(inFile);\n    }\n}\n```\n\n### Using low-level API to call DCRaw\n\nYou can also call `dcraw` by passing command line options. This may give access to some functionality\nthat may not be yet exposed through higher level `DCRawReader` API.\n\n```java\nimport ij.IJ;\nimport ij.ImagePlus;\nimport ij_plugins.dcraw.DCRawException;\nimport ij_plugins.dcraw.util.ExecProxy;\n\nimport java.io.File;\nimport java.util.Optional;\n\nimport static ij_plugins.dcraw.IJPUtils.isBlank;\n\n/**\n * Example of calling dcraw executable directly, passing command native line options\n */\npublic class DCRawExecProxyDemo {\n    public static void main(String[] args) throws DCRawException {\n        // Input file\n        final File inFile = new File(\"../test/data/IMG_5604.CR2\");\n\n        // Output file that will be generated by dcraw\n        final File outputFile = new File(inFile.getAbsolutePath() + \".tiff\");\n\n        // dcraw wrapper\n        final ExecProxy proxy = new ExecProxy(\"dcraw_emu\", \"dcrawExecutable.path\",\n                Optional.of(m -\u003e System.out.println(\"status: \" + m)),\n                Optional.of(m -\u003e System.out.println(\"error : \" + m)));\n\n        // Execute dcraw\n        ExecProxy.Result r = proxy.executeCommand(new String[]{\n                \"-v\",      // Print verbose messages\n                \"-q\", \"0\", // Use high-speed, low-quality bilinear interpolation.\n                \"-w\",      // Use camera white balance, if possible\n                \"-T\",      // Write TIFF instead of PPM\n                \"-j\",      // Don't stretch or rotate raw pixels\n                \"-W\",      // Don't automatically brighten the image\n                inFile.getAbsolutePath()});\n\n        System.out.println(\"dcraw_emu stdErr: '\" + r.stdErr + \"'\");\n        System.out.println(\"dcraw_emu stdOut:\\n\" + r.stdOut);\n\n        if (isBlank(r.stdErr)) {\n            // Load converted file, it is the same location as original raw file but with extension '.tiff'\n            final ImagePlus imp = IJ.openImage(outputFile.getAbsolutePath());\n            System.out.println(\"Loaded converted raw file: \" + imp.getWidth() + \" by \" + imp.getHeight());\n        }\n    }\n}\n```\n\nNotes\n-----\n\nijp-dcraw project was originally hosted on [SourceForge]. Releases 1.5 and older can be found [there][SourceForge].\n\n[dcraw]: https://en.wikipedia.org/wiki/Dcraw\n\n[LibRaw]: https://www.libraw.org/about\n\n[LibRaw Supported Cameras]: https://www.libraw.org/supported-cameras\n\n[Releases]: https://github.com/ij-plugins/ijp-dcraw/releases\n\n[SourceForge]: http://ij-plugins.sourceforge.net/plugins/dcraw/index.html\n\n[ijp-color]: https://github.com/ij-plugins/ijp-color\n\n[ijp-DeBayer2SX]: https://github.com/ij-plugins/ijp-DeBayer2SX\n\n[IJP Color Calibrator]: https://github.com/ij-plugins/ijp-color/wiki/Color-Calibrator\n\n[macros/Batch_convert_dcraw.ijm]: https://github.com/ij-plugins/ijp-dcraw/blob/master/macros/Batch_convert_dcraw.ijm\n\n[src/test/java/demo/DCRawReaderDemo.java]: https://github.com/ij-plugins/ijp-dcraw/blob/master/src/test/java/demo/DCRawReaderDemo.java","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fij-plugins%2Fijp-dcraw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fij-plugins%2Fijp-dcraw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fij-plugins%2Fijp-dcraw/lists"}