{"id":38030591,"url":"https://github.com/zfedoran/dcraw.js","last_synced_at":"2026-01-18T03:02:56.882Z","repository":{"id":143053221,"uuid":"114179191","full_name":"zfedoran/dcraw.js","owner":"zfedoran","description":"Decode or convert RAW camera images using JavaScript","archived":false,"fork":false,"pushed_at":"2024-08-19T17:17:55.000Z","size":424,"stargazers_count":89,"open_issues_count":8,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-17T05:37:58.225Z","etag":null,"topics":["dcraw","emscripten","raw-image"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zfedoran.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":"2017-12-13T23:22:33.000Z","updated_at":"2025-12-27T13:48:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"98d45cf3-8ae7-4320-afea-6130b50739f2","html_url":"https://github.com/zfedoran/dcraw.js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zfedoran/dcraw.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfedoran%2Fdcraw.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfedoran%2Fdcraw.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfedoran%2Fdcraw.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfedoran%2Fdcraw.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zfedoran","download_url":"https://codeload.github.com/zfedoran/dcraw.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zfedoran%2Fdcraw.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["dcraw","emscripten","raw-image"],"created_at":"2026-01-16T19:40:03.873Z","updated_at":"2026-01-18T03:02:56.839Z","avatar_url":"https://github.com/zfedoran.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dcraw.js\nConvert RAW camera images using JavaScript (supported on Node.js and your Browser)\n\nThis project is a port of [dcraw.c](http://www.cybercom.net/~dcoffin/dcraw/) using [Emscripten](http://emscripten.org).\n\n### Install:\n\n#### Node.js\n\n```\nnpm install dcraw\n```\n\n#### Browser\n\n``` html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/dcraw\"\u003e\u003c/script\u003e\n```\n\n### Usage\n\nRead a RAW image file into a buffer (or `Uint8Array` in the browser, see browser example [here](https://jsfiddle.net/zfedoran/fy22msxo/))\n\n``` js\nconst fs = require('fs');\nconst buf = fs.readFileSync('./example.CR2');\n```\n\n##### Get Image Metadata\n\nParse the file for metadata\n\n``` js\nconst dcraw = require('dcraw');\ndcraw(buf, { verbose: true, identify: true });\n```\n\nResult\n\n```\n\u003e   Filename: raw_buf\n    Timestamp: Thu Sep 21 07:17:42 2017\n    Camera: Canon EOS 20D\n    Owner: unknown\n    ISO speed: 3200\n    Shutter: 252.0 sec\n    Aperture: f/inf\n    Focal length: 0.0 mm\n    Embedded ICC profile: no\n    Number of raw images: 1\n    Thumb size:  1536 x 1024\n    Full size:   3596 x 2360\n    Image size:  3522 x 2348\n    Output size: 3522 x 2348\n    Raw colors: 3\n    Filter pattern: RG/GB\n    Daylight multipliers: 2.098645 0.930145 1.180146\n    Camera multipliers: 1021.000000 1015.000000 1018.000000 1015.000000\n```\n\n##### Convert to TIFF\n\nConvert to TIFF file, and save to disk\n\n``` js\nconst tiffFile = dcraw(buf, { exportAsTiff: true });\nfs.writeFileSync('example.tiff', tiffFile)\n```\n\n### Options\n\nYou may use the same options that dcraw supports by providing the flags directly, or you may use the following human friendly versions.\n\n##### Example\n\n``` js\n// The following dcraw command, can be written two ways using dcraw.js\n// dcraw -T -4 -E \u003cfilename\u003e\n\n// Both of these do the same thing\ndcraw(buf, { T: true, 4: true, E: true });\ndcraw(buf, { exportAsTiff: true, use16BitLinearMode: true, useExportMode: true });\n```\n\n##### Options List\n\n|Option|Type|Description|\n|------|----|-----------|\n|**verbose**|boolean|Print verbose messages|\n|**identify**|boolean|Identify files without decoding them (use with '-v' to identify files and show metadata)|\n|**extractThumbnail**|boolean|Extract embedded thumbnail image|\n|**useCameraWhiteBalance**|boolean|Use camera white balance, if possible|\n|**useAverageWhiteBalance**|boolean|Average the whole image for white balance|\n|**whiteBalanceBox**|x y w h|Average a grey box for white balance|\n|**useCustomWhiteBalance**|r g b g|Set custom white balance|\n|**useEmbeddedColorMatrix**|boolean|Use/don't use an embedded color matrix|\n|**correctChromaticAberration**|r b |Correct chromatic aberration|\n|**deadPixelFile**|buffer |Fix the dead pixels listed in this file|\n|**darkFrameFile**|buffer |Subtract dark frame (16-bit raw PGM)|\n|**setDarknessLevel**|num |Set the darkness level|\n|**setSaturationLevel**|num |Set the saturation level|\n|**setWaveletThreshold**|num |Set threshold for wavelet denoising|\n|**setHighlightMode**|[0-9] |Highlight mode (0=clip, 1=unclip, 2=blend, 3+=rebuild)|\n|**setFlipMode**|[0-7] |Flip image (0=none, 3=180, 5=90CCW, 6=90CW)|\n|**setColorSpace**|[0-6] |Output colorspace (raw,sRGB,Adobe,Wide,ProPhoto,XYZ,ACES)|\n|**setICCFromFile**|buffer |Apply output ICC profile from file|\n|**setICCFromCamera**|buffer |Apply camera ICC profile from file or \"embed\"|\n|**useDocumentMode**|boolean|Document mode (no color, no interpolation, no debayer)|\n|**useRawMode**|boolean|Document mode without scaling (totally raw)|\n|**useExportMode**|boolean|Document mode without cropping|\n|**setNoStretchMode**|boolean|Don't stretch or rotate raw pixels|\n|**setNoAutoBrightnessMode**|boolean|Don't automatically brighten the image|\n|**setBrightnessLevel**|num |Adjust brightness (default = 1.0)|\n|**setCustomGammaCurve**|p ts |Set custom gamma curve (default = 2.222 4.5)|\n|**setInterpolationQuality**|[0-3] |Set the interpolation quality|\n|**setHalfSizeMode**|boolean|Half-size color image (twice as fast as \"-q 0\")|\n|**setFourColorMode**|boolean|Interpolate RGGB as four colors|\n|**setMedianFilter**|num |Apply a 3x3 median filter to R-G and B-G|\n|**setImageCount**|[0..N-1] |Select one raw image or \"all\" from each file|\n|**use16BitMode**|boolean|Write 16-bit instead of 8-bit|\n|**use16BitLinearMode**|boolean|Linear 16-bit, same as \"-6 -W -g 1 1\"|\n|**exportAsTiff**|boolean|Write TIFF instead of PPM|\n\n### Browser Example\n\nYou'll need to do a little bit of work to get a file buffer on the browser. There is a full example available [here](https://jsfiddle.net/zfedoran/fy22msxo/).\n\n``` js\nvar reader = new FileReader();\n\nreader.onload = function (e) {\n    // Get the image file as a buffer\n    var buf = new Uint8Array(e.currentTarget.result);\n\n    // Get the RAW metadata\n    const metadata = dcraw(buf, { verbose: true, identify: true });\n};\n\nreader.readAsArrayBuffer(file);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzfedoran%2Fdcraw.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzfedoran%2Fdcraw.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzfedoran%2Fdcraw.js/lists"}