![]() To test these I ran: dcraw -c -D -T -6 -g 2.4 12.92 -o 1 DigitalCollodion_D610-1297copy.nef | convert -roll +0+0 -sample 50% OutputTest_A.tif Close-up on the result: This looks dim and, dare I say, stupid. ![]() The one that looks the brightest is your correct image. Heck, you can try +0+1 and +1+0 to see what would typically be the two green pixels. ![]() If you have BGGR, then this will be +0+0. ( -roll +1+1) Offset your image by the requisite number of pixels to place a blue pixel at the top left of the image. ![]() ( sample 50%) Downsample at 2:1, implied that you are dropping every other pixel in both X and Y directions This then pipes ( | )the data to ImageMagick- or rather the utility it provides named “convert”: I would argue you really don’t want this. This will output a linear electro-optical transfer function, and unless you really know what you’re doing, you probably don’t want this. Note that some tutorials will tell you to use a -4. You can tinker with this, but ultimately it shouldn’t make too big of a difference, since we are compressing to a monochromatic pipeline here regardless. ( -o 1) Set the colorspace to sRGB with a d65 white point. ( -g 2.4 12.92) gamma 2.4 with a toe-slope of 12.92, which is, more simply put, the appropriate setting for sRGB. ( -c) Output in a fashion that can be handed off to ImageMagick (STDOUT for piping) Open a terminal window, navigate to where your RAW file lives, and type: dcraw -c -D -T -6 -g 2.4 12.92 -o 1 YOURINPUTFILE.(NEF.RAW) | convert -roll +1+1 -sample 50% YOUROUTPUT.TIF On PC, this might be a bit more complex, but these tools exist for all platforms, which is why I chose to code in this fashion.Īssuming these are installed correctly, you should be able to run this single line of code to demosaic down to the blue sensor pixel. I recommend, if you are on a Mac/Linux, simply using homebrew to grab these- open up a terminal window, and type homebrew install imagemagick Unfortunately, you still will have to install it, even if you have RawTherapee, to use the command-line interface. RawTherapee is a front-end for this tool. It exists for all platforms, so whatever computer you are running, you can use it.ĭCRaw – This is THE tool for opening raw files from a digital camera. ImageMagick – This is THE tool for altering an image from the command line. These are free, but if you aren’t comfortable using a command line interface (CLI) then I have bad news for you- this is unfortunately how you’re going to have to do it. You will need the following command-line tools. I originally wrote this in MATLAB, but instead let me give it to you with freeware. The resulting clarity will play nicely with any upscaling processes you then wish to engage upon, however, and, especially in portraiture, artificial intelligence can work wonders. You will quarter the resolution of your image with this process. This is simply a downsample to strip out the three dead pixels. I know I will get some feedback that this is not a debayer, or demosaic, in any traditional sense. As we can see in this close-up of the raw data, this image has a lot of dead pixels. That means 3 pixels are “dead” or, at least “incorrect”. ![]() In looking at an image captured through a B25 glass, you will only capture 1 out of every 4 pixels correctly, thanks to the debayer color filter array (CFA) on top of your digital camera’s sensor. This is a photography blog, not a coding blog, so please bear with me for my first go at making this accessible. After reading my post on how to recreate the look of tintype and wet-plate collodion digitally, you may have been left wanting the code to appropriately demosaic/debayer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |