From c6d7c6f01242dfe67c023381eb41721e411b5ac3 Mon Sep 17 00:00:00 2001 From: Ingo Date: Sat, 13 Dec 2014 00:38:33 +0100 Subject: [PATCH] camconst.json updates and some small changes to dcraw.cc, Issue 2348 #49 --- rtengine/camconst.json | 127 +++++++++++++++++++++++++++++++---------- rtengine/dcraw.cc | 4 ++ rtengine/dcraw.patch | 16 ++++-- 3 files changed, 110 insertions(+), 37 deletions(-) diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 4809ff1a3..120ff3584 100755 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -491,6 +491,34 @@ Quality X: unknown, ie we knowing to little about the camera properties to know } }, + { // Quality A, f/1.6 aperture scale factor missing but safely guessed, ISO and aperture data by charlyw at RT forums + "make_model": "Canon EOS 7D Mark II", + "dcraw_matrix": [ 7268,-1082,-969,-4186,11839,2663,-825,2029,5839 ], // dng_v8.7 d65 + // "dcraw_matrix": [ 6285,-147,-821,-4080,11695,2714,-1045,2459,5497 ], // DXO D50 + "ranges": { + "white": [ + { "iso": [ 100, 125 ], "levels": 13500 }, // typical 13583 - LENR 13550 + { "iso": [ 160, 320, 640, 1250, 2500, 5000 ], "levels": 12500 }, // typical 12559 + { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000 ], "levels": 15200 }, // typical 15303 - LENR 15270,15260,15240,15220, + { "iso": [ 6400, 8000, 10000, 12800, 16000, 20000, 25600 ], "levels": 15100 }, // typical G1,G2 15303, R,B = 15430 LENR 15200 .. 15100 + { "iso": 51200, "levels": 16300 } // typical 16383 red 16371 + ], + "white_max": 16383, + "aperture_scaling": [ + /* note: no scale factors known for f/1.6, f/1.0 (had no lenses to test with) */ + { "aperture": 1.4, "scale_factor": 1.200 }, // 15100/12277 exif + { "aperture": 1.6, "scale_factor": 1.100 }, // guessed + { "aperture": 1.8, "scale_factor": 1.050 }, // 14372/13583 - 13283 + { "aperture": 2.0, "scale_factor": 1.030 }, // 14034/13583 - 12973 + { "aperture": 2.2, "scale_factor": 1.015 }, // 13808/13583 - 12766 + { "aperture": 2.5, "scale_factor": 1.007 }, // 13696/13583 - 12662 + { "aperture": 2.8, "scale_factor": 1.007 }, // 13696/13583 - 12663 + { "aperture": 3.2, "scale_factor": 1.000 }, // 13583/13583 - 12559 + { "aperture": 3.5, "scale_factor": 1.000 } + ] + } + }, + { // Quality A - ISO and aperture WL data by Ilias at Avclub gr forums "make_model": "Canon EOS 40D", "dcraw_matrix": [ 6071,-747,-856,-7653,15365,2441,-2025,2553,7315 ], @@ -593,8 +621,8 @@ Quality X: unknown, ie we knowing to little about the camera properties to know } }, { // Quality B, more aperture scale factors needed - "make_model": [ "Canon EOS 70D", "Canon EOS 7D Mark II" ], // guess for 7DII as the sensors look "same" - "dcraw_matrix": [ 7034,-804,-1014,-4420,12564,2058,-851,1994,5758 ], + "make_model": "Canon EOS 70D", + "dcraw_matrix": [ 7034,-804,-1014,-4420,12564,2058,-851,1994,5758 ], // DNG D65 "ranges": { "white": [ { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13583 @@ -673,7 +701,7 @@ Quality X: unknown, ie we knowing to little about the camera properties to know }, { // Quality B, missing scaling factors are guessed safely from 650D relative data - "make_model": "Canon EOS-M", + "make_model": "Canon EOS M", "dcraw_matrix": [ 6602,-841,-939,-4472,12458,2247,-975,2039,6148 ], "ranges": { "white": [ @@ -711,9 +739,9 @@ Quality X: unknown, ie we knowing to little about the camera properties to know "ranges": { "white": 16300 } }, - { // Quality X, preliminary support, color data guessed from G16 + { // Quality B, not supported by the current Dcraw 9.22 "make_model": "Canon PowerShot G7 X", - "dcraw_matrix": [ 8020,-2687,-682,-3704,11879,2052,-965,1921,5556 ], // D65 matrix copy from Canon powershot G16 + "dcraw_matrix": [ 9602,-3823,-937,-2984,11495,1675,-407,1415,5049 ], // DNG_V8.7 D65 // "raw_crop": [ 116, 24, 5504, 3680 ], // Sensor size 5632x3710. Largest usefull frame 120-5616X28-3702 = 5504x3682, 4pix RTborders, Left Border 120-4, Top border 28-4 "raw_crop": [ 128, 36, 5480, 3656 ], // Default official 3/2 frame 5472X3648, 4pix borders, Left Border 132-4, Top border 40-4 "masked_areas": [ 40, 4, 3680, 76 ], @@ -728,9 +756,9 @@ Quality X: unknown, ie we knowing to little about the camera properties to know "ranges": { "white": 4050 } }, - { // Quality X, preliminary support, color data guessed + { // Quality B "make_model": "Canon PowerShot SX60 HS", - "dcraw_matrix": [ 12432,-4753,-1247,-2110,10691,1629,-412,1623,4926 ], // copy from SX50 + "dcraw_matrix": [ 13161,-5451,-1344,-1989,10654,1531,-47,1271,4955 ], // DNG_V8.7 D65 "raw_crop": [ 120, 34, 4616, 3464 ], // full raw 4768x3516, Usable 96,16,4672,3498 - Canon official 4608x3456 left 124 top 38, "masked_areas": [ 20, 2, 3480, 80 ], "ranges": { "white": 4050 } // nominal 4080-4093 @@ -741,7 +769,13 @@ Quality X: unknown, ie we knowing to little about the camera properties to know "dcraw_matrix": [ 12297,-4882,-1202,-2106,10691,1623,-88,1312,4790 ] // DNG_v8.5 D65 }, - { // Quality B + { // Quality B, + "make_model": [ "FUJIFILM X100S", "FUJIFILM X100T" ], + "dcraw_matrix": [ 10592,-4262,-1008,-3514,11355,2465,-870,2025,6386 ], // DNG_v8.7 D65 + "ranges": { "white": 16100 } + }, + + { // Quality B "make_model": [ "FUJIFILM X-T1", "FUJIFILM X-E2" ], "dcraw_matrix": [ 8458,-2451,-855,-4597,12447,2407,-1475,2482,6526 ], // DNG D65 // "dcraw_matrix": [ 9289,-3279,-632,-3539,11137,2758,-1049,1950,6544 ], // X-RITE D55 @@ -750,7 +784,7 @@ Quality X: unknown, ie we knowing to little about the camera properties to know { // Quality B "make_model": "FUJIFILM X30", - "dcraw_matrix": [ 12328,-5256,-1144,-4469,12927,1675,-87,1291,4351 ], // DNG8.7rc1 D65 + "dcraw_matrix": [ 12328,-5256,-1144,-4469,12927,1675,-87,1291,4351 ], // DNG_v8.7 D65 "ranges": { "white": 4048 } }, @@ -787,7 +821,7 @@ Quality X: unknown, ie we knowing to little about the camera properties to know { // Quality B, does not work with 12bit files "make_model": "Nikon D750", - "dcraw_matrix": [ 9020,-2890,-715,-4535,12436,2348,-934,1919,7086 ], // adobe dcp d65 DNGv8.7rc1 + "dcraw_matrix": [ 9020,-2890,-715,-4535,12436,2348,-934,1919,7086 ], // adobe dcp d65 DNGv8.7 "ranges": { "black": 600, "white": 16300 } // attention.. BL/WL values are for 14bit files, has to be BL150/WL4070 for 12bit files. WL typical 16383 set to 16300 for safety }, @@ -821,7 +855,7 @@ Quality X: unknown, ie we knowing to little about the camera properties to know { // quality B; Data from RusselCottrell at RT forums. sensor is not uniform "make_model": "Nikon D700", "dcraw_matrix": [ 8139,-2171,-663,-8747,16541,2295,-1925,2008,8093 ], - "ranges": { "white": 15800 } // Russell's lowest 15400.. nominal 15892 + "ranges": { "white": 15750 } // Non linearities start at 15750 (hi ISOs) 15850 (low ISOs) with long exposures (>2sec) and LENR ON .. nominal 15892 }, { // quality B, BL and colour matrix corrections for Dcraw's v9.22 r1467 preliminary support // WL set at 16300 from nominal 16380 for possible non linearities with LENR @@ -846,10 +880,28 @@ Quality X: unknown, ie we knowing to little about the camera properties to know "ranges": { "white": 4040 } // nominal 4056 }, + { // Quality B, with long exposure noise reduction White Level gets WL-BL = around 256_12bit levels less + "make_model": "OLYMPUS E-PL7", + "dcraw_matrix": [ 9197,-3190,-659,-2606,10830,2039,-458,1250,5458 ], // DNG_V8.7 D65 + "ranges": { "white": 4080 } // nominal 4093 + }, + /* since Dcraw_v9.21 Panasonic base BL is read from exif (tags 0x001c BlackLevelRed15 is BL offstet. Dcraw/RT read the base offset from exif and calculates total BL = BLbase+BLoffset, 0x001d BlackLevelGreen, 0x001e BlackLevelBlue and we define here the needed offset of around 15. The total BL is base+offset */ + { // Quality C, CameraPhone, no RAW samples but as it has the same sensor as FZ1000 .. + "make_model": "Panasonic DMC-CM1", + "dcraw_matrix": [ 8770,-3194,-820,-2871,11281,1803,-513,1552,4434 ], // dcp_v8.7 d65 + "ranges": { + "black": 15, // 15 is BL offset. Copy from FZ1000 + "white": [ + { "iso": 80, "levels": 3720 }, // copy from FZ1000 + { "iso": [ 125, 200, 400, 800, 1600, 3200, 6400, 12600, 25600 ], "levels": 4060 } // copy from FZ1000 + ] + } + }, + { // Quality A , replicated from rawimage.cc "make_model": "Panasonic DMC-FZ150", "dcraw_matrix": [ 10435,-3208,-72,-2293,10506,2067,-486,1725,4682 ], // RT, copy from custom dcp d55 @@ -858,7 +910,7 @@ Quality X: unknown, ie we knowing to little about the camera properties to know { // Quality B, New model, color data based on dng_v8.6 // Intermediate ISO and Long exposure samples missing. - "make_model": "Panasonic DMC-FZ1000", + "make_model": [ "Panasonic DMC-FZ1000", "Leica V-LUX (Typ 114)" ], "dcraw_matrix": [ 7830,-2696,-763,-3325,11667,1866,-641,1712,4824 ], // dcp_v8.6 d65 "ranges": { "black": 15, // 15 is BL offstet. Dcraw/RT read the base offset from exif and calculates total BL = BLbase+BLoffset @@ -870,7 +922,7 @@ Quality X: unknown, ie we knowing to little about the camera properties to know }, { // Quality A - "make_model": "Panasonic DMC-LF1", + "make_model": [ "Panasonic DMC-LF1", "Leica C (Typ 112)" ], "dcraw_matrix": [ 9379,-3267,-816,-3227,11560,1881,-926,1928,5340 ], "ranges": { "black": 15, "white": 4050 } // 15 is BL offstet. Dcraw/RT read the base offset from exif and calculates total BL = BLbase+BLoffset }, @@ -1007,14 +1059,13 @@ Quality X: unknown, ie we knowing to little about the camera properties to know } }, - { // Quality X, preliminary support, color data copyed from GM1 + { // Quality B, uncertainty about ISO100 WL "make_model": "Panasonic DMC-GM5", - "dcraw_matrix": [ 6770,-1895,-744,-5232,13145,2303,-1664,2691,5703 ], // GM1 + "dcraw_matrix": [ 8238,-3244,-679,-3921,11814,2384,-836,2022,5852 ], // dng_v8.7 d65 "ranges": { "black": 15, // 15 is BL offstet. Dcraw/RT read the base offset from exif and calculates total BL = BLbase+BLoffset "white": [ - { "iso": 100, "levels": 2900 }, // bell shape 2950-3250 - exif 2111 - { "iso": 160, "levels": 3600 }, // guessed from relative GX7 data + { "iso": 100, "levels": 2800 }, // bell shape 2850-3250 - exif 2111 { "iso": [ 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095 ] } @@ -1032,15 +1083,14 @@ Quality X: unknown, ie we knowing to little about the camera properties to know } }, - { // Quality C, preliminary support, color data from GX7 - "make_model": "Panasonic DMC-LX100", - "dcraw_matrix": [ 7610,-2780,-576,-4614,12195,2733,-1375,2393,6490 ], // GX7 .. measures fine DE2000=2.4 - // "dcraw_matrix": [ 6770,-1895,-744,-5232,13145,2303,-1664,2691,5703 ], // guessed ..FROM GM1 + { // Quality B, uncertainty about ISO 100 WL + "make_model": [ "Panasonic DMC-LX100", "Leica D-LUX (Typ 109)" ], + "dcraw_matrix": [ 8844,-3538,-768,-3709,11762,2200,-698,1792,5220 ], // DNG_V8.7 d65 + // "dcraw_matrix": [ 6538,-1614,-549,-5475,13096,2646,-1780,2799,5612 ], // calculated from DxO D50 "ranges": { "black": 15, // 15 is BL offstet calculated from exif data. "white": [ - { "iso": 100, "levels": 2500 }, // gaussian 2500-2700 exif linear 2111 - { "iso": 125, "levels": 3100 }, // guessed from GX7 + { "iso": 100, "levels": 2300 }, // gaussian 2400-2700 exif_linearitylimit 2111 { "iso": [ 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095 ] } @@ -1074,6 +1124,20 @@ Quality X: unknown, ie we knowing to little about the camera properties to know "dcraw_matrix": [ 8060,-2933,-761,-4504,12890,1762,-630,1489,5227 ] // D65 from Adobe's Dcp profile }, + { // Quality B, Crash on SRWs, RT normally use the embedded data with DNGs so needs adobe_coeff setting in dcraw.cc to always use the data from camconst.json for NX1 + "make_model": "Samsung NX1", + "dcraw_matrix": [ 10686,-4042,-1052,-3595,13238,276,-464,1259,5931 ], // DNG_v8.7 D65 + // "dcraw_matrix": [ 13298,-6099,-296,-5243,16153,-1235,-508,1220,7758 ], // DNG_v8.7 Standard Light A + // "dcraw_matrix": [ 9598,-3268,-634,-5678,14795,824,-1255,2675,4523 ], // SAMSUNG DNG CONVERTER + "ranges": { + "white": [ + { "iso": 100, "levels": 16050 }, // typical 16084, LE 16120 and 16383, LENR 16280 + { "iso": [ 200, 400, 800, 1600, 3200, 6400, 12800 ], "levels": 16300 }, // 16383 + { "iso": [ 25600, 51200 ], "levels": 16300 } // 16383 + ] + } + }, + { // Quality A, correction for color matrix from Colin Walker's d50 to dng d65 "make_model": "Sony NEX-C3", // "dcraw_matrix": [ 5130,-1055,-269,-4473,11797,3050,-701,1310,7121 ], // Colin walker's d50 kept for possible consistency issues @@ -1093,19 +1157,14 @@ Quality X: unknown, ie we knowing to little about the camera properties to know "raw_crop": [ 0, 0, 6024, 4024 ], "ranges": { "black": 512, "white": 16300 } }, - { // Quality A, correction for frame width black level and color matrix - "make_model": "Sony ILCE-3000", - "dcraw_matrix": [ 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 ], // adobe dcp d65 - "ranges": { "black": 512, "white": 16300 }, - "raw_crop": [ 0, 0, 5476, 3656 ] - }, + { // Quality A, correction for frame width - "make_model": "Sony ILCE-5000", + "make_model": [ "Sony ILCE-3000", "Sony ILCE-5000", "Sony ILCE-QX1" ], "dcraw_matrix": [ 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 ], // adobe dcp d65 "ranges": { "black": 512, "white": 16300 }, "raw_crop": [ 0, 0, 5476, 3656 ] }, - { // Quality B, not supported by Dcraw 9.22 - colour data from DNG v8.7rc1 d65 + { // Quality A, "make_model": "Sony ILCE-5100", "dcraw_matrix": [ 5991,-1456,-455,-4764,12135,2980,-707,1425,6701 ], // adobe dcp d65 "raw_crop": [ 0, 0, 6024, 4024 ], @@ -1117,6 +1176,12 @@ Quality X: unknown, ie we knowing to little about the camera properties to know "raw_crop": [ 0, 0, 6024, 4024 ], "ranges": { "black": 512, "white": 16300 } }, + { // Quality A, correction for frame width + "make_model": "Sony ILCE-A7M2", + "dcraw_matrix": [ 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 ], // DNGv8.7.1 + // "dcraw_matrix": [ 4913,-541,-202,-6130,13513,2906,-1564,2151,7183 ], + "ranges": { "black": 512, "white": 16300 } + }, { // Quality A, correction for frame width "make_model": "Sony ILCE-7R", "dcraw_matrix": [ 4913,-541,-202,-6130,13513,2906,-1564,2151,7183 ], diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 632b7c17f..0e37b30f1 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -8607,8 +8607,12 @@ dng_skip: memcpy (rgb_cam, cmatrix, sizeof cmatrix); raw_color = 0; } + if(!strncmp(make, "Panasonic", 9) && !strncmp(model, "DMC-LX100",9)) + adobe_coeff (make, model); if(!strncmp(make, "Samsung", 7) && !strncmp(model, "GX20",4)) adobe_coeff (make, model); + if(!strncmp(make, "Samsung", 7) && !strncmp(model, "NX1",3)) + adobe_coeff (make, model); if(!strncmp(make, "Pentax", 6) && !strncmp(model, "K10D",4)) adobe_coeff (make, model); if (raw_color) adobe_coeff (make, model); diff --git a/rtengine/dcraw.patch b/rtengine/dcraw.patch index 0fd419267..b7c059429 100755 --- a/rtengine/dcraw.patch +++ b/rtengine/dcraw.patch @@ -1,5 +1,5 @@ ---- dcraw.c 2014-07-24 16:15:36.700261700 +0200 -+++ dcraw.cc 2014-10-29 10:25:28.255138439 +0100 +--- dcraw.c 2014-12-12 22:44:15 +0000 ++++ dcraw.cc 2014-12-12 23:27:38 +0000 @@ -1,3 +1,15 @@ +/*RT*/#include +/*RT*/#include @@ -1088,18 +1088,22 @@ } else if (!strcmp(model,"C770UZ")) { height = 1718; width = 2304; -@@ -8883,6 +8607,10 @@ +@@ -8883,6 +8607,14 @@ memcpy (rgb_cam, cmatrix, sizeof cmatrix); raw_color = 0; } ++ if(!strncmp(make, "Panasonic", 9) && !strncmp(model, "DMC-LX100",9)) ++ adobe_coeff (make, model); + if(!strncmp(make, "Samsung", 7) && !strncmp(model, "GX20",4)) + adobe_coeff (make, model); ++ if(!strncmp(make, "Samsung", 7) && !strncmp(model, "NX1",3)) ++ adobe_coeff (make, model); + if(!strncmp(make, "Pentax", 6) && !strncmp(model, "K10D",4)) + adobe_coeff (make, model); if (raw_color) adobe_coeff (make, model); if (load_raw == &CLASS kodak_radc_load_raw) if (raw_color) adobe_coeff ("Apple","Quicktake"); -@@ -8899,7 +8627,7 @@ +@@ -8899,7 +8631,7 @@ if (!tiff_bps) tiff_bps = 12; if (!maximum) maximum = (1 << tiff_bps) - 1; if (!load_raw || height < 22 || width < 22 || @@ -1108,7 +1112,7 @@ is_raw = 0; #ifdef NO_JASPER if (load_raw == &CLASS redcine_load_raw) { -@@ -8978,194 +8706,246 @@ +@@ -8978,194 +8710,246 @@ } #endif @@ -1530,7 +1534,7 @@ struct tiff_tag { ushort tag, type; -@@ -9188,585 +8968,12 @@ +@@ -9188,585 +8972,12 @@ unsigned gps[26]; char desc[512], make[64], model[64], soft[32], date[20], artist[64]; };