Home > image > Using LibRaw to correctly decode CR2 image?

Using LibRaw to correctly decode CR2 image?

March 11Hits:1
Advertisement

My eventual goal is to decode CR2 images from multiple cameras for display in a desktop gui.

Using the LibRaw image decoding library, I've used the sample project to attempt to decode a CR2 image into a .TIFF file.

The original file as a jpg thumbnail is as follows:

Using LibRaw to correctly decode CR2 image?

And the original CR2 after decoding and saving into a .TIFF is as follows:

Using LibRaw to correctly decode CR2 image?

As you can see, the outcome is slightly brighter and yellowish.

The sample project was contains the following parameters for decoding images:

"-c float-num       Set adjust maximum threshold (default 0.75)\n" "-v        Verbose: print progress messages (repeated -v will add verbosity)\n" "-w        Use camera white balance, if possible\n" "-a        Average the whole image for white balance\n" "-A <x y w h> Average a grey box for white balance\n" "-r <r g b g> Set custom white balance\n" "+M/-M     Use/don't use an embedded color matrix\n" "-C <r b>  Correct chromatic aberration\n" "-P <file> Fix the dead pixels listed in this file\n" "-K <file> Subtract dark frame (16-bit raw PGM)\n" "-k <num>  Set the darkness level\n" "-S <num>  Set the saturation level\n" "-n <num>  Set threshold for wavelet denoising\n" "-H [0-9]  Highlight mode (0=clip, 1=unclip, 2=blend, 3+=rebuild)\n" "-t [0-7]  Flip image (0=none, 3=180, 5=90CCW, 6=90CW)\n" "-o [0-5]  Output colorspace (raw,sRGB,Adobe,Wide,ProPhoto,XYZ)\n" #ifndef NO_LCMS "-o file   Output ICC profile\n" "-p file   Camera input profile (use \'embed\' for embedded profile)\n" #endif "-j        Don't stretch or rotate raw pixels\n" "-W        Don't automatically brighten the image\n" "-b <num>  Adjust brightness (default = 1.0)\n" "-q N      Set the interpolation quality:\n" "          0 - linear, 1 - VNG, 2 - PPG, 3 - AHD, 4 - DCB\n" #ifdef LIBRAW_DEMOSAIC_PACK_GPL2 "          5 - modified AHD,6 - AFD (5pass), 7 - VCD, 8 - VCD+AHD, 9 - LMMSE\n" #endif #ifdef LIBRAW_DEMOSAIC_PACK_GPL3 "          10-AMaZE\n" #endif "-h        Half-size color image (twice as fast as \"-q 0\")\n" "-f        Interpolate RGGB as four colors\n" "-m <num>  Apply a 3x3 median filter to R-G and B-G\n" "-s [0..N-1] Select one raw image from input file\n" "-4        Linear 16-bit, same as \"-6 -W -g 1 1\n" "-6        Write 16-bit linear instead of 8-bit with gamma\n" "-g pow ts Set gamma curve to gamma pow and toe slope ts (default = 2.222 4.5)\n" "-T        Write TIFF instead of PPM\n" "-G        Use green_matching() filter\n" "-B <x y w h> use cropbox\n" "-F        Use FILE I/O instead of streambuf API\n" "-timing   Detailed timing report\n" "-fbdd N   0 - disable FBDD noise reduction (default), 1 - light FBDD, 2 - full\n" "-dcbi N   Number of extra DCD iterations (default - 0)\n" "-dcbe     DCB color enhance\n" #ifdef LIBRAW_DEMOSAIC_PACK_GPL2 "-eeci     EECI refine for mixed VCD/AHD (q=8)\n" "-esmed N  Number of edge-sensitive median filter passes (only if q=8)\n" #endif #ifdef LIBRAW_DEMOSAIC_PACK_GPL3 //"-amazeca  Use AMaZE chromatic aberrations refine (only if q=10)\n" "-acae <r b>Use chromatic aberrations correction\n" //modifJD "-aline <l> reduction of line noise\n"  "-aclean <l c> clean CFA\n" "-agreen <g> equilibrate green\n" #endif "-aexpo <e p> exposure correction\n" // WF "-dbnd <r g b g> debanding\n" #ifndef WIN32 "-mmap     Use mmap()-ed buffer instead of plain FILE I/O\n" #endif "-mem      Use memory buffer instead of FILE I/O\n" "-disars   Do not use RawSpeed library\n" "-disinterp Do not run interpolation step\n" "-dsrawrgb1 Disable YCbCr to RGB conversion for sRAW (Cb/Cr interpolation enabled)\n" "-dsrawrgb2 Disable YCbCr to RGB conversion for sRAW (Cb/Cr interpolation disabled)\n" "-disadcf  Do not use dcraw Foveon code either if compiled with demosaic-pack-GPL2\n" 

I've tried various options to replicate the image in the thumbnail, such as white balancing (-w), interpolation quality (-q N), and embedded color matrix (+M). When I used white balancing, it removed the yellowish tint but produced a bright image. I then went on to disable automatic brightening (-W) and it produced a non-yellow image but much darker than the thumbnail.

What image decoding parameters will help me to decode the CR2 into the a high-quality image that looks like the thumbnail (in terms of color, brightness, etc.)?

