{"_id":"dcraw","_rev":"3-3ec392332b28c12be99186cbdbe54c72","name":"dcraw","description":"Convert RAW camera images using JavaScript","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"dcraw","version":"1.0.0","description":"Convert RAW camera images using JavaScript","main":"./dist/dcraw.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zfedoran/dcraw.js.git"},"keywords":["raw","images","dcraw"],"author":{"name":"Zelimir Fedoran"},"license":"GPL-2.0","bugs":{"url":"https://github.com/zfedoran/dcraw.js/issues"},"homepage":"https://github.com/zfedoran/dcraw.js#readme","gitHead":"cd72f5461c3b4be1367d2c0314f1fbca20c46d3c","_id":"dcraw@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"zfedoran","email":"zelimir.fedoran@gmail.com"},"dist":{"integrity":"sha512-khHN2xYW6Fqw6DC99GhmmJR2up+r4e2/G73x0HBAf74q+Z+T6wpmyt6QJMjVVBv9jbMltkulfH70HiLxRZOuOQ==","shasum":"d246d51af5eb1dd56941d6557455e02cd6511611","tarball":"https://registry.npmjs.org/dcraw/-/dcraw-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFE2M1G1BB4DibGhRr9/igd/7+Rl8uFEzvw49rmNW6T1AiEA9s6sJI0kHgJWIuQmckq8g7srxxT+zmFdtw3a007x25U="}]},"maintainers":[{"name":"zfedoran","email":"zelimir.fedoran@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dcraw-1.0.0.tgz_1513210096933_0.179349054582417"}},"1.0.2":{"name":"dcraw","version":"1.0.2","description":"Convert RAW camera images using JavaScript","main":"./dist/dcraw.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zfedoran/dcraw.js.git"},"keywords":["raw","images","dcraw"],"author":{"name":"Zelimir Fedoran"},"license":"GPL-2.0","bugs":{"url":"https://github.com/zfedoran/dcraw.js/issues"},"homepage":"https://github.com/zfedoran/dcraw.js#readme","gitHead":"89584e45ab5ddf80b6f0e2228b7877ccf4e0d4d1","_id":"dcraw@1.0.2","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"zfedoran","email":"zelimir.fedoran@gmail.com"},"dist":{"integrity":"sha512-zcmB/FH6WIz3HQ9RuBg1bBw3B9+CM1ihYFlsX1CTMFDcM+/kpu2JerXA6m1N4OdjTDUbqbH6XyuM4uzCKXgdBQ==","shasum":"38acbfffb9a93b2c73b7fc3b4cf293fac8f0f5ff","tarball":"https://registry.npmjs.org/dcraw/-/dcraw-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD49pOdIwjdQOjWW7ODAHVCM7ypxDYCIUYd2L2zplCNmgIhAKQl0vXnab2UaOwWWdCPGzU743hIkyNeZ6hXCpk7pVjM"}]},"maintainers":[{"name":"zfedoran","email":"zelimir.fedoran@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dcraw-1.0.2.tgz_1513230942216_0.24392446340061724"}},"1.0.3":{"name":"dcraw","version":"1.0.3","description":"Convert RAW camera images using JavaScript","main":"./dist/dcraw.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/zfedoran/dcraw.js.git"},"keywords":["raw","images","dcraw"],"author":{"name":"Zelimir Fedoran"},"license":"GPL-2.0","bugs":{"url":"https://github.com/zfedoran/dcraw.js/issues"},"homepage":"https://github.com/zfedoran/dcraw.js#readme","gitHead":"8b5ab7f546cced02d3fb6abc99f736cbc39f3bf2","_id":"dcraw@1.0.3","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"zfedoran","email":"zelimir.fedoran@gmail.com"},"dist":{"integrity":"sha512-Eer+8s95I1itFQUCOqMxNNLPLR0MPjBHxuPY7AgbdcMY/aohbJhf8/mvA+NqKUj+MWm0fEKm17CmESqbzzcvZg==","shasum":"2ce21e7abfe2a81e1a70c5a3314b509c12ac4a99","tarball":"https://registry.npmjs.org/dcraw/-/dcraw-1.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIERZJB9EMR1n3LD6PjY8zDbXsC7phmrZYjtcG5NSu6XbAiEA7T2IlOsfU8AYS6q9SKmEX11bKZyrBpM9FkwBH7cGdDA="}]},"maintainers":[{"name":"zfedoran","email":"zelimir.fedoran@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dcraw-1.0.3.tgz_1513278474945_0.79398845997639"}}},"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<script src=\"https://cdn.jsdelivr.net/npm/dcraw\"></script>\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>   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 <filename>\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```","maintainers":[{"name":"zfedoran","email":"zelimir.fedoran@gmail.com"}],"time":{"modified":"2022-04-28T07:14:33.421Z","created":"2017-12-14T00:08:18.293Z","1.0.0":"2017-12-14T00:08:18.293Z","1.0.2":"2017-12-14T05:55:43.358Z","1.0.3":"2017-12-14T19:07:56.320Z"},"homepage":"https://github.com/zfedoran/dcraw.js#readme","keywords":["raw","images","dcraw"],"repository":{"type":"git","url":"git+https://github.com/zfedoran/dcraw.js.git"},"author":{"name":"Zelimir Fedoran"},"bugs":{"url":"https://github.com/zfedoran/dcraw.js/issues"},"license":"GPL-2.0","readmeFilename":"README.md"}