Related Articles

  • Using LibRaw to correctly decode CR2 image?

    Using LibRaw to correctly decode CR2 image?March 11

    My eventual goal is to decode CR2 images from multiple cameras for display in a desktop gui. Using the LibRaw image decoding library, I've used the sample project to attempt to decode a CR2 image into a .TIFF file. The original file as a jpg thumbnai

  • How does excel manage to correctly decode this file contents?April 12

    I start with an excel file with the contents in each row: TEST çığ öğö çüş Then I export this file as a CSV file and save it as ANSI format (which from what I have read is same as US-ASCII). When I try to open it with excel again, it correctly decode

  • Data decoding initialization/Constructor error handlingDecember 30

    I have a set of loadable data decoders for a specific type of data and a stream to read containing data. Now I want the program to select the correct decoder in a reliable way so I want to use a trial-and-error algorithm. It seems resonable to create

  • How to correctly import data zipped with the "deflate" algorithm?February 20

    I'm writing an importer for the GIFTI file format. The details of the format are not particularly important, but the basic idea is that it is a relatively simple XML file which includes binary arrays of 32-bit floating point numbers that are represen

  • Why don't Lightroom or PSE recognize CR2 files from my Canon 7D mk II even though they are up to date?July 1

    I ordered a Canon 7D mark II (to replace a stolen 7D),and shot a friend's wedding in RAW. But now, I can only view the pictures in very poor quality on my computer's photo viewer. I am not able to import the pictures into Lightroom 3 or my PSE 13. Th

  • cjson.decode() of a multi layer JSONFebruary 1

    I want to decode a multi layered json object into a table and print the value of "temp". p=666 d=23.42 payload='{"d": {"pres":'..(p)..',"temp":'..(d)..'} }' t = cjson.decode(payload) My first idea was something like

  • Do I have to use an official "Panasonic" spare battery in the Lumix TZ10?August 26

    Some companies claim to offer cheap batteries that work with this camera however I read on the description for the Panasonic battery: Panasonic DMW-BCG10E ID Secured Battery for TZ7 and TZ6,TZ10, TZ8 contains special technology which means that third

  • UrlAction in elements.xml throwing a could not be found error

    UrlAction in elements.xml throwing a could not be found errorMay 17

    In my Elements.xml file I have the following: <UrlAction Url="~site/_layouts/test/page.aspx?ListId={ListId}&ItemId={ItemId}&ItemUrl={ItemUrl}"/> When the ECB item is selected I get the following error. The Web application at localh

  • Where should an increase in harmonic frequencies go in the Nyquist formula?September 3

    From the Nyquist formula that \$ Capacity = 2 \times Bandwidth \times log_2(L) \$, where \$L\$ is the level the signal represents, the total number of possible bit combinations the signal can represent. Say I have these current values of \$Bandwidth=

  • repair corrupted PDFNovember 8

    I have already looked at: Repair corrupt PDF and Rescuing a possibly corrupt PDF in Acrobat I tried ghostscript on both OS X and Windows. OS X gs gave the following error: GPL Ghostscript 9.06 (2012-08-08) Copyright (C) 2012 Artifex Software, Inc. Al

  • USB Flash Drive - Code: Cannot open because not a supported file type or damaged fileDecember 28

    I have a 4GB USB Flash Drive. How do I access, in a discernible format, a file/file folder which reads: "Could not open ABC file because it is either not a supported file type or because file has been damaged (for example, it was sent as an email att

  • What are "levels" and "keyframe distance" when rendering video in Adobe Premiere Levels?

    What are "levels" and "keyframe distance" when rendering video in Adobe Premiere Levels?April 25

    I would like to know what the render option called Levels is. Why should I change that to 5.1 or 1.0? What are those levels and how do they affect the final file (size, quality)? All the info I read on the internet, I cannot understand. Besides that,

  • Cannot open pdf file in USD drive by Adobe Reader using Window VistaAugust 27

    A message popped up as below Adobe Reader could not open file because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded) --------------Solutions--

  • Thousands of 404 errors on old posts due to embedded linksSeptember 15

    The number of 404 errors on the server has gone up drastically in the last 45 days (from 2000 to 9000). this is after I have made no changes to my permalink structure or .htaccess. the 404 pages are pointed to the older pages on the website - 2010/11

  • Fixing an unmuxed image/jpeg stream from webcam using gstreamerSeptember 17

    I made a broken footage using the following pipeline: gst-launch-1.0 v4l2src ! filesink location=encode.mjpeg Somehow gstreamer can still play it back: gst-launch-1.0 filesrc location=encode.mjpeg ! jpegdec ! videoconvert ! xvimagesink However as I b

  • Cannot open Tex file - Default encoding setting (UTF-8) not workingMay 18

    Texmaker cannot open a .tex file. It says It seems that this file cannot be correctly decoded with the default encoding setting (UTF-8) and asks me to choose an encoding option. ISO-8859-1 and ISO-8859-15 do not work. The file was compiled with LuaLa

  • What's to stop someone from 3D print cloning a key?

    What's to stop someone from 3D print cloning a key?May 18

    My friend just posted a picture of her key to instagram and it occurred to me that with such a high res photo, the dimensions of the key could easily be worked out. Therefore the key could be duplicated. What's to stop someone malicious from abusing

  • Knapsack Public to Private (Superincreasing knapsack)May 19

    I need to convert a hard knapsack to a superincreasing knapsack. I have these superincreasing values (3,6,11,22,43,87). I also have w = 7 and n = 173. I converted the superincreasing values to hard one (21,42,77,154,128,90) by computing $a_i = x_i *

  • Converting from string to blob and sending email along with attachmentJuly 11

    I have this method public void sendEmailWithAttachment(){ Blob b; String b64; String strUrlUTF8; String sampleString=generateReport(); //call generateReport method to get string System.debug('[Original sample string]'+sampleString); strUrlUTF8 = Enco

  • Session Fixation - Setting path to root without /August 6

    I have found an XSS vulnerability on the subdomain of a site I am testing, and using it I can set cookies for both the main site and all it's subdomains. My url currently looks like this: http://s1.example.com/u/%22%3E%3Cmeta%20http-equiv=Set-Cookie%

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.718 s.