/*
vim: set syntax=javascript:

DO NOT EDIT THIS FILE!

All changes made here will be lost on software update. If you want to add custom values or change existing ones, create
a "camconst.json" file next to your personal "options" file. Its values will then override and/or complete the ones of
this file.

If you add values for your own camera, consider sharing them with the community for everyone's benefit. You can do so
via our forum or GitHub page:
- https://discuss.pixls.us/c/software/rawtherapee
- https://github.com/Beep6581/RawTherapee/issues

Value priority:
1. If you set the dcraw matrix in your user camconst.json file for a camera entry which already exists in RT's file
    (same camera, same model), your values will replace RT's ones.
2. If you set the black level values in your user camconst.json file for a camera entry which already exists in RT's
    file, your values will replace RT's ones, even if RT's ones are more complete and/or detailed. You might want to
    copy/paste RT's levels first (if provided) to your user's file and complete/modify them.
3. Same for the white levels, independent of the black levels.

This file is in JSON format and contains camera constants which RawTherapee uses when parsing raw files.

Raw files themselves unfortunately do not contain all information needed for making a raw conversion. Typically color
response information and black/white levels are missing. That's why this file is needed.

This file is read once during startup, so if the file is updated you need to restart RawTherapee in order for changes to
take effect. The file is not intended for modification by the casual user, but advanced users can add missing camera
information to this file. If you do so, please report using the links above so that we can incorporate your changes for
everyone's benefit.

RawTherapee uses dcraw as the raw format parser. dcraw contains hard-coded camera constants, but not for all cameras,
and the values are not always accurate. For example dcraw only supports one white level, while some cameras have
different white levels per channel and per ISO. If a camera is not listed in this file the constants from dcraw will be
used. If listed here this information will override the constants in dcraw (if any).

Partial information is supported. For example if the raw file itself contains a color matrix then there is no need to
enter it here. A camera whose black level is measured on special pixels in the raw file should only have white levels
here. And so forth.

Examples:

    {
        // Make and model separated with single space, must match make and model as provided by dcraw (case-insensitive):
        "make_model": "ManufacturerA ModelB",
        // Some Panasonic and Canon DSLRs (of the lower category, such as Canon 550D) exist/ under alternate naming in
        // various marketplaces (EOS 550D, EOS Rebel T2i, EOS Kiss X4).
        // For new models that are still not supported by the dcraw version used in current RT, we have to fill all the
        // alternate names or else RT will not recognize the alternate model names.
        // For models supported by dcraw, filling the alternate names is simply desired (for better user info).
        // The format of multiple naming is to write all names in brackets i.e instead of
        // "make_model": "Canon EOS 550D",
        // type
        // "make_model": [ "Canon EOS 550D", "Canon EOS Rebel T2i", "Canon EOS Kiss X4" ],

        // ColorMatrix with CIE Standard Illuminant D65, in dcraw format:
        "dcraw_matrix": [ 7530, -1942, -255, -4318, 11390, 3362, -926, 1694, 7649 ],

        // Black level (or black offset if a base black is already extracted from Exif by dcraw, see Panasonic,
        // recent Nikon). For some rare cases where dcraw detects wrong black level we need to correct it with
        // absolute black i.e one that is not added up the detected. For this job we have to define "black" as
        // 65535+desired_black. For example to correct a wrongly detected black level of 9 instead of the correct
        // 600 we define "black": 66135, i.e. 65535+600, and white level same for all colors at all ISOs.
        "ranges": { "black": 10, "white": 1000 },

        // Crop away masked sensor borders, 10 pixels left, 20 pixels top, resulting image width/height 4000x3000.
        // Instead of width/height you can write a negative number which specifies how much of right/bottom border
        // that should be removed but keep in mind that sometimes after converting to DNG the borders are already
        // cropped so the "negative number" way is not totally safe.
        "raw_crop": [ 10, 20, 4000, 3000 ],

        // multi-aspect support (added 2020-12-03)
        // "frame" defines the full dimensions the crop applies to
        // (with [0, 0] being the fallback crop if none of the other applies)
        "raw_crop" : [
           { "frame" : [4100, 3050], "crop": [10, 20, 4050, 3020] },
           { "frame" : [0, 0], "crop": [10, 20, 4000, 3000] }
        ]

        // Almost same as MaskedAreas DNG tag, used for black level measuring. Here up to two areas can be defined
        // by tetrads of numbers:
        "masked_areas": [ 51, 2, 3804, 156, 51, 5794, 3804, 5792 ],
        // Two tetrads define two areas. The difference vs "raw_crop" is the meaning of the numbers which here are
        // expressing the absolute distance (in pixels) of each side of each rectangular "masked area" from the top
        // and left side of the sensor
        // - the first number is the distance of the top edge from the sensor's top
        // - the second is the distance of the left side from the sensor's left
        // - the third is the distance of the bottom side from the sensor's top
        // - the fourth is the distance of the right side from the sensor's left
        // It is useful after detecting the masked areas, to not fully use these areas but leave a border of 2-4 pixels
        // instead, to take care of possible light leaks from the light sensing area to the optically black (masked)
        // area or sensor imperfections at the outer borders.

        // multi-aspect support (added 2020-12-03)
        // "frame" defines the full dimensions the masked areas apply to
        // (with [0, 0] being the fallback crop if none of the other applies)
        "masked_areas" : [
           { "frame" : [4100, 3050], "areas": [10, 20, 4050, 3020] },
           { "frame" : [0, 0], "areas": [10, 20, 4000, 3000] }
        ]

        // list of indices of the rows with on-sensor PDAF pixels, for cameras that have such features. The indices here form a pattern that is repeated for the whole height of the sensor. The values are relative to the "pdaf_offset" value (see below)
        "pdaf_pattern" : [ 0,12,36,54,72,90,114,126,144,162,180,204,216,240,252,270,294,306,324,342,366,384,396,414,432,450,474,492,504,522,540,564,576,594,606,630 ],
        // index of the first row of the PDAF pattern in the sensor (0 is the topmost row). Allowed to be negative for convenience (this means that the first repetition of the pattern doesn't start from the first row)
        "pdaf_offset" : 3
    },

    {
        "make_model": "ManufacturerA ModelB",
        "dcraw_matrix": [ 7530,-1942,-255,-4318,11390,3362,-926,1694,7649 ],

        // Black and white levels per ISO per channel.
        // In this example there are only two ISOs - normally the list should be more populated.
        // When RawTherapee asks for black/white levels for a specific ISO the closest match is picked.
        "ranges": {
            "black": [
                { "iso": 100,  "levels": 10 }, // here only one level, same level for all channels
                { "iso": 3200, "levels": [ 50, 60, 50 ] } // 3 levels, G2 same as G1
            ],
            "white": [
                { "iso": 100,  "levels": [ 10000, 11000, 10000, 12000 ] }, // 4 levels, G1 and G2 different
                { "iso": 3200, "levels": [ 11000, 11000, 10000, 12000 ] }
            ]
        }
    }


How to Measure White Levels:
----------------------------

    dcraw provides the default values used by RawTherapee, but often provides too high white levels, and only provides a
    single value regardless of color channel, ISO or aperture. If you open an image with a large clipped area and that
    is rendered in a pink/magenta color rather than white it usually means that the white level constant is too high. You can
    fix this by adjusting white-point correction in the Raw tab > Raw White Points, or permanently fix it by measuring and
    providing a more exact white level in camconst.json so RawTherapee gets to know from start where the camera actually
    clips. Providing a complete and detailed white-level profile can be a quite large and complicated effort. As an
    alternative you can provide a simpler profile.We suggest one of the following alternatives in rising difficulty
    (and generally diminishing return):
    A) Provide a single white-level value measured on the native ISO (base ISO). For many cameras this will actually be
    complete information, those that don't vary on channel, ISO or aperture.
    B) Check through all ISOs and if there are differences in white level provide an array with white level per ISO.
    C) In addition to ISO, check for aperture scaling and add that.
    D) In addition to ISO and aperture scaling check for color channel differences and add that.

    Doing A is often better than nothing, as dcraw's default is often too high.B can also be worthwhile for some cameras (or
    else you'll get pink highlights for some ISOs), while C and D can generally be seen as fine-tuning.

    Here follows a guide how to measure white levels (clipping levels):

    Shoot with your camera into a bright light source, such as a lamp, and make sure the shutter speed is long enough to get
    overexposure (we want clipping!). Preferably overexpose lightly, say 1 or 2 stops if you can. The reason for this is that
    some cameras with fuzzy white levels may look less fuzzy than they actually are if over-exposure is heavy.

    Use f/5.6 or smaller aperture (=larger f-number) to avoid any raw scaling the camera might have for large apertures.

    Open the file in a raw analyzer such as RawDigger and check the pixel values for the clipped areas (if you are using
    RawDigger, make sure you have disabled"subtract black" in preferences or else sample values can be wrong). In
    this stage we always look at white level before black level subtraction! White levels can be different on color
    channel (R, G1, B, G2, note the two greens, most often both green channels have the same white level though) and
    vary depending on ISO setting, so if you want to provide a complete profile make one shoot for each ISO (even 1/3
    steps, so yes it can be quite a lot of pictures to shoot and check).

    In addition, many cameras scale the raw values for large apertures. It's generally not that important to cover this, but
    if you want to extract most out of the camera you should cover this too. Then you need to shoot with a wide aperture
    lens (ideally the widest available from the manufacturer) and test each aperture (1/3 steps) from the widest (say f/1.2)
    until the camera stops scaling the raw values (usually f/2.8 or f/4.0). If the camera also have ISO scaling you need to
    shoot at these different ISOs to detect any differences in scaling, there can be a bit of variation. If you don't have
    access to the widest lens available for the system (say only an f/1.8 lens instead of an f/1.2) it can still be valuable
    to have the values down to what you can provide. Brands known to have models that have aperture scaling of white levels
    include Canon and Nikon. Note that if white levels are not scaled the camera may have raw scaling anyway (Sony for
    example), but as such scaling will not affect raw decoding we don't need to care about that.

    PROVIDE CONSERVATIVE VALUES. Most cameras have a little noise at the white level, and some can have a lot. In your raw
    analyzer, move around and look at the values in the clipped areas to get a sense of the variation, and/or look at the
    histogram. While it's common to with very little variation, say only +/-2 units, some can have +/-500 or more (some may
    have different variation depending on ISO). There can also be camera-to-camera variation.

    If the white level is set too high RawTherapee will not think the pixels are clipped and you can get discolored
    highlights (usually pink), this is what we want to avoid. If white level is set too low RawTherapee will clip early, ie
    you lose a little highlight detail, but the color is rendered correctly and highlight reconstruction can work properly,
    so this is not as bad. This is why we want conservative values.

    By conservative values we mean that if you see a white level of most often 15760 and occasionally 15759 (i.e. very small
    variation of white level which is a common case), you set the white level around 50-100 14-bit units below or
    10-20 12-bit units. Say at 15700 in this example, or 4080 instead of 4095 for 12-bit raws. This way we get a little margin
    from noise and camera variation. Since sensor raw values are linear, you lose, for example,
    log2(1-50/15760) = -0.005 stops of detail, i.e. irrelevant. Thus it is better to provide RawTherapee with knowledge
    where the image clips rather than keeping that last 0.005 stop of highlight information and risking that clipping will
    not be detected properly.

    It is very usual for white level to be a bell distribution instead of a candle when the camera applies long exposure
    noise reduction (LENR) by subtracting a black frame and/or when the system is destabilized due to temperature. Some models have
    always a bell distribution at WL. If you have a fuzzy white level look at the linear histogram; you will probably see a
    normal/Gaussian distribution (bell shape) noise peak at clipping and probably also a peak at a hard raw data clip level
    usually at or close to a power of two - 1, such as 4095 or 16383. Then you pick a value just before the bell shape
    rises, i.e. to the left of the bell meaning that you cut away the whole fuzzy noise peak. If a little of the starting edge
    of the noise will be included it's not harmful, but 99% of it should be above. This would mean that it's better to
    measure white level on long exposure/high temp raws but since this if difficult and time consuming we choose to measure
    on normal raws and cover the abnormalities with the conservative WL values. A more detailed approach when we only have
    non-LENR measures is to subtract a value according to per ISO read noise. We can find data regarding read noise (stdev
    of Gaussian distribution) at http://www.photonstophotos.net/Charts/RN_ADU.htm . We find the per ISO tead_noise and
    subtract from the measured value 6*read_noise. This gives confidence that 99.5% of the bell is clipped out.

    If you have used Adobe's DNG Converter and analyzed it's output you may have noticed that it's very conservative
    regarding white levels, i.e. it cuts away quite a lot from the top. While we also recommend to be conservative, you can
    generally be a little bit less so than Adobe's DNG Converter. RawTherapee is meant to max out what you can get from your
    camera, and the white levels should mirror that, within reason.

    The aperture scaling feature is meant to raise the white level to not miss out on highlight detail when the camera has
    scaled the raw values (and thus raised white levels). Many cameras do this, but not all, and can only do it for lenses
    that report aperture to the camera (i.e. you see it in the Exif data). Providing proper aperture scaling values is a bit
    more advanced task, so if you are unsure we recommend to skip that part.

    Beware that the raw format may have a ceiling so that it clips scaled values, for example the Canon 5D mark II maxes out
    at 16383 which happens at f/1.8 for ISOs with the white level at 15750, but for ISO160 when the white level is 12800 it
    does not max out. If there is such a raw limit it must also be provided ("ranges":"white_max"). Usually you will not
    need a margin on white_max as it clips there as a result of an in-camera math operation.

    Note that aperture scaling can be quite small, for the 5D mark II it's only 0.2 stop down to f/1.2 and then it can be
    discussed if it's worthwhile to care. The "worst" cameras scale about 0.6 stops though, and then it's more valuable to
    compensate. If you skip aperture scaling RawTherapee will clip the files a little bit too early and you miss that last
    fraction of highlight detail, but you get no processing problems. Setting un-conservative scale factors can on the other
    hand cause a too high white level and break highlight processing, so be careful.

    Scaling can vary slightly depending on ISO (if white levels vary) so make sure to provide conservative scalings so
    regardless of ISO you don't get a too high white level. We recommend to keep a small margin here also white levels,
    i.e. 0.5% lower or so. For example if base (not conservative!) white level is 15750 and the scaled is 16221 we have a
    scaling factor of 16221/15750=1.0299 i.e. +2.9% we set the factor to 1.025 to keep a margin. The abnormal cases are
    already covered by setting conservative per ISO White levels.

    The scale factor you provide here is applied on the white level before black level subtraction (if any), i.e. directly on
    the white level value you provide in the camconst.json file. Black level (if provided) is not scaled. Please report to
    us if you come across a camera which scales black levels, then we can add that as an option. Usually the camera applies
    an offset to shift back the black level to the standard level after scaling.

    If RawTherapee doesn't find an entry for the aperture used in the image, it will pick the closest above, i.e. if the
    apertures 1.0 and 2.0 is in the table and the image has aperture 1.2, it will pick scaling for 2.0, even if 1.0 is the
    closer aperture. The reason for always checking the closest above is that we rather get a bit too low white level than
    too high, as discussed before.

    Some cameras have different white levels on different color channels. When this is the case the difference is often so
    small so you can just provide a single value instead, i.e. a conservative value based on the lowest clipping.

    What we know at the time of writing about different brands/models (not complete info):
    - Canon CR2: typically same clipping per channel, but significant variations on ISO and aperture. Maxes out at 16383,
      black level measured on masked black pixels, i.e. don't provide that.
    - Nikon NEF: sometimes different clipping per color (most often negligible though). Will do aperture and ISO scaling,
      but often to a lesser extent than Canon files, i.e. not as much to gain.
    - Sony ARW2: no scaling. Generally black level around 512, and white level 16350 and to be conservative say 16300.

    Note that some raw formats may go through a certain amount of pre-processing based on meta data, such as curve and
    levels adjustments and various calibrations. The Phase One IIQ is one example, and this means that if you look at the
    data in a raw analyzer such as RawDigger it may perform a different type of preprocessing than RawTherapee's loader
    does, and you may end up providing incompatible black/white levels.

    You can use RawTherapee for analysis too, it's safer as you are using it's own raw decoder but it's not as
    user-friendly: enable verbose mode in options so you get output on the console. When you load a file you will see a
    message of current black and white levels and if they came from dcraw or camconst.json. If you're adjusting an existing
    camconst.json value you can just read what it is in the file and not need to enable verbose output.

    Reset exposure sliders to neutral, and zoom in on a large clipped highlight. Move around the mouse pointer within, it
    should show stable 100% on R G B. If so, the white level is not too high, it could however be too low. To test that, go
    to the raw tab and adjust the "white point linear correction factor", reduce it until one of the channels is no longer
    100%, and then increase in steps of 0.01 until all are 100 again. Usually you play around in the range 0.90 to 0.99, i.e.
    a very small adjustment. When you've found this factor you should apply it on the old white level to find a new larger
    one. As RT's "white point linear correction factor" work after black level subtraction and camconst.json want values
    without it we need to do some math:

    BL = black level (typically something near 0, 256, 512, 1024 or 2048 find it in the verbose output or if available in
         camconst.json)
    F =  white point linear correction factor you just found out (typically in the range 0.90 to 0.99 if you need to
         increase white level, 1.01 to 1.10 if decrease)
    oldWL = old white level, found in verbose output or in camconst.json if available.
    newWL = BL + (oldWL - BL) / F

    Note that if black level is 0 which it is for many cameras, the formula simplifies to: new white level = oldWL / F.

    Here's an example from a Canon 1000D: black level is 256, old white level is 3651, white point correction factor becomes
    0.90, then new white level is 256 + (3651 - 256) / 0.9 = 4028.

    If your camera have different black levels per channel use the one which yields the smallest white level (can be the
    largest or smallest, test!).

    This new white level you then enter in your camconst.json file. The same procedure can be used if the white level is too
    high, i.e. if you see pink highlights, then increase the correction factor above 1.0 until you just start seeing stable
    100% on all channels, you use the same formula to calculate the new smaller white level.


About black levels:
-------------------

    Unlike for white levels it's much more common that black levels can be derived from the format. Either it's simply
    0 (typical for old Nikon cameras, newer Nikons (year 2013-14) have a BL at around 150 12-bit or 600/768 14-bit ), or it
    can be derived from masked pixels (typical for Canon cameras) or otherwise be extracted from some tag.

    Some formats have built-in subtraction information and are pre-processed by dcraw to end up at a black level of
    zero (Phase One's IIQ).

    For Panasonic cameras, the black level defined in camconst.json is the black level offset, which comes from
    BlackLevel3 + BlackLevel2. RawTherapee then reads the base black levels from Exif data (0x001c BlackLevelRed,
    0x001d BlackLevelGreen and 0x001e BlackLevelBlue) and adds them to the offset.

    In all, you typically should not care about the black level in camconst.json, any information that can be derived from
    the raw file itself should not be specified in camconst.json! Sony's ARW2 is one of the few exceptions (with a single
    black level around 512, or 800 for RX10/100 models), but dcraw generally has good constants for these already.

    Currently we have chosen not to provide any guide how to measure black levels as we don't think it will be a common task
    (it's also more difficult to do than measure white levels). If you experience a black level issue it's more likely due
    to a format parsing bug which should be fixed in dcraw and/or RawTherapee's raw format parser.

    How does a black level issue look? If the image has a color cast and is possibly duller than normal it's likely that
    black levels are off. The color cast is typically stronger in darker colors but it can be hard to see, it's more often
    experienced as a cast over the whole image.


Camera constants:
-----------------

    When adding camera constants please set a quality level so we know the status for future updates

    Quality A: complete information, no need to add more, to the best of our knowledge
    Quality B: not complete, but very little to gain from adding more
    Quality C: complementing with additional information would provide significant gain
    Quality X: unknown, i.e. we know too little about the camera properties to know if we have enough info.

*/

{"camera_constants": [

    { // Quality A
        "make_model": "Canon EOS 5D Mark II",
        "dcraw_matrix": [ 4716,603,-830,-7799,15474,2480,-1496,1937,6651 ],
        "ranges": {
            // black levels are read from raw masked pixels
            // white levels are same for all colors, but vary on ISO
            "white": [
                { "iso": 50,  "levels": 15600 }, // typical: 15760
                { "iso": 100, "levels": 15600 },
                { "iso": 125, "levels": 15600 },
                { "iso": 160, "levels": 12700 },
                { "iso": 200, "levels": 15600 },
                { "iso": 250, "levels": 15600 },
                { "iso": 320, "levels": 12700 }, // typical: 12810
                { "iso": 400, "levels": 15600 },
                { "iso": 500, "levels": 15600 },
                { "iso": 640, "levels": 12700 },
                { "iso": 800, "levels": 15600 },
                { "iso": 1000, "levels": 15600 },
                { "iso": 1250, "levels": 12700 },
                { "iso": 1600, "levels": 15600 },
                { "iso": 2000, "levels": 15600 },
                { "iso": 2500, "levels": 15600 },
                { "iso": 3200, "levels": 15600 },
                { "iso": 4000, "levels": 15600 },
                { "iso": 5000, "levels": 15600 },
                { "iso": 6400, "levels": 16200 }, // typical: 16383
                { "iso": 12800, "levels": 16200 },
                { "iso": 25600, "levels": 16200 }
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for and f/1.0 (had no lenses to test with), but the typical 15700 white level
                // maxes out at "white_max" for f/1.8 and below anyway.
                { "aperture": 1.2, "scale_factor": 1.100 }, // guessed by relative 5DIII data
                { "aperture": 1.4, "scale_factor": 1.077 },
                { "aperture": 1.6, "scale_factor": 1.054 },
                { "aperture": 1.8, "scale_factor": 1.039 },
                { "aperture": 2.0, "scale_factor": 1.031 },
                { "aperture": 2.2, "scale_factor": 1.021 },
                { "aperture": 2.5, "scale_factor": 1.016 },
                { "aperture": 2.8, "scale_factor": 1.010 },
                { "aperture": 3.2, "scale_factor": 1.004 },
                { "aperture": 3.5, "scale_factor": 1.003 }
            ]
        }
    },

    { // Quality C
        "make_model": "Canon EOS-1Ds",
        "dcraw_matrix": [ 3925, 4060, -1739, -8973, 16552, 2545, -3287, 3945, 8243 ] // DNG
    },

    { // Quality C, INTERMEDIATE ISO SAMPLES MISSING
        "make_model": "Canon EOS-1D X Mark II",
        "dcraw_matrix": [ 7596,-978,-967,-4808,12571,2503,-1398,2567,5752 ],
        //"raw_crop": [ 192, 96, 8696, 5800 ], // Full sensor 5568x3708 top38, left72, official crop left84, top50, right5555, bottom3697, 5472X3648
        //"masked_areas": [ 50, 4, 3697, 68 ], // left out 4 first columns from calculations because possibly the BL is still imbalanced there
        "ranges": {
            // black levels are read from raw masked pixels
            // white levels are same for all colors all ISOs, but safety margin vary on ISO
            // actually not, 160 & 320 & 640 seem to have different white levels per color
            "white": [
                { "iso": 50,  "levels": 16350 }, // typical for all ISOs: 16383, stdev 2.25
                { "iso": 100, "levels": 16350 }, // stdev 2.25
                { "iso": [ 125, 200, 250 ], "levels": 16340 }, // stdev 2.5
                { "iso": 160, "levels": [ 16340, 14450, 15600 ] }, // based on CarVac's testing
                { "iso": [ 400, 500 ], "levels": 16330 }, // stdev 2.95
                { "iso": 320, "levels": [ 16330, 16000, 16330 ] }, // based on CarVac's testing
                { "iso": [ 800, 1000 ], "levels": 16320 }, // stdev x, 4.0 , x
                { "iso": 640, "levels": [ 16320, 15800, 16320 ] }, // based on CarVac's testing
                { "iso": [ 1600, 2000 ], "levels": 16300 }, // stdev x, 6.0 , x
                { "iso": 1250, "levels": [ 16300, 16050, 16300 ] }, // based on CarVac's testing
                { "iso": [ 2500, 3200, 4000 ], "levels": 16250 }, // STDEV x, 9.8 , x
                { "iso": [ 5000, 6400, 8000 ], "levels": 16150 }, // stdev x, 17, x
                { "iso": [ 10000, 12800, 16000 ], "levels": 16100 }, // stdev x, 34 , x
                { "iso": [ 20000, 25600, 32000 ], "levels": 16000 }, // stdev x, 68 , x
                { "iso": [ 40000, 51200, 64000 ], "levels": 15700 }, // stdev x, 125, x
                { "iso": [ 80000, 102400 ], "levels": 15100 }, // stdev x, 245
                { "iso": [ 204800 ], "levels": 14000 },
                { "iso": [ 409600 ], "levels": 13000 }
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no need for aperture scaling because typical WL is 16383 at all ISOs
                { "aperture": 1.2, "scale_factor": 1.130 }, // guessed by relative 6D data
                { "aperture": 1.4, "scale_factor": 1.090 },
                { "aperture": 1.6, "scale_factor": 1.060 },
                { "aperture": 1.8, "scale_factor": 1.040 },
                { "aperture": 2.0, "scale_factor": 1.030 },
                { "aperture": 2.2, "scale_factor": 1.020 },
                { "aperture": 2.5, "scale_factor": 1.015 },
                { "aperture": 2.8, "scale_factor": 1.010 },
                { "aperture": 3.2, "scale_factor": 1.005 },
                { "aperture": 3.5, "scale_factor": 1.003 }
            ]
        }
    },

    { // Quality C, initial data by @agriggio, white frame samples provided by @noirsabb in #5862, color charts not processed yet
        "make_model" : "CANON EOS-1D X MARK III",
        "raw_crop": [ 72, 38, 5496, 3670 ],
        "masked_areas" : [ 40, 10, 5534, 70 ],
        "ranges" : { "white" : 16382 }
    },

    { // Quality A
        "make_model": "Canon EOS 5D Mark III",
        "dcraw_matrix": [ 6722,-635,-963,-4287,12460,2028,-909,2162,5668 ],
        "ranges": {
            // black levels are read from raw masked pixels
            // white levels are same for all colors, but vary on ISO
            "white": [
                { "iso": [ 50, 100, 125, 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 6400, 8000, 12800, 16000, 20000 ], "levels": 15180 }, // typical: 15282
                { "iso": [ 160, 320, 640, 1250, 2500, 5000, 10000 ], "levels": 13200 }, // typical: 13306
                { "iso": [ 25600, 32000, 40000, 51200, 102400 ], "levels": 16200 }
            ],
            "white_max": 16383,
            "aperture_scaling": [
                { "aperture": 1.2, "scale_factor": 1.130 },
                { "aperture": 1.4, "scale_factor": 1.090 },
                { "aperture": 1.6, "scale_factor": 1.065 },
                { "aperture": 1.8, "scale_factor": 1.040 },
                { "aperture": 2.0, "scale_factor": 1.025 },
                { "aperture": 2.2, "scale_factor": 1.020 },
                { "aperture": 2.5, "scale_factor": 1.015 },
                { "aperture": 2.8, "scale_factor": 1.010 },
                { "aperture": 3.2, "scale_factor": 1.005 },
                { "aperture": 3.5, "scale_factor": 1.002 }
            ]
        }
    },

    { // Quality B, some intermediate ISO samples missing, LENR samples missing so White Levels not properly indicated, some aperture scaling missing
        "make_model": "Canon EOS 5D Mark IV",
        "global_green_equilibration" : true,
        "dcraw_matrix": [ 6445,-366,-864,-4436,12204,2513,-953,2496,6348 ], // DNG v13.2
        "raw_crop": [ 136, 42, 6740, 4500 ], // full size 6880x4544, official crop 148,54,6867,4533
        "masked_areas": [ 54, 4, 4534, 132 ],
        "ranges": {
            "white": [
                { "iso": [ 100, 125, 200, 250 ], "levels": 16100 }, // nominal 16383, LENR?
                { "iso": [ 160 ], "levels": 13000 }, // nominal f8-13105
                { "iso": [ 320, 640, 1250, 2500 ], "levels": 13300 }, // G1,G2 F4.0-13422-F2.8-13562-13616
                { "iso": [ 5000, 10000, 20000 ], "levels": 13200 }, // G1,G2 F4.0-13422-F2.8-13562-13616
                { "iso": [ 400, 500, 800, 1000, 1600, 2000, 3200, 4000 ], "levels": 16100 }, // nominal 16383,
                { "iso": [ 6400, 8000, 12800, 16000, 25600, 32000 ], "levels": 16000 }, // R,G1,G2 16383, LENR?
                { "iso": [ 40000, 51200, 102400 ], "levels": 15800 } // 16383, LENR?
            ],
            "white_max": 16383,
            "aperture_scaling": [
                /* need more data to properly fill all scale factors */
                { "aperture": 1.4, "scale_factor": 1.160 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.120 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.080 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.050 }, // 14171/13422=1.055
                { "aperture": 2.2, "scale_factor": 1.035 }, // 13954/13422=1.039
                { "aperture": 2.5, "scale_factor": 1.025 }, // 11400/11000=1.028
                { "aperture": 2.8, "scale_factor": 1.015 }, // 13562/13422 - 13731,13688,13562
                { "aperture": 3.2, "scale_factor": 1.010 }, // guessed
                { "aperture": 3.5, "scale_factor": 1.005 } // 13508/13422
            ]
        }
    },

    { // Quality C, intermediate ISO samples missing but safely guessed, aperture scaling measures missing
        "make_model": [ "Canon EOS 5DS R", "Canon EOS 5DS" ],
        //"dcraw_matrix": [ 6848,-1661,-221,-3904,10931,3434,-470,1251,6039 ], // DNG_V9.0 A
        "dcraw_matrix": [ 6250,-711,-808,-5153,12794,2636,-1249,2198,5610 ], // DNG_V9.0 D65
        "raw_crop": [ 192, 96, 8696, 5800 ], // 800, 300, 7500, 4700 - 160,64,8730x5800 - sensor 8896x5920 top64, left160, official crop left196, top100, right 8883, bottom 5891, 8688X5792
        "masked_areas": [ 100, 40, 5892, 158 ], // left out 40 first columns from calculations because possibly the BL is still imbalanced there
        "ranges": {
            "white": [
                { "iso": [ 50, 100 ], "levels": 14650 }, // typical 14733
                { "iso": [ 160, 320, 640, 1250, 2500, 5000 ], "levels": 15280 }, // typical 15383
                { "iso": [ 125, 200, 250, 400, 500, 800, 1000, 1600, 2000 ], "levels": 15280 }, // typical R15330-GB15383
                { "iso": [ 3200, 4000, 6400, 8000, 10000, 12800, 16000, 20000, 25600 ], "levels": 15100 } // clippings at R 15200-15300, G1,G2,B 15360-15390
            ],
            "white_max": 16383,
            "aperture_scaling": [
                { "aperture": 1.4, "scale_factor": 1.150 }, // 37/32 6-0-6-0-7-0-6-0-7-0
                { "aperture": 1.6, "scale_factor": 1.070 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.040 }, // 15501/14733=1.0521, 15352/14733=1.042 16030/15390
                { "aperture": 2.0, "scale_factor": 1.025 }, // 15129/14733=1.0268 - 15800/15383=1.027
                { "aperture": 2.2, "scale_factor": 1.013 }, // 15591/15383, 14931/14733
                { "aperture": 2.5, "scale_factor": 1.008 }, // 14857/14733
                { "aperture": 2.8, "scale_factor": 1.003 }, // 14783/14733 15435/15383
                { "aperture": 3.2, "scale_factor": 1.001 }, // 15409/15383
                { "aperture": 3.5, "scale_factor": 1.000 } // 14733/14733
            ]
        }
    },

    { // Quality A, some missing scaling factors are safely guessed - samples by sfink16 & RawConvert at RT forums
        "make_model": "Canon EOS 6D",
        "dcraw_matrix": [ 7034,-804,-1014,-4420,12564,2058,-851,1994,5758 ],
        "ranges": {
            "white": [
                { "iso": [ 50, 100, 125, 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200 ], "levels": 15180 }, // typical 15283
                { "iso": [ 4000, 6400, 8000, 12800 ], "levels": 15100 }, // typical 15283
                { "iso": [ 16000, 25600 ], "levels": 14900 }, // typical 15283
                { "iso": [ 160, 320, 640, 1250, 2500 ], "levels": 13100 }, // typical 13225
                { "iso": [ 5000, 10000 ], "levels": 13000 }, // typical 13225
                { "iso": [ 20000 ], "levels": 12800 }, // typical 13225
                { "iso": [ 51200, 102400 ], "levels": 15900 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.0 (had no lenses to test with), but the
                // ISO 160-320... 12650 white levels maxes out at "white_max" for f/1.2 and below anyway.
                { "aperture": 1.2, "scale_factor": 1.130 }, // from histogramm 1 gap in every 7 levels
                { "aperture": 1.4, "scale_factor": 1.090 }, // histogram 3 gaps in every 32 levels
                { "aperture": 1.6, "scale_factor": 1.060 }, // 16213/15283
                { "aperture": 1.8, "scale_factor": 1.040 }, // 16004/15283
                { "aperture": 2.0, "scale_factor": 1.030 }, // 15800/15283
                { "aperture": 2.2, "scale_factor": 1.020 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.015 }, // 15541/15283
                { "aperture": 2.8, "scale_factor": 1.010 }, // 15437/15283
                { "aperture": 3.2, "scale_factor": 1.005 }, // 15361/15283
                { "aperture": 3.5, "scale_factor": 1.000 } // no sample
            ]
        }
    },

    { // Quality B, some missing scaling factors are safely guessed
        "make_model": "Canon EOS 6D Mark II",
        "dcraw_matrix": [ 6875,-970,-932,-4691,12459,2501,-874,1953,5809 ], // DNG v_9.12 D65
        "raw_crop": [ 120, 44, 6264, 4180 ], // fullraw size 6384x4224 useful 120,44,6264x4180 // TODO: See EOS RP
        // "raw_crop": [ 128, 52, 6248, 4168 ], // official jpeg crop 120+12,44+12,6240x4160
        "masked_areas": [ 44, 4, 4220, 116 ],
        "ranges": {
            "white": [
                { "iso": [ 50, 100, 125, 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200 ], "levels": 16300 }, // typical 16383
                { "iso": [ 4000, 6400, 8000, 12800 ], "levels": 16200 }, // typical 16383
                { "iso": [ 16000, 25600 ], "levels": 16100 }, // typical 16383
                { "iso": [ 160 ], "levels": 13000 }, // typical 13044
                { "iso": [ 320, 640, 1250, 2500 ], "levels": 13250 }, // typical 13337
                { "iso": [ 5000, 10000 ], "levels": 13100 }, // typical 13367
                { "iso": [ 20000, 40000 ], "levels": 12900 }, // typical 13367
                { "iso": [ 51200, 102400 ], "levels": 15900 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.0 (had no lenses to test with), but the
                // ISO 160-320... 13044 white levels maxes out at "white_max" for f/1.2 and below anyway.
                { "aperture": 1.2, "scale_factor": 1.130 }, // guessed
                { "aperture": 1.4, "scale_factor": 1.100 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.080 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.060 }, // 13890/13044=1.065 11284/10512 = 1.073
                { "aperture": 2.0, "scale_factor": 1.040 }, // 13602/13044=1.042 11151/10512 = 1.060
                { "aperture": 2.2, "scale_factor": 1.030 }, // 10982/10512=1.045
                { "aperture": 2.5, "scale_factor": 1.020 }, // 10840/10512 = 1.030
                { "aperture": 2.8, "scale_factor": 1.010 }, // 13530/13367= 1.012 - 12225/12048 = 1.015
                { "aperture": 3.2, "scale_factor": 1.005 }, // 12194/12048 = 1.012
                { "aperture": 3.5, "scale_factor": 1.000 } // 12092/12048 = 1.004
            ]
        }
    },

    { // Quality B, taken from 6D Mark II because identical sensor (different matrix)
        "make_model": "Canon EOS RP",
        "dcraw_matrix": [ 8608,-2097,-1178,-5425,13265,2383,-1149,2238,5680 ], // DNG v13.2
        // Let dcraw handle crop, because camconst shouldn't override for different crop factors. See #6255
        "masked_areas": [
            {"frame": [0, 0], "areas": [ 44, 4, 4220, 116 ]},
            {"frame": [4032, 2656], "areas": [ 44, 4, 2652, 108 ]}
        ],
        "ranges": {
            "white": [
                { "iso": [ 50, 100, 125, 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200 ], "levels": 16300 }, // typical 16383
                { "iso": [ 4000, 6400, 8000, 12800 ], "levels": 16200 }, // typical 16383
                { "iso": [ 16000, 25600 ], "levels": 16100 }, // typical 16383
                { "iso": [ 160 ], "levels": 13000 }, // typical 13044
                { "iso": [ 320, 640, 1250, 2500 ], "levels": 13250 }, // typical 13337
                { "iso": [ 5000, 10000 ], "levels": 13100 }, // typical 13367
                { "iso": [ 20000, 40000 ], "levels": 12900 }, // typical 13367
                { "iso": [ 51200, 102400 ], "levels": 15900 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.0 (had no lenses to test with), but the
                // ISO 160-320... 13044 white levels maxes out at "white_max" for f/1.2 and below anyway.
                { "aperture": 1.2, "scale_factor": 1.130 }, // guessed
                { "aperture": 1.4, "scale_factor": 1.100 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.080 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.060 }, // 13890/13044=1.065 11284/10512 = 1.073
                { "aperture": 2.0, "scale_factor": 1.040 }, // 13602/13044=1.042 11151/10512 = 1.060
                { "aperture": 2.2, "scale_factor": 1.030 }, // 10982/10512=1.045
                { "aperture": 2.5, "scale_factor": 1.020 }, // 10840/10512 = 1.030
                { "aperture": 2.8, "scale_factor": 1.010 }, // 13530/13367= 1.012 - 12225/12048 = 1.015
                { "aperture": 3.2, "scale_factor": 1.005 }, // 12194/12048 = 1.012
                { "aperture": 3.5, "scale_factor": 1.000 } // 12092/12048 = 1.004
            ]
        }
    },

    { // Quality A, ISO and aperture WL data by CharlyW at RawTherapee forums, missing samples safely guessed
        "make_model": "Canon EOS 7D",
        "dcraw_matrix": [ 5962,-171,-732,-4189,12307,2099,-911,1981,6304 ], // Colin Walker
        //"dcraw_matrix": [ 6843,-996,-856,-3876,11761,2396,-593,1772,6198 ], // DNG v13.2
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13584
                { "iso": [ 160, 320, 640, 1250, 2500 ], "levels": 12550 }, // typical 12650
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 5000, 6400, 12800 ], "levels": 15200 } // typical 15304
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (no lenses to test with), but the
                // typical 12650 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.250 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.150 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.110 }, // 15196/13584
                { "aperture": 2.0, "scale_factor": 1.080 }, // 14734/13584
                { "aperture": 2.2, "scale_factor": 1.050 }, // 14386/13584
                { "aperture": 2.5, "scale_factor": 1.040 }, // 14272/13584
                { "aperture": 2.8, "scale_factor": 1.030 }, // 14042/13584
                { "aperture": 3.2, "scale_factor": 1.015 }, // guessed
                { "aperture": 3.5, "scale_factor": 1.000 } // guessed negligible
            ]
        }
    },

    { // 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
        "raw_crop": [ 72, 38, 5496, 3669 ],
        "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": [
                /* 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": [ 6070,-746,-856,-7652,15365,2442,-2026,2553,7314 ], // DNG v13.2
        "raw_crop": [ 30, 18, 3908, 2602 ],
        "masked_areas": [ 20, 2, 2616, 20 ],
        "ranges": {
            "white": [
                { "iso": 100, "levels": 13700 }, // typical 13825
                { "iso": [ 125, 250, 500, 1000, 3200 ], "levels": 16280 }, // typical 16383
                { "iso": [ 160, 320, 640 ], "levels": 12600 }, // typical 12744
                { "iso": [ 200, 400 ], "levels": 16100 }, // typical 16224
                { "iso": 800, "levels": 15900 }, // gaussian histogram 15900-16224
                { "iso": 1600, "levels": 14900 }, // gaussian histogram 14900-15750
                { "iso": 1250, "levels": 11900 } // gaussian histogram 11900-12500
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (had no lenses to test with), but the
                // typical 12700 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.265 }, // 16142/12744
                { "aperture": 1.6, "scale_factor": 1.145 }, // 15872/13825
                { "aperture": 1.8, "scale_factor": 1.090 }, // 15103/13825
                { "aperture": 2.0, "scale_factor": 1.035 }, // 14334/13825
                { "aperture": 2.2, "scale_factor": 1.005 }, // 13950/13825
                { "aperture": 2.5, "scale_factor": 1.000 } // 13825/13825
            ]
        }
    },

    { // Quality A, ISO and aperture WL data by Ayshih at Magic Lantern forums
        "make_model": "Canon EOS 50D",
        "dcraw_matrix": [ 4920,616,-593,-6494,13965,2784,-1774,3178,7004 ], // DNG v13.2
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13300 }, // typical 13432
                { "iso": [ 160, 320, 640, 1250 ], "levels": 12700 }, // typical 12790-12810
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 2500, 3200 ], "levels": 15630 }, // typical 15763-15733
                { "iso": [ 6400, 12800 ], "levels": 16200 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                { "aperture": 1.4, "scale_factor": 1.270 },
                { "aperture": 1.6, "scale_factor": 1.150 },
                { "aperture": 1.8, "scale_factor": 1.090 },
                { "aperture": 2.0, "scale_factor": 1.040 },
                { "aperture": 2.2, "scale_factor": 1.020 },
                { "aperture": 2.5, "scale_factor": 1.010 },
                { "aperture": 2.8, "scale_factor": 1.000 },
                { "aperture": 3.2, "scale_factor": 1.000 }
            ]
        }
    },

    { // Quality A, ISO and aperture WL data copied from Shalrath's 60D data at RawTherapee forums
        "make_model": "Canon EOS 60Da",
        "dcraw_matrix": [ 17492,-7240,-2023,-1791,10323,1701,-186,1329,5406 ], // 60Da dng d65
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13583
                { "iso": [ 160, 320, 640, 1250, 2500 ], "levels": 12550 }, // typical 12650
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 5000, 6400, 12800 ], "levels": 15200 } // typical 15304
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (had no lenses to test with), but the
                // typical 12650 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.300 }, // gaps 81of301
                { "aperture": 1.6, "scale_factor": 1.200 },
                { "aperture": 1.8, "scale_factor": 1.140 },
                { "aperture": 2.0, "scale_factor": 1.080 }, // gaps 1of11
                { "aperture": 2.2, "scale_factor": 1.060 },
                { "aperture": 2.5, "scale_factor": 1.050 },
                { "aperture": 2.8, "scale_factor": 1.030 },
                { "aperture": 3.2, "scale_factor": 1.015 },
                { "aperture": 3.5, "scale_factor": 1.000 } // no sample but it would be negligible
            ]
        }
    },

    { // Quality A, ISO and aperture WL data by Shalrath at RawTherapee forums
        "make_model": "Canon EOS 60D",
        "dcraw_matrix": [ 6719,-994,-925,-4408,12426,2211,-887,2129,6051 ], // Origin unknown
        //"dcraw_matrix": [ 6941, -1164, -857, -3825, 11597, 2534, -416, 1540, 6039 ], // DNG v13.2
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13583
                { "iso": [ 160, 320, 640, 1250, 2500 ], "levels": 12550 }, // typical 12650
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 5000, 6400, 12800 ], "levels": 15200 } // typical 15304
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (had no lenses to test with), but the
                // typical 12650 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.300 }, // gaps 81of301
                { "aperture": 1.6, "scale_factor": 1.200 },
                { "aperture": 1.8, "scale_factor": 1.140 },
                { "aperture": 2.0, "scale_factor": 1.080 }, // gaps 1of11
                { "aperture": 2.2, "scale_factor": 1.060 },
                { "aperture": 2.5, "scale_factor": 1.050 },
                { "aperture": 2.8, "scale_factor": 1.030 },
                { "aperture": 3.2, "scale_factor": 1.015 },
                { "aperture": 3.5, "scale_factor": 1.000 } // no sample but it would be negligible
            ]
        }
    },

    { // Quality B, more aperture scale factors needed
        "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
                { "iso": [ 160, 320, 640, 1250, 2500, 5000 ], "levels": 12450 }, // typical 12559
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 6400, 8000, 10000 ], "levels": 15200 }, // typical 15303 - ISO 8000-10000 guessed
                { "iso": [ 12800, 25600 ], "levels": 16200 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (had no lenses to test with), but even with the
                // 12500 white levels nearly maxes out for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.240 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.160 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.110 }, // 31of35
                { "aperture": 2.0, "scale_factor": 1.060 }, // guessed
                { "aperture": 2.2, "scale_factor": 1.030 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.015 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.008 }, // 15432/15303
                { "aperture": 3.2, "scale_factor": 1.000 },
                { "aperture": 3.5, "scale_factor": 1.000 }
            ]
        }
    },

    { // Quality B, White Levels not properly indicated, aperture scaling..missing scaling factors are guessed
        "make_model": "Canon EOS 80D",
        "dcraw_matrix": [ 7457,-672,-937,-4849,12495,2643,-1213,2354,5492 ], // DNG v13.2
        "raw_crop": [ 264, 34, 6024, 4022 ], // full size 6288x4056, official crop 276,46,6275,4045
        "masked_areas": [ 40, 96, 4000, 260 ],
        "ranges": {
            "white": [
                { "iso": [ 100 ], "levels": 16100 }, // nominal 16383, LENR blue 16243
                { "iso": [ 125, 200, 250, 400 ], "levels": 16200 }, // nominal 16383, LENR blue 16243
                { "iso": [ 160 ], "levels": 13000 }, // nominal 13097,
                { "iso": [ 320, 640, 1250 ], "levels": 13250 }, // G1,G2 13415
                { "iso": [ 500, 800, 1000 ], "levels": 16150 }, // nominal 16383, LENR ISO3200 16150
                { "iso": [ 1600, 2000, 3200 ], "levels": 16100 }, // nominal 16383, LENR ISO3200 16150
                { "iso": [ 2500, 5000 ], "levels": 13150 }, // G1,G2 13415
                { "iso": [ 4000, 6400 ], "levels": 16050 }, // nominal 16383, LENR ISO6400 16050
                { "iso": [ 8000, 10000 ], "levels": 16000 }, // R,G1,G2 16383, B 16243, LENR B 16000
                { "iso": [ 12800, 16000, 25600 ], "levels": 15900 } // R,G1,G2 16383, B 16243, LENR BLUE 15750
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // need for more data to properly fill all scale factors
                { "aperture": 1.4, "scale_factor": 1.200 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.130 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.090 }, // 14338/13097 = 1.094
                { "aperture": 2.0, "scale_factor": 1.060 }, // 13934/13097 = 1.063
                { "aperture": 2.2, "scale_factor": 1.025 }, // 13438/13097 = 1.026
                { "aperture": 2.5, "scale_factor": 1.005 }, // 13190/13097 = 1.007
                { "aperture": 2.8, "scale_factor": 1.000 }  // 13097/13097
            ]
        }
    },

    { // Quality B, aperture scaling..missing scaling factors are guessed
        "make_model": [ "Canon EOS 77D", "Canon EOS 9000D" ],
        "dcraw_matrix": [ 7377,-742,-998,-4235,11981,2549,-673,1918,5538 ], // DNG_V9.10.1 D65
        "raw_crop": [ 264, 36, 6024, 4020 ], // full size 6288x4056, official crop 276,48,6275,4047
        "masked_areas": [ 40, 96, 4000, 260 ],
        "ranges": {
            "white": [
                { "iso": [ 100 ], "levels": 16300 }, // nominal 16383
                { "iso": [ 125, 200, 250, 400 ], "levels": 16300 }, // nominal 16383
                { "iso": [ 160 ], "levels": 13000 }, // nominal 13109,
                { "iso": [ 320, 640, 1250 ], "levels": 13300 }, // G1,G2 13403
                { "iso": [ 500, 800, 1000 ], "levels": 16200 }, // nominal 16383
                { "iso": [ 1600, 2000, 3200 ], "levels": 16100 }, // nominal 16383
                { "iso": [ 2500, 5000 ], "levels": 13150 }, // G1,G2 13423
                { "iso": [ 4000, 6400 ], "levels": 16000 }, // nominal 16383
                { "iso": [ 8000, 10000,12800, 16000 ], "levels": 15800 }, // R,G1,G2 16383
                { "iso": [ 25600, 51200 ], "levels": 15500 } // R,G1,G2 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // need for more data to properly fill all scale factors
                { "aperture": 1.4, "scale_factor": 1.200 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.130 }, // 15264/13423
                { "aperture": 1.8, "scale_factor": 1.090 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.060 }, // guessed
                { "aperture": 2.2, "scale_factor": 1.025 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.005 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.000 }  // guessed
            ]
        }
    },

// Canon mid-range DSLRs (Rebels)

    { // Quality C
        "make_model": "Canon EOS 400D DIGITAL",
        "dcraw_matrix": [ 7054, -1501, -990, -8156, 15544, 2812, -1278, 1414, 7796 ],
        "ranges": {
            "white": 4056
        }
    },

    { // Quality B, ISO and aperture WL data by ..... at RawTherapee forums, missing samples safely guessed
        "make_model": [ "Canon EOS 550D", "Canon EOS Rebel T2i", "Canon EOS Kiss X4" ],
        "dcraw_matrix": [ 6941,-1164,-857,-3825,11597,2534,-416,1540,6039 ], // dcraw 550d
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13584
                { "iso": [ 160, 320, 640, 1250, 2500 ], "levels": 12550 }, // typical 12650
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 5000, 6400, 12800 ], "levels": 15200 } // typical 15304
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (no lenses to test with), but the
                // typical 12650 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.250 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.150 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.110 }, // 15196/13584
                { "aperture": 2.0, "scale_factor": 1.080 }, // 14734/13584
                { "aperture": 2.2, "scale_factor": 1.050 }, // 14386/13584
                { "aperture": 2.5, "scale_factor": 1.040 }, // 14272/13584
                { "aperture": 2.8, "scale_factor": 1.030 }, // 14042/13584
                { "aperture": 3.2, "scale_factor": 1.015 }, // guessed
                { "aperture": 3.5, "scale_factor": 1.000 } // guessed negligible
            ]
        }
    },

    { // Quality B, scaling factors missing but guessed safely
        "make_model": [ "Canon EOS 600D", "Canon EOS Rebel T3i", "Canon EOS Kiss X5", "Canon EOS 1200D", "Canon EOS Rebel T5", "Canon EOS Kiss X70" ],
        //"dcraw_matrix": [ 13254,-6296,-1798,184,2753,90,1438,-566,1129 ], // Infrared guessed
        "dcraw_matrix": [ 6461,-907,-882,-4300,12184,2378,-819,1944,5931 ], // dcp D65 colormatrix2
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13583
                { "iso": [ 160, 320, 640, 1250, 2500, 5000, 10000 ], "levels": 12550 }, // typical 12650
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 6400, 8000, 12800 ], "levels": 15200 } // typical 15303
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (had no lenses to test with), but the
                // typical 12650 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.290 }, // guessed from 60D data
                { "aperture": 1.6, "scale_factor": 1.190 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.140 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.090 }, // 12293/11222 = 1.095
                { "aperture": 2.2, "scale_factor": 1.060 }, // 11971/11222 = 1.066
                { "aperture": 2.5, "scale_factor": 1.050 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.030 }, // iso100: 14042/13584=1.0336 - iso200 15820/15303 = 1.0348
                { "aperture": 3.2, "scale_factor": 1.000 } //
            ]
        }
    },

    { // Quality A, only one scaling factor missing and guessed safely, EOS 700D not tested but available samples look same as 650D, EOS 100D shares sensor and came out the same time as the 700D
        "make_model": [ "Canon EOS 650D", "Canon EOS Rebel T4i", "Canon EOS Kiss X6i", "Canon EOS 700D", "Canon EOS Rebel T5i", "Canon EOS Kiss X7i", "Canon EOS 100D", "Canon EOS Rebel SL1", "Canon EOS Kiss X7" ],
        "dcraw_matrix": [ 6602,-841,-939,-4472,12458,2247,-975,2039,6148 ],
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13583
                { "iso": [ 160, 320, 640, 1250, 2500, 5000, 10000 ], "levels": 12550 }, // typical 12650
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 6400, 8000 ], "levels": 15200 }, // typical 15303
                { "iso": [ 12800, 25600 ], "levels": 16200 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (had no lenses to test with), but the
                // typical 12650 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.200 }, // 16332/13583
                { "aperture": 1.6, "scale_factor": 1.080 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.055 }, // 14372/13583
                { "aperture": 2.0, "scale_factor": 1.030 }, // 14034/13583
                { "aperture": 2.2, "scale_factor": 1.025 }, // 13921/13583
                { "aperture": 2.5, "scale_factor": 1.020 }, //
                { "aperture": 2.8, "scale_factor": 1.000 }, //
                { "aperture": 3.2, "scale_factor": 1.000 } //
            ]
        }
    },

    { // Quality C, aperture scale factors and intermediate ISOs missing but safely guessed
        "make_model": [ "Canon EOS 750D", "Canon EOS Rebel T6i", "Canon EOS Kiss X8i", "Canon EOS 760D", "Canon EOS Rebel T6s", "Canon EOS 8000D" ],
        "dcraw_matrix": [ 6362,-823,-847,-4426,12109,2616,-743,1857,5635 ], // dng_v9.0 d65
        "raw_crop": [ 72, 34, 6024, 4022 ], // full size 6096x4056, official crop 84,46,6083,4045
        "masked_areas": [ 40, 16, 4000, 54 ],
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13300 }, // typical 13583
                { "iso": [ 160, 320, 640, 1250, 2500, 5000 ], "levels": 12500 }, // typical 12600
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000 ], "levels": 15200 }, // typical 15303
                { "iso": [ 6400, 8000, 10000, 12800, 16000, 20000 ], "levels": 15100 }, // typical 15303
                { "iso": 25600, "levels": 16300 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // all scale factors are guessed to be same as 7DII
                { "aperture": 1.4, "scale_factor": 1.200 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.100 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.050 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.030 }, // guessed
                { "aperture": 2.2, "scale_factor": 1.015 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.007 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.007 }, // guessed
                { "aperture": 3.2, "scale_factor": 1.000 }, // guessed
                { "aperture": 3.5, "scale_factor": 1.000 }
            ]
        }
    },

    { // Quality C, white levels and aperture scaling copied from Canon EOS77d
        "make_model": [ "Canon EOS Rebel T7i", "Canon EOS 800D", "Canon EOS Kiss X9i" ],
        "dcraw_matrix": [ 6969,-512,-968,-4425,12161,2553,-739,1981,5601 ], // DNG v13.2
        "raw_crop": [ 264, 36, 6024, 4020 ], // full size 6288x4056, official crop 276,48,6275,4047
        "masked_areas": [ 40, 96, 4000, 260 ],
        "ranges": {
            "white": [
                { "iso": [ 100 ], "levels": 16300 }, // nominal 16383
                { "iso": [ 125, 200, 250, 400 ], "levels": 16300 }, // nominal 16383
                { "iso": [ 160 ], "levels": 13000 }, // nominal 13109,
                { "iso": [ 320, 640, 1250 ], "levels": 13300 }, // G1,G2 13403
                { "iso": [ 500, 800, 1000 ], "levels": 16200 }, // nominal 16383
                { "iso": [ 1600, 2000, 3200 ], "levels": 16100 }, // nominal 16383
                { "iso": [ 2500, 5000 ], "levels": 13150 }, // G1,G2 13423
                { "iso": [ 4000, 6400 ], "levels": 16000 }, // nominal 16383
                { "iso": [ 8000, 10000,12800, 16000 ], "levels": 15800 }, // R,G1,G2 16383
                { "iso": [ 25600, 51200 ], "levels": 15500 } // R,G1,G2 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // need for more data to properly fill all scale factors
                { "aperture": 1.4, "scale_factor": 1.200 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.130 }, // 15264/13423
                { "aperture": 1.8, "scale_factor": 1.090 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.060 }, // guessed
                { "aperture": 2.2, "scale_factor": 1.025 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.005 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.000 }  // guessed
            ]
        }
    },

    { // Quality B, aperture scaling copied from Canon EOS77d
        "make_model": [ "Canon EOS Rebel SL2", "Canon EOS 200D", "Canon EOS Kiss X9" ],
        "dcraw_matrix": [ 7377,-742,-998,-4235,11981,2549,-673,1918,5538 ], // DNG_V9.12 D65
        "raw_crop": [ 264, 36, 6024, 4020 ], // full size 6288x4056, official crop 276,48,6275,4047
        "masked_areas": [ 40, 96, 4000, 260 ],
        "ranges": {
            "white": [
                { "iso": [ 100 ], "levels": 16300 }, // nominal 16383
                { "iso": [ 125, 200, 250, 400 ], "levels": 16300 }, // nominal 16383
                { "iso": [ 160 ], "levels": 13000 }, // nominal 13106,
                { "iso": [ 320, 640, 1250 ], "levels": 13300 }, // G1,G2 13423
                { "iso": [ 500, 800, 1000 ], "levels": 16200 }, // nominal 16383
                { "iso": [ 1600, 2000, 3200 ], "levels": 16100 }, // nominal 16383
                { "iso": [ 2500, 5000 ], "levels": 13150 }, // G1,G2 13423
                { "iso": [ 4000, 6400 ], "levels": 16000 }, // nominal 16383
                { "iso": [ 8000, 10000,12800, 16000 ], "levels": 15800 }, // R,G1,G2 16383
                { "iso": [ 25600, 51200 ], "levels": 15500 } // R,G1,G2 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // need for more data to properly fill all scale factors
                { "aperture": 1.4, "scale_factor": 1.200 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.130 }, // 15264/13423
                { "aperture": 1.8, "scale_factor": 1.090 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.060 }, // guessed
                { "aperture": 2.2, "scale_factor": 1.025 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.005 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.000 }  // guessed
            ]
        }
    },

    { // Quality C
        "make_model": [ "Canon EOS Rebel SL3", "Canon EOS 250D", "Canon EOS Kiss X10" ],
        "dcraw_matrix": [ 9079, -1923, -1236, -4677, 12454, 2492, -922, 2319, 5565 ]
    },

// Canon low-range DSLRs
// Canon EOS 1200D/Rebel T5/Kiss X70" is upper at the same item as 600D/T3i/X5

    { // Quality B, integer ISOs measured, intermediate ISO samples missing,
        // scaling factors safely guessed to be same as 1200D
        "make_model": [ "Canon EOS 1300D", "Canon EOS Rebel T6", "Canon EOS Kiss X80" ],
        "dcraw_matrix": [ 6939,-1016,-866,-4428,12473,2177,-1175,2178,6162 ], // dcraw 9.27
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13584
                { "iso": [ 160, 320, 640, 1250, 2500, 5000, 10000 ], "levels": 12550 }, // typical 12650
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 6400, 8000, 12800 ], "levels": 15200 } // typical 15303
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (had no lenses to test with), but the
                // typical 12650 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.290 }, // guessed from 60D data
                { "aperture": 1.6, "scale_factor": 1.190 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.140 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.090 }, // 12293/11222 = 1.095
                { "aperture": 2.2, "scale_factor": 1.060 }, // 11971/11222 = 1.066
                { "aperture": 2.5, "scale_factor": 1.050 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.030 }, // iso100: 14042/13584=1.0336 - iso200 15820/15303 = 1.0348
                { "aperture": 3.2, "scale_factor": 1.000 }, //
                { "aperture": 3.5, "scale_factor": 1.000 } //
            ]
        }
    },

    { // Quality C, samples provided by falket #5495
        "make_model": [ "Canon EOS 2000D", "Canon EOS Rebel T7", "Canon EOS Kiss X90" ],
        // raw_crop is handled by dcraw
        // "dcraw_matrix": [ 8532, -701, -1167, -4095, 11879, 2508, -797, 2424, 7010 ], // Adobe DNG v.10.3
        "dcraw_matrix": [ 8300, -2110, -1120, -4917, 12694, 2482, -938, 2141, 5666 ], // Adobe DNG v.10.3 (v2)
        "ranges": { "white": 15300 } // typical value, very non-linear behavior near clipping
    },

// Canon MILC (mirrorless interchangeable-lens camera)

    { // Quality B, missing scaling factors are guessed safely from 650D relative data
        "make_model": "Canon EOS M",
        "dcraw_matrix": [ 6602,-841,-939,-4472,12458,2247,-975,2039,6148 ],
        "ranges": {
            "white": [
                { "iso": [ 100, 125 ], "levels": 13480 }, // typical 13583
                { "iso": [ 160, 320, 640, 1250, 2500, 5000, 10000 ], "levels": 12550 }, // typical 12650
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 6400, 8000 ], "levels": 15200 }, // typical 15303
                { "iso": [ 12800, 25600 ], "levels": 16200 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // no scale factors known for f/1.2 and f/1.0 (had no lenses to test with), but the
                // typical 12650 white levels maxes out at "white_max" for f/1.4 and below anyway.
                { "aperture": 1.4, "scale_factor": 1.200 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.080 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.055 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.030 }, // 15821/15303
                { "aperture": 2.2, "scale_factor": 1.025 }, // 15691/15303
                { "aperture": 2.5, "scale_factor": 1.020 }, // 12947/12650
                { "aperture": 2.8, "scale_factor": 1.000 }, //
                { "aperture": 3.2, "scale_factor": 1.000 }, //
                { "aperture": 3.5, "scale_factor": 1.000 } //
            ]
        }
    },

    { // Quality C, inconsistent WL per ISO, missing scaling factors
        "make_model": "Canon EOS M10",
        "dcraw_matrix": [ 6400,-480,-888,-5294,13415,2047,-1296,2203,6137 ], // DNG v13.2
        "ranges": {
            "white": [
                { "iso": [ 100, 125, 160, 320, 500, 2000, 4000, 6400 ], "levels": 16300 }, // typical 16383
                { "iso": 200, "levels": 12900 }, // typical 12940-15570-15376
                { "iso": 250, "levels": 14100 }, // typical 14200
                { "iso": 800, "levels": 13400 }, // typical 13500-16383x2
                { "iso": 1000, "levels": 14900 }, // typical 15010-16383
                { "iso": 1250, "levels": 12300 }, // typical 12400
                { "iso": 1600, "levels": 15200 }, // typical 15290-16075-16380
                { "iso": 2500, "levels": 12200 }, // typical 12300
                { "iso": 3200, "levels": 15000 }, // typical 15080-16383-16100-13660
                { "iso": 5000, "levels": 12800 }, // typical 12840
                { "iso": [ 12800, 25600 ], "levels": 16200 } // typical 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // all scale factors are copied from EOS M3 */
                { "aperture": 1.4, "scale_factor": 1.200 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.080 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.055 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.030 }, // guessed
                { "aperture": 2.2, "scale_factor": 1.025 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.020 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.000 }, //
                { "aperture": 3.2, "scale_factor": 1.000 }, //
                { "aperture": 3.5, "scale_factor": 1.000 } //
            ]
        }
    },

    { // Quality C, white levels not properly indicated, aperture scaling..missing scaling factors are guessed
        "make_model": "Canon EOS M3",
        "dcraw_matrix": [ 6362,-823,-847,-4426,12109,2616,-743,1857,5635 ], // DNG_V8.8 D65
        "raw_crop": [ 72, 34, 6024, 4022 ], // full size 6096x4056, official crop 84,46,6083,4045
        "masked_areas": [ 40, 16, 4000, 54 ],
        "ranges": {
            "white": [
                { "iso": [ 100, 125, 160 ], "levels": 16300 }, // 16383
                { "iso": [ 320, 640, 1250, 2500, 5000, 10000 ], "levels": 12600 }, // 12632..14500
                { "iso": [ 200, 250, 400, 500, 800, 1000, 1600, 2000, 3200, 4000 ], "levels": 15000 }, // 15095, 15488
                { "iso": [ 6400, 8000, 12800, 25600 ], "levels": 16200 } // 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // need for more data to properly fill all scale factors
                { "aperture": 1.4, "scale_factor": 1.200 }, // guessed
                { "aperture": 1.6, "scale_factor": 1.080 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.055 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.030 }, // guessed
                { "aperture": 2.2, "scale_factor": 1.025 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.020 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.000 }, //
                { "aperture": 3.2, "scale_factor": 1.000 }, //
                { "aperture": 3.5, "scale_factor": 1.000 } //
            ]
        }
    },

    { // Quality C, White Levels not properly indicated, aperture scaling..missing factors are guessed
        "make_model": [ "Canon EOS M5","Canon EOS M6" ],
        "dcraw_matrix": [ 8532,-701,-1167,-4095,11879,2508,-797,2424,7010 ], // DNG_V9.8 D65
        "raw_crop": [ 264, 36, 6024, 4020 ], // full size 6288x4056,
        //"raw_crop": [ 272, 44, 6008, 4008 ], // matched to official crop 276,48,6275,4047 - official jpeg 6000X4000
        "masked_areas": [ 40, 96, 4000, 260 ],
        "ranges": {
            "white": [
                { "iso": [ 100, 125, 200, 250 ], "levels": 15600 }, // nominal 15660-15800
                { "iso": [ 160 ], "levels": 12600 }, // green 12650-12750
                { "iso": [ 320 ], "levels": 13100 }, // nominal green 13200, 13528-14466-14380-14368 - blue13262-14186,
                { "iso": [ 640, 1250 ], "levels": 13200 }, // iso 640 G1,G2 13260-13450 - blue13230-13430 -iso 1250 13430
                { "iso": [ 2500, 5000, 10000 ], "levels": 13000 }, //
                { "iso": [ 400, 500, 800, 1000, 1600, 2000, 3200, 4000, 6400 ], "levels": 16100 }, // 16383
                // { "iso": [ 1600 ], "levels": 15000 }, // one sample of m6 = 15100 !!
                // { "iso": [ 6400 ], "levels": 15500 }, // one sample of m6 = 15600 !!
                { "iso": [ 8000, 12800, 16000, 25600 ], "levels": 16000 } // R,G1,G2 16383, B 16243
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // need for more data to properly fill all scale factors
                { "aperture": 1.4, "scale_factor": 1.200 }, // 31/25
                { "aperture": 1.6, "scale_factor": 1.080 }, // guessed
                { "aperture": 1.8, "scale_factor": 1.060 }, // guessed
                { "aperture": 2.0, "scale_factor": 1.040 }, // 15292/ 14916/ 320-14466/ 320-13528/
                { "aperture": 2.2, "scale_factor": 1.020 }, // guessed
                { "aperture": 2.5, "scale_factor": 1.010 }, // guessed
                { "aperture": 2.8, "scale_factor": 1.000 }, //
                { "aperture": 3.2, "scale_factor": 1.000 }, //
                { "aperture": 3.5, "scale_factor": 1.000 } //
            ]
        }
    },

    { // Quality C, only raw crop
        "make_model": [ "Canon EOS M6 Mark II", "Canon EOS 90D" ],
        "raw_crop": [ 144, 72, 6984, 4660 ],
        "masked_areas": [ 76, 40, 4580, 140 ]
    },

    { // Quality C, only masked area. Raw crop from metadata ok.
        "make_model": ["Canon EOS M50", "Canon EOS M50m2", "Canon EOS M100"],
        "masked_areas": [36, 4, 4052, 260]
    },

    { // Quality B, samples by jonathanBieler (#5922). No dual-pixel information for full frame.
        "make_model": [ "Canon EOS R" ],
        "dcraw_matrix" : [ 8293, -1789, -1094, -5025, 12925, 2327, -1199, 2769, 6108 ], // DNG v2 style
        "raw_crop": [
            {"frame": [0, 0], "crop": [ 144, 46, 6744, 4500 ]},
            {"frame": [4352, 2850], "crop": [ 144, 46, 4208, 2804 ]}
        ],
        "masked_areas": [
            {"frame": [0, 0], "areas": [ 50, 40, 4540, 140 ]}, // Taken from ART
            {"frame": [4352, 2850], "areas": [ 50, 40, 2846, 140 ]}
        ],
        "ranges" : { "white" : 16367 } // Typically 16383 without LENR, with LENR safest value is 15800 for ISO 25600
    },

    { // Quality C
        "make_model": "Canon EOS R3",
        "dcraw_matrix" : [ 9423, -2839, -1195, -4532, 12377, 2415, -483, 1374, 5276 ],
        "raw_crop": [ 160, 120, 6024, 4024 ]
    },

    { // Quality A
        "make_model": "Canon EOS R5",
        "dcraw_matrix" : [9766, -2953, -1254, -4276, 12116, 2433, -437, 1336, 5131],
        "raw_crop" : [
            { "frame" : [ 8352, 5586 ], "crop" : [ 128, 96, 8224, 5490 ] },
            { "frame" : [ 5248, 3510 ], "crop" : [ 128, 96, 5120, 3382 ] }
        ],
        "masked_areas" : [
            { "frame" : [ 8352, 5586 ], "areas": [ 94, 20, 5578, 122 ] },
            { "frame" : [ 5248, 3510 ], "areas": [ 94, 20, 3510, 122 ] }
        ],
        "ranges" : { "white" : 16300 } // 16382 without LENR, add margin for LENR. Dual-pixel frame 2 is lower for low ISOs.
    },

    { // Quality C
        "make_model": "Canon EOS R6",
        "dcraw_matrix" : [8293, -1611, -1132, -4759, 12710, 2275, -1013, 2415, 5508],
        "raw_crop": [
            { "frame": [5568, 3708], "crop" : [ 72, 38, 5496, 3670 ] },
            { "frame": [3584, 2386], "crop" : [ 156, 108, 3404, 2270 ] }
            ],
        "masked_areas" : [
            { "frame": [5568, 3708], "areas": [ 40, 10, 5534, 70 ] },
            { "frame": [3584, 2386], "areas": [ 40, 10, 2374, 110 ] }
        ],
        "ranges" : { "white" : 16382 }
    },

    { // Quality C
        "make_model": ["Canon EOS R6m2", "Canon EOS R8"],
        "dcraw_matrix": [9539, -2795, -1224, -4175, 11998, 2458, -465, 1755, 6048],
        "raw_crop": [
            {"frame": [6188, 4120], "crop": [154, 96, 6024, 4024]},
            {"frame": [3936, 2612], "crop": [156, 96, 3780, 2516]}
        ],
        "masked_areas": [
            {"frame": [6188, 4120], "areas": [4, 4, 4116, 150, 4, 150, 92, 6184]},
            {"frame": [3936, 2612], "areas": [4, 4, 2608, 150, 4, 150, 92, 3932]}
        ]
    },

    { // Quality C
        "make_model": "Canon EOS R7",
        "dcraw_matrix" : [10424, -3138, -1300, -4221, 11938,  2584,  -547,  1658,  6183],
        "raw_crop": [ 144, 72, 6984, 4660 ],
        "masked_areas" : [ 70, 20, 4724, 138 ]
    },

    { // Quality C
        "make_model": "Canon EOS R10",
        "dcraw_matrix" : [9269, -2012, -1107, -3990, 11762,  2527,  -569,  2093,  4913],
        "raw_crop": [ 144, 40, 6048, 4020 ],
        "masked_areas" : [ 38, 20, 4052, 138 ]
    },

    { // Quality C, CHDK DNGs, raw frame correction
        "make_model": "Canon PowerShot A3100 IS",
        "raw_crop": [ 24, 12, 4032, 3024 ] // full size 4036X3026
    },

    { // Quality C, CHDK DNGs, raw frame corrections, experimental infrared support commented out
        "make_model": "Canon PowerShot A480",
        "dcraw_matrix": [ 8275,-2905,-1261,-128,5305,505,52,482,2450 ], // DNG_CHDK_V1.3.0 Daylight
        //"dcraw_matrix": [ 15906,-7425,-2014,-2010,5554,264,404,-265,2706 ], // Infrared guessed
        "raw_crop": [ 6, 12, 3684, 2760 ], // full size 3720X2772, official Canon crop 3648x2736
        "masked_areas": [ 12, 3694, 2760, 3716 ], // only left side optically black area is considered
        "ranges": { "white": 4080 }
    },

    { // Quality B, experimental infrared support commented out
        "make_model": "Canon PowerShot G9",
        "dcraw_matrix": [ 7368,-2141,-598,-5621,13254,2625,-1419,1696,5743 ], // DNG_V8.7 D65
        //"dcraw_matrix": [ 8796,-3770,311,-4148,11362,3197,-598,983,5880 ], // DNG_V8.7 A
        //"dcraw_matrix": [ 15669,-8084,-2453,-2940,5756,101,126,-401,2463 ], // Infrared guessed 111
        //"dcraw_matrix": [ 13254,-6296,-1798,184,2753,90,1438,-566,1129 ], // Infrared guessed
        "ranges": { "white": 4080 }
    },

    { // Quality A, changes for raw crop which is optimistic in dcraw
        "make_model": "Canon PowerShot G12",
        "dcraw_matrix": [ 13244,-5501,-1248,-1508,9858,1935,-270,1083,4366 ],
        //"raw_crop": [ 62, 18, 3666, 2748 ], // max usable
        "raw_crop": [ 68, 20, 3656, 2744 ], // equal to official Canon frame, 72,24,3719,2759 = 3648x2736
        "masked_areas": [ 24, 40, 2770, 44 ], // as declared in maker data
        "ranges": { "white": 4080 }
    },

    { // Quality B, needs a way to auto apply 3/2 or 4/3 crops (read Exif tags ..) to work better with auto distortion,
      // for the moment just comment-uncomment the desired raw crop
        "make_model": "Canon PowerShot G1 X Mark II",
        "dcraw_matrix": [ 7378,-1255,-1043,-4088,12251,2048,-876,1946,5805 ], // D65 matrix from adobe dcp
        //"raw_crop": [ 80, 50, 4400, 3316 ], // full frame 4480x3366 borders 80,50 - much shade in corners, no/wrong auto distortion
        //"raw_crop": [ 104, 144, 4360, 3128 ], // Mixed best average frame, width is 4352 from 3/2, height 3120 from 4/3 - auto distortion does not work correctly
        //"raw_crop": [ 200, 144, 4168, 3128 ], // Optional official 4/3 frame 4160x3120, 4pix borders, Left Border 204-4, Top Border 148-4
        "raw_crop": [ 104, 252, 4360, 2912 ], // Default official 3/2 frame 4352x2904, 4pix borders, Left Border 108-4, Top border 256-4
        "masked_areas": [ 148, 2, 3340, 78 ],
        "ranges": { "white": 16300 }
    },

    { // Quality B
        "make_model": "Canon PowerShot G3 X",
        //"dcraw_matrix": [ 9701,-3857,-921,-3149,11537,1817,-786,1817,5147 ], // DNG_V9.1.1 D65
        "dcraw_matrix": [ 6941, -1164, -857, -3825, 11597, 2534, -416, 1540, 6039 ], // DNG v13.2 - looks worse
        "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 ],
        "ranges": { "white": 16300 }
    },

    { // Quality B,
        "make_model": "Canon PowerShot G7 X",
        "dcraw_matrix": [ 9602,-3823,-937,-2984,11495,1675,-407,1414,5049 ], // DNG v13.2
        //"raw_crop": [ 116, 24, 5504, 3680 ], // Sensor size 5632x3710. Largest useful 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 ],
        "ranges": { "white": 4080 }
    },

    { // Quality B,
        "make_model": [ "Canon PowerShot G5 X", "Canon PowerShot G9 X", "Canon PowerShot G7 X Mark II" ],
        "dcraw_matrix": [ 9602,-3823,-937,-2984,11495,1675,-407,1414,5049 ], // DNG v13.2
        //"raw_crop": [ 116, 24, 5504, 3680 ], // Sensor size 5632x3710. Largest useful 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 ],
        "ranges": { "white": 15500 } // some sporadic samples are clipped lower than 16383, one ISO125 sample at 15500
    },

    { // Quality B, separated entry from above due to alternate color matrix (effect unsure)
        "make_model": "Canon PowerShot G9 X Mark II",
        "dcraw_matrix": [ 10056, -4131, -944, -2576, 11143, 1625, -239, 1293, 5179 ], // DNG v13.2
        //"dcraw_matrix": [ 9602,-3823,-937,-2984,11495,1675,-407,1414,5049 ], // DNG v8.7
        "raw_crop": [ 128, 36, 5480, 3656 ],
        "masked_areas": [ 40, 4, 3680, 76 ],
        "ranges": { "white": 15500 }
    },

    { // Quality A, changes for raw crop which is wrong (larger) in dcraw
        "make_model": "Canon PowerShot S120",
        "dcraw_matrix": [ 6941, -1164, -857, -3825, 11597, 2534, -416, 1540, 6039 ], // Adobe DNG v13.2
        //"dcraw_matrix": [ 6961, -1685, -695, -4625, 12945, 1836, -1114, 2152, 5518 ], // Adobe DNG v12.2
        "raw_crop": [ 120, 30, 4024, 3030 ],
        "masked_areas": [ 32, 2, 3028, 80 ],
        "ranges": { "white": 4050 }
    },

    { // Quality C
        "make_model": "Canon PowerShot SX50 HS",
        "dcraw_matrix": [ 12432, -4753, -1247, -2110, 10691, 1629, -412, 1623, 4926 ],
        "ranges": { "white": 4050 }
    },

    { // Quality B
        "make_model": "Canon PowerShot SX60 HS",
        "dcraw_matrix": [ 13161,-5451,-1344,-1989,10653,1531,-47,1271,4955 ], // DNG v13.2
        "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
    },

    { // Quality C, only raw crop
        "make_model": "Canon PowerShot SX70 HS",
        "dcraw_matrix" : [18285, -8907, -1951, -1845, 10688, 1323, 364, 1101, 5139], // taken from ART
        "raw_crop": [ 96, 17, 5248, 3932 ]
    },

    { // Quality C
        "make_model": "Canon PowerShot SX150 IS",
        "dcraw_matrix": [ 13481, -4867, -1063, -2074, 9960, 2472, -170, 1474, 3894 ], // Adobe DNG Converter 11.1 ColorMatrix1 (there is only one matrix and illuminant, and it's for daylight)
        "raw_crop": [ 26, 10, 4364, 3254 ] // cut 2pix left and right
    },

    { // Quality C
        "make_model": "Canon PowerShot SX220 HS",
        "raw_crop": [ 92, 16, 4072, 3042 ] // Cut 2pix at lower border because of too high values in blue channel
    },

    { // Quality C
        "make_model": [ "DJI FC2103" ],
        "ranges": { "black": 4080 }
    },

    { // Quality C
        "make_model": "DJI FC6310",
        "ranges": { "white": 64886 }
    },

    { // Quality C
        "make_model": "DJI FC3170",
        "ranges": { "white": 65472 }
    },

    { // Quality C
        "make_model": [ "FUJIFILM GFX 100", "FUJIFILM GFX100S", "FUJIFILM GFX 100S", "FUJIFILM GFX 100 II" ],
        "dcraw_matrix" : [ 16212, -8423, -1583, -4336, 12583, 1937, -195, 726, 6199 ], // taken from ART
        "raw_crop": [
            // multi-aspect crop to account for 16-shot pixel shift images
            { "frame" : [11808, 8754], "crop" : [ 0, 2, 11664, 8734 ] },
            { "frame" : [23616, 17508], "crop" : [ 0, 4, 23328, 17468 ] }
        ],
        "pdaf_pattern" : [ 0, 18 ], // From ART
        "pdaf_offset" : 0
    },

    { // Quality C
        "make_model": [ "FUJIFILM GFX100 II" ],
        "dcraw_matrix" : [ 12806, -5779, -1110, -3546, 11507, 2318, -177, 996, 5715 ], // adobe dcp d65
        "raw_crop": [
            // multi-aspect crop to account for 16-shot pixel shift images
            { "frame" : [11808, 8754], "crop" : [ 0, 0, 11664, 8750 ] },
            // this crop has been copied from the GFX 100 one, no sample pixel shift images are available
            { "frame" : [23616, 17508], "crop" : [ 0, 4, 23328, 17468 ] }
        ]
    },

    { // Quality B
        "make_model": [ "FUJIFILM GFX 50R", "FUJIFILM GFX 50S", "FUJIFILM GFX50S II" ],
        "dcraw_matrix": [ 11756,-4754,-874,-3056,11045,2305,-381,1457,6006 ], // DNGv9.9 D65
        //"dcraw_matrix": [ 12407,-5222,-1086,-2971,11116,2120,-294,1029,5284 ], // copy from X-A3 DNGv9.8 D65
        "raw_crop": [ 0, 0, 8280, 6208 ], // full raw 9216X6210 - useful 8280x6208
        //"raw_crop": [ 6, 6, 8264, 6200 ], // fuji official JPEG 8256X6192 10,11,9,8 - experimental crop to match with official
        "ranges": { "white": 16000 }
    },

    { // Quality A
        "make_model": "FUJIFILM S1",
        "dcraw_matrix": [ 12297,-4882,-1202,-2106,10691,1623,-88,1312,4790 ] // DNG_v8.5 D65
    },

    { // 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 C
        "make_model": "Fujifilm X10",
        "ranges": { "white": 3788 }
    },

    { // Quality C
        "make_model": "Fujifilm HS30EXR",
        "ranges": { "white": 3765 }
    },

    { // Quality B
        "make_model": "FUJIFILM X70",
        "dcraw_matrix": [ 10450,-4329,-878,-3217,11105,2421,-752,1758,6519 ], // DNG_v9.4 D65
        //"raw_crop": [ 4, 0, 4988, 3296 ], // full raw 4992,3296, fuji official 4936,3296 - experimental crop
        "ranges": { "white": 16100 }
    },

    { // Quality B
        "make_model": "FUJIFILM X-A2",
        "dcraw_matrix": [ 10763,-4560,-917,-3346,11311,2322,-475,1135,5843 ], // DNG D65
        "ranges": { "white": 4050 }
    },

    { // Quality B
        "make_model": "FUJIFILM X-A3",
        "dcraw_matrix": [ 12407,-5222,-1086,-2971,11116,2120,-294,1029,5284 ], // DNGv9.8 D65
        "raw_crop": [ 0, 0, 6016, 4014 ], // full raw 6016x4014
        "ranges": { "white": 16100 }
    },

    { // Quality C
        "make_model": "FUJIFILM X-A5",
        "ranges": { "white": 16100 }
    },

    { // Quality C, bisected from the overexposed region of one pre-release sample file
        "make_model": "FUJIFILM X-A7",
        "ranges": { "white": 16382 }
    },

    { // Quality B
        "make_model": "FUJIFILM X-A10",
        "dcraw_matrix": [ 11540,-4999,-991,-2949,10963,2278,-382,1049,5605 ], // DNGv9.12 D65
        "raw_crop": [ 0, 0, 4912, 3278 ], // full raw 4912x3278, fuji official borders 10,11,9,8
        "ranges": { "white": 4050 }
    },

    { // Quality C
        "make_model": "Fujifilm X-A20",
        "ranges": { "white": 3838 }
    },

    { // Quality B
        "make_model": [ "Fujifilm X-H2S" ],
        "raw_crop": [ 0, 5, 6264, 4176 ]
    },

    { // Quality B
        "make_model": [ "FUJIFILM X-T10", "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
        //"raw_crop": [ 4, 0, 4936, 3296 ], // full raw 4992,3296, fuji official 4936,3296
        "ranges": { "white": 16100 }
    },

    { // Quality B, samples provided by Claes
        "make_model": "FUJIFILM X-T1",
        "dcraw_matrix": [ 8458,-2451,-855,-4597,12447,2407,-1475,2482,6526 ], // DNG D65
        "raw_crop": [ 4, 0, 4936, 3296 ], // full raw 4992,3296, fuji official 4936,3296
        "ranges": { "white": [ 16202, 16277, 16232 ] } // LENR on from ISO4000+ negligibly underestimates white level
        // No aperture scaling data provided, but likely negligible
    },

    { // Quality C
        "make_model": [ "FUJIFILM X-T100" ],
        "dcraw_matrix" : [11673, -4760, -1041, -3988, 12058, 2166, -771, 1417, 5568], // taken from ART
        "ranges": { "white": 16100 }
    },

    { // Quality B
        "make_model": "FUJIFILM X-E2S",
        "dcraw_matrix": [ 11562,-5118,-961,-3022,11007,2311,-525,1569,6097 ], // DNG_v9.4 D65
        "ranges": { "white": 16100 }
    },

    { // Quality B
        "make_model": "FUJIFILM X-PRO1",
        "dcraw_matrix": [ 10413,-3996,-993,-3721,11640,2361,-733,1540,6011 ], // DNG_v9.4 D65
        "ranges": { "white": 4080 }
    },

    { // Quality B
        "make_model": [ "FUJIFILM X-T20", "FUJIFILM X-E3", "FUJIFILM X100F", "FUJIFILM X-H1" ],
        "dcraw_matrix": [ 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 ], // DNG_v9.4 D65
        // "raw_crop": [ 0, 5, 6032, 4032 ], // full raw 6160,4032, Usable 6032,4032 - for lossless compressed files
        // "raw_crop": [ 0, 0, 6032, 4032 ], // full raw 6160,4032, Usable 6032,4032 - for uncompressed files
        "raw_crop": [ 0, 5, 6032, 4026 ], // full raw 6160,4032, Usable 6032,4026 - for uncompressed and lossless compressed files (but reduces height by 6 pixels)
        "ranges": { "white": 16100 }
    },

    { // Quality C
        "make_model": "FUJIFILM X-E4",
        "dcraw_matrix": [ 13426, -6334, -1177, -4244, 12136, 2371, -580, 1303, 5980 ], // DNG v13.2
        "raw_crop": [ 0, 5, 6252, 4126 ]
    },

    { // Quality B, samples provided by Daniel Catalina #5824
        "make_model": "FUJIFILM X-T2",
        "dcraw_matrix": [ 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 ], // DNG_v9.4 D65
        "raw_crop": [ 0, 5, 6032, 4026 ], // xee X-T20
        "ranges": { "white": [ 16195, 16270, 16195 ] } // With LENR on and ISO4000+ starts to overestimate white level, more realistic would be 16090
        // Negligible aperture scaling effect
    },

    { // Quality B, samples provided by Claes
        "make_model": "FUJIFILM X-PRO2",
        "dcraw_matrix": [ 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 ], // DNG_v9.4 D65
        "raw_crop": [ 0, 5, 6032, 4026 ], // see X-T2
        "ranges": { "white": [ 16105, 16270, 16082 ] } // These values are the lowest pixel values >16000 for all ISOs. LENR has a negligible effect.
        // No aperture scaling data provided, but likely negligible
    },

    { // Quality A, samples provided by Daniel Catalina (#5839) and pi99y (#5860)
        "make_model": [ "FUJIFILM X-T3", "FUJIFILM X-PRO3" ],
        "dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v11, standard_v2 d65
        "raw_crop" : [
           { "frame" : [6384, 4182], "crop": [ 0, 5, 6252, 4176] },
           { "frame" : [6384, 3348], "crop": [624, 0, 5004, 3348] }
        ],
        "white": [ 16170, 16275, 16170 ] // typical safe-margins with LENR
        // negligible aperture scaling effect
    },

    { // Quality B
        "make_model": [ "FUJIFILM X-T30", "FUJIFILM X-T30 II", "FUJIFILM X100V", "FUJIFILM X-T4", "FUJIFILM X-S10" ],
        "dcraw_matrix": [ 13426,-6334,-1177,-4244,12136,2371,-580,1303,5980 ], // DNG_v11, standard_v2 d65
        "raw_crop": [
            {"frame": [6384, 3348], "crop": [624, 0, 5004, 3347]}, // Sports finder mode.
            {"frame": [0, 0], "crop": [0, 5, 6252, 4176]}
        ]
    },

    { // Quality B
        "make_model": "FUJIFILM X30",
        "dcraw_matrix": [ 12328,-5256,-1144,-4469,12927,1675,-87,1291,4351 ], // DNG_v8.7 D65
        "ranges": { "white": 4040 }
    },

    { // Quality B
        "make_model": "FUJIFILM XQ2",
        "dcraw_matrix": [ 9252,-2704,-1064,-5893,14265,1717,-1101,2341,4349 ], // DNG_v8.8 D65
        "ranges": { "white": 4040 }
    },

    { // Quality B
        "make_model": [ "FUJIFILM X-T5", "FUJIFILM X-H2" ],
        "dcraw_matrix": [ 11809, -5358, -1141, -4248, 12164, 2343, -514, 1097, 5848 ], // RawSpeed / DNG
        "raw_crop": [ 0, 5, 7752, 5184 ]
    },

    { // Quality C
        "make_model": "FUJIFILM DBP for GX680",
        "dcraw_matrix": [ 12741, -4916, -1420, -8510, 16791, 1715, -1767, 2302, 7771 ], // same as S2Pro as per LibRaw
        "ranges": { "white": 4096, "black": 132 }
    },

    { // Quality C, Leica C-Lux names can differ?
        "make_model" : [ "LEICA C-LUX", "LEICA CAM-DC25" ],
        "dcraw_matrix" : [7790, -2736, -755, -3452, 11870, 1769, -628, 1647, 4898]
    },

    { // Quality B
        "make_model" : "LEICA D-LUX 7",
        "dcraw_matrix" : [11577, -4230, -1106, -3967, 12211, 1957, -758, 1762, 5610], // DNG
        // "dcraw_matrix" : [8585, -3127, -833, -4005, 12250, 1953, -650, 1494, 4862] // DNG alternate
        "ranges" : { "black" : 15 }
    },

    { // Quality B, Matrix from Adobe's dcp D65 instead of the internal in Leica's DNG
        "make_model": "LEICA Q (Typ 116)",
        "dcraw_matrix": [ 10068,-4043,-1068,-5319,14268,1044,-765,1701,6522 ], // DCP D65
        "raw_crop": [ 4, 4, -4, -4 ] // full raw 6016x4016, Official 6000x4000
    },

    // TODO: Temporary workaround for issues #6237 and #6498.
    //{ // Quality C
    //    "make_model": "LEICA M8",
    //    "dcraw_matrix": [ 7675, -2196, -305, -5860, 14119, 1855, -2425, 4006, 6578 ], // DNG
    //    "ranges": { "white": 16383 }
    //},

    { // Quality C
        "make_model": "LEICA Q2",
        "raw_crop": [ 0, 0, 8392, 5624 ]
    },

    { // Quality B, Matrix from Adobe's dcp D65 instead of the internal in Leica's DNG
        "make_model": "LEICA SL (Typ 601)",
        "dcraw_matrix": [ 11492,-4930,-1188,-5593,14673,873,-609,1474,6343 ], // DNGv9.3 D65
        "raw_crop": [ 4, 4, -4, -4 ] // full raw 6016x4016, Official 6000x4000
    },

    { // Quality C, only raw crop
        "make_model": "Leica SL2",
        "raw_crop": [ 0, 0, 0, -18 ] // 18 rows at bottom are garbage
    },

    { // Quality C, only raw crop
        "make_model": "Leica SL2-S",
        "raw_crop": [ 0, 2, 0, -4 ] // 2 rows at top and 4 rows at bottom are garbage
    },

    { // Quality C
        "make_model" : ["LEICA V-LUX 5","Panasonic DC-FZ1000M2"],
        "dcraw_matrix" : [9803, -4185, -992, -4066, 12578, 1628, -838, 1824, 5288] // DNG
    },

    { // Quality C
        "make_model": "LG mobile LG-H815",
        "dcraw_matrix": [ 5859,547,-1250,-6484,15547,547,-2422,5625,3906 ], // DNG D65
        //"dcraw_matrix": [ 11563,-2891,-3203,-5313,15625,625,-781,2813,5625 ], // DNG A
        "raw_crop": [ 0, 0, 5312, 2986 ], // cropped last two rows because last row was garbage
        "ranges": { "white": 1000 }
    },
    { // Quality C
        "make_model": "LG mobile LG-H850",
        //"dcraw_matrix": [ 10000,-2188,-2813,-5156,15469,625,-703,2734,5078 ], // DNG A
        "dcraw_matrix": [ 5313,1016,-1172,-6250,15391,547,-2344,5547,3359 ], // DNG D65
        "ranges": { "white": 1000 }
    },

    { // Quality A
        "make_model": "Nikon 1 V3",
        "dcraw_matrix": [ 5958,-1559,-571,-4021,11453,2939,-634,1548,5087 ], // matrix from DNG_v8.5 d65
        //"dcraw_matrix": [ 5306,-1066,-469,-3865,11189,3076,-399,1341,5120 ], // matrix dXo D50,
        "ranges": { "white": 4080 } // Black is auto extracted from Exif, lower WL to 4080 from 4095 due to some non linearity detected at raw highlights
    },

    { // Quality A
        "make_model": "Nikon 1 J4", // Similar to V3, different matrix
        "dcraw_matrix": [ 6588, -1305, -693, -3277, 10987, 2634, -355, 2016, 5106 ], // DNG v13.2
        "ranges": { "white": 4080 }
    },

    { // Quality B
        "make_model": "Nikon 1 J5", //
        "dcraw_matrix": [ 7520,-2519,-645,-3844,12102,1945,-914,2249,6835 ], // DNG v13.2
        //"dcraw_matrix": [ 7651,-2102,-751,-3299,11101,1651,-1011,2242,5770 ], // matrix from ICC converted to dcraw format XYZ on ImagingResource still life sample
        "ranges": {
            "white": [
                { "iso": [ 160, 200 ], "levels": 4000 }, // typical G1/G2 4020-4028, R/B 4088
                { "iso": [ 400, 800, 1600, 3200 ], "levels": 4000 }, // g1/g2 4030-4040, r/b 4088
                { "iso": [ 6400, 12800 ], "levels": 4080 } // 4090
            ]
        }
    },

    { // Quality A
        "make_model": "Nikon 1 S2", //
        "dcraw_matrix": [ 6612,-1342,-618,-3338,11055,2623,-174,1792,5075 ], // matrix from DNG_v8.5 d65
        "ranges": { "white": 4080 } // BL autodetected from Exif
    },

    { // Quality C
        "make_model": "Nikon D2Hs",
        "dcraw_matrix": [ 5733, -911, -629, -7967, 15987, 2055, -3050, 4013, 7048 ] // DNG
    },

    { // Quality C
        "make_model": "Nikon D2Xs",
        "dcraw_matrix": [ 10230, -2768, -1255, -8302, 15900, 2551, -797, 680, 7148 ] // DNG
    },

    // For all Nikon DSLRs which have multiple bitdepth options (14- and 12-bit) we define the 14-bit value and RT adapts it to 12-bit
    // when a 12-bit bitdepth is detected (WL12 = WL14*4095/16383)

    { // Quality B, samples by Johan Thor at RT.Issues, measures at long exposures with LENR are missing
      // but a safety margin is included - aperture scaling makes no significant difference
        "make_model": "Nikon D3S",
        "dcraw_matrix": [ 8828,-2406,-694,-4874,12603,2541,-660,1509,7586 ], // DNG v13.2
        "ranges": {
            "white": [
                { "iso": [ 100, 125, 160, 200, 250, 320, 400, 500 ], "levels": 15520 }, // typical G1,G2 15520-15800 R,B 16383
                { "iso": [ 640, 800, 1000, 1250 ], "levels": 15400 }, // typical G1,G2 15520-15800, R,B 16383
                { "iso": [ 1600, 2000, 2500 ], "levels": 15300 }, // typical G1,G2 15520-15800, R,B 16383
                { "iso": [ 3200, 4000, 5000, 6400 ], "levels": 15300 }, // typical G1/G2 15400-15800, R,B 16383
                { "iso": [ 8000, 10000 ], "levels": 15000 }, // typical G1/G2 15400-15800, R,B 16383
                { "iso": [ 12800, 16000 ], "levels": 14500 }, // typical G1/G2 15400-15800, R,B 16383
                { "iso": [ 20000, 25600 ], "levels": 13300 }, // typical G1/G2 15400-15800, R,B 16383
                { "iso": [ 51200, 102400 ], "levels": 12000 } // typical G1,G1 16270-16350, R,B 16383
            ],
            "white_max": 16383
        }
    },

    { // Quality B, intermediate ISO samples missing
        "make_model": "Nikon D500",
        "dcraw_matrix": [ 8813,-3210,-1036,-4703,12868,2021,-1054,1940,6129 ], // DNG_v9.5 D65
        "ranges": {
            "white": [ // measured at integer ISOs. Safety margin per ISO groups according to expected WL spread after LENR
                { "iso": [ 100, 200, 400, 800, 1600 ], "levels": [ 16300, 16100, 16300 ] }, // typical G1,G2 16180 R,B 16383
                { "iso": [ 3200, 6400 ], "levels": [ 16250, 16050, 16250 ] }, // typical G1,G2,16200 R,B 16383
                { "iso": [ 12800, 25600 ], "levels": 16000 }, // typical G1,G2, R,B 16383
                { "iso": [ 51200, 102400 ], "levels": 15800 }, // typical G1,G2, R,B 16383
                { "iso": [ 204800, 409600 ], "levels": 15500 }, // typical G1,G2,R,B 16383
                { "iso": [ 819200, 1638400 ], "levels": 15000 } // typical G1,G2, R,B 16383
            ],
            "white_max": 16383
        }
    },

    { // Quality B, lacks aperture and ISO scaling, known to exist, but little to gain as the levels are so close to white_max
        "make_model": "Nikon D7000",
        "dcraw_matrix": [ 7530,-1942,-255,-4318,11390,3362,-926,1694,7649 ], // matrix provided by Tanveer(tsk1979)
       // "dcraw_matrix": [ 8198, -2239, -725, -4871, 12388, 2798, -1043, 2050, 7181 ], // DNG v13.2
        "ranges": {
            // measured at ISO 100. ISO differences not measured, but known to exist
            "white": [ 16300, 15700, 16300 ], // typical R 16383, G 15778, B 16383
            "white_max": 16383
            // aperture scaling not measured, but known to exist, at f/1.8 the G channels hits white_max
        }
    },

    { // Quality B
        "make_model": "NIKON COOLPIX A",
        "dcraw_matrix": [ 8198,-2239,-725,-4871,12388,2798,-1043,2050,7181 ], // DNG v13.2
        "ranges": {
            "white": [
                { "iso": [ 100, 125, 160, 200, 250, 320, 400, 500, 640, 800 ], "levels": [ 16300, 15700, 16300 ] }, // typical G1,G2 15760-15800 R,B 16383
                { "iso": [ 1000, 1250, 1600, 2000, 2500, 3200 ], "levels": 16300 }, // typical G1,G2, R,B 16383
                { "iso": [ 4000, 5000, 6400 ], "levels": 16200 }, // typical G1,G2, R,B 16383
                { "iso": [ 8000, 10000, 12800 ], "levels": 16000 }, // typical G1,G2,R,B 16383
                { "iso": [ 16000, 20000, 25600 ], "levels": 15700 } // typical G1,G2, R,B 16383
            ],
            "white_max": 16383
        }
    },

    { // Quality A, samples provided by dimonoid (#5842)
        "make_model": "NIKON COOLPIX P1000",
        "dcraw_matrix": [ 14294, -6116, -1333, -1628, 10219, 1637, -14, 1158, 5022 ], // ColorMatrix2 from Adobe DNG Converter 11.4
        "ranges": {
            "black": 200,
            "white": [ 4000, 4050, 3950 ] // Typical values without LENR: 4009, 4093, 3963
        } // No significant influence of ISO
        // No aperture scaling reported
    },

    { // Quality B, samples provided by arvindpgh (#6066)
      // Sensor shows some non-uniformity, need other sample to verify
      // There seems to be some aperture scaling, but insufficient data to accurately determine
        "make_model": "Nikon COOLPIX P950",
        "dcraw_matrix": [ 13307,-5642,-1290,-2048,10581,1689,-64,1222,5175 ], // DNG v13.2
        "ranges": {
            "black": 200,
            "white": [
                { "iso": [ 100 ], "levels": [ 3994, 4093, 3963 ] }, // LENR can be quite aggressive at higher ISO
                { "iso": [ 200 ], "levels": [ 3993, 4092, 3962 ] },
                { "iso": [ 400 ], "levels": [ 3992, 4091, 3961 ] },
                { "iso": [ 800, 1600, 3200, 6400 ], "levels": [ 3996, 4095, 3965 ] }
            ]
        }
    },

    { // Quality B, no LENR samples
        "make_model": "Nikon D5",
        "dcraw_matrix": [ 9200,-3522,-992,-5755,13803,2117,-754,1486,6338 ], // DNG v13.2
        "ranges": { "black": 0, "white": 16300 } // WL typical 16383 set to 16300 for safety
    },

    { // Quality C
        "make_model": "Nikon D6",
        "dcraw_matrix": [ 9028, -3423, -1035, -6321, 14265, 2217, -1013, 1683, 6928 ] // DNG
    },

    { // Quality B
        "make_model": "Nikon D3400",
        "dcraw_matrix": [ 6988,-1384,-714,-5631,13410,2447,-1485,2204,7318 ], // adobe dng_v9.7 d65
        "ranges": { "white": 16300 } // WL value is for 14-bit files, RT auto adapts it for 12-bit files. WL typical 16383 set to 16300 for safety
    },

    { // Quality C
        "make_model": "Nikon D3500",
        "dcraw_matrix": [ 8821, -2938, -785, -4178, 12142, 2287, -824, 1651, 6860 ] // DNG
    },

    { // Quality B
        "make_model": "Nikon D5300",
        "dcraw_matrix": [ 6988,-1384,-714,-5631,13410,2447,-1485,2204,7318 ], // adobe dng_v8.8 d65
        "ranges": { "white": 16300 } // WL value is for 14-bit files, RT auto adapts it for 12-bit files. WL typical 16383 set to 16300 for safety
    },

    { // Quality B
        "make_model": [ "Nikon D5500", "Nikon D5600" ],
        "dcraw_matrix": [ 8821,-2938,-785,-4178,12142,2287,-824,1651,6860 ], // adobe dng_v9.8 d65
        "ranges": { "white": 16300 } // WL value is for 14-bit files, RT auto adapts it for 12-bit files. WL typical 16383 set to 16300 for safety
    },

    { // Quality B
        "make_model": "Nikon D7200",
        "dcraw_matrix": [ 8322,-3112,-1047,-6367,14342,2179,-988,1638,6394 ], // adobe dng_v9.0 d65
        "ranges": { "white": 16300 } // WL value is for 14-bit files, RT auto adapts it for 12-bit files. WL typical 16383 set to 16300 for safety,
    },

    { // Quality B
        "make_model": "Nikon D7500",
        "dcraw_matrix": [ 8813,-3210,-1036,-4703,12868,2021,-1054,1940,6129 ], // adobe dng_v9.12 d65
        "ranges": { "white": 16300 } // WL value is for 14-bit files, RT auto adapts it for 12-bit files. WL typical 16383 set to 16300 for safety,
    },

    { // Quality C
        "make_model": "Nikon D300s",
        "dcraw_matrix": [ 9030, -1992, -716, -8465, 16302, 2256, -2689, 3217, 8068 ] // DNG
        //"dcraw_matrix": [ 9000, -1966, -711, -7030, 14976, 2185, -2354, 2959, 7990 ] // DNG alternate
    },

    { // Quality B, samples by joachip at RT forums, are measures at long exposures with LongExposureNoiseReduction
      // aperture scaling known to exist, but little to gain as the levels are so close to white_max
        "make_model": "Nikon D600",
        "dcraw_matrix": [ 8178,-2245,-609,-4857,12394,2776,-1207,2086,7298 ], // dcp d65
        //"raw_crop": [ 0, 0, 6034, 4028 ], // dcraw
        "ranges": {
            "white": [
                { "iso": [ 50, 100 ], "levels": [ 15800, 15800, 15350 ] }, // typical G1/G2/R 15879, B 15395-15670 lowered to 15800, 15350, 3969 B3917
                { "iso": [ 200, 400, 800 ], "levels": [ 16300, 15700, 16300 ] }, // 15878, 16383
                { "iso": 1000, "levels": [ 16300, 16100, 16300 ] }, // 12-bit lossless r4095, 3981-10, b4041- 12-bit lossy r,g1,g2 3961 - b3917,
                { "iso": 1600, "levels": [ 16300, 16100, 16300 ] }, // 16145-165, 16383
                { "iso": [ 3200, 6400, 12800, 25600 ], "levels": [ 16300, 16300, 16300 ] } // 16383
            ],
            "white_max": 16383
        }
    },

    { // Quality B, missing WL measures at intermediate ISOs (160-250-320 ..) and at long exposures with LongExposureNoiseReduction set to ON
      // aperture scaling known to exist, but little to gain as the levels are so close to white_max
        "make_model": "Nikon D610",
        "dcraw_matrix": [ 8178,-2245,-609,-4857,12394,2776,-1207,2086,7298 ], // dcp d65
        "raw_crop": [ 0, 0, 6034, 4028 ],
        "ranges": {
            "white": [
                { "iso": [ 50, 100 ], "levels": [ 15800, 15700, 15800 ] }, // typical G1/G2 15778, R/B 15879 lowered to 15700, 15800 for possible WL distribution under LENR
                { "iso": [ 200, 400, 800 ], "levels": [ 16300, 15700, 16300 ] }, // 15878, 16383
                { "iso": 1600, "levels": [ 16300, 16100, 16300 ] }, // 16145-165, 16383
                { "iso": [ 3200, 6400, 12800, 25600 ], "levels": [ 16300, 16300, 16300 ] } // 16383
            ],
            "white_max": 16383
        }
    },

    { // Quality B, data from RusselCottrell at RT forums. sensor is not uniform
        "make_model": "Nikon D700",
        "dcraw_matrix": [ 8139,-2171,-664,-8748,16541,2296,-1924,2008,8093 ], // DNG v13.2
        //"dcraw_matrix": [ 9336,-3405,14,-7321,14779,2764,-914,1171,8248 ], // illuminant A
        "ranges": { "white": [ 15500, 15500, 15500 ] }
        // Non linearities start at 15500 (hi ISOs) 15850 (low ISOs) with long exposures (>2sec) and LENR ON .. nominal 15892
        // white 15500 is correct for 14-bit files, for 12-bit files RT auto_calculates it 15500*4095/16383=3874
    },

    { // Quality B,
        "make_model": "Nikon D750",
        "dcraw_matrix": [ 9020,-2890,-715,-4535,12436,2348,-934,1918,7086 ], // DNG v13.2
        "ranges": { "white": 16300 } // WL values for 14-bit files, RT auto adapts it for 12-bit files. TypicalWL 16383 set to 16300 for safety
    },

    { // Quality C
        "make_model": "Nikon D780",
        "dcraw_matrix": [ 9943, -3270, -839, -5323, 13269, 2259, -1198, 2083, 7557 ] // DNG
    },

    { // Quality B, data from RussellCottrell at RT forums. Largest aperture scale factor is 1.013, about 1/50th of a stop
        "make_model": [ "Nikon D800", "Nikon D800E" ],
        "dcraw_matrix": [ 7866,-2108,-555,-4869,12483,2681,-1176,2069,7501 ], // D800/D800E from dcraw.c
        "ranges": {
            "white": [
                { "iso": [ 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250 ], "levels": [ 16300, 15700, 16300 ] }, // 15779-15781
                { "iso": [ 1600 ], "levels": 16000 }, // 16085-16113
                { "iso": [ 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 16300 } // 16383
            ]
        }
    },

    { // Quality B, WL set at 16300 from nominal 16380 for possible non linearities with LENR
        "make_model": "Nikon D810",
        "dcraw_matrix": [ 9369,-3195,-791,-4488,12430,2301,-893,1796,6872 ], // dcp_v8.6 d65
        "raw_crop": [ 0, 0, 7380, 4928 ], // Official raw crop 7380x4928,
        "ranges": { "white": 16300 } // WL values for 14-bit files, RT auto adapts it for 12-bit files. Typical WL at 16383
    },

    { // Quality C
        "make_model": "Nikon D810A",
        "dcraw_matrix": [ 11973, -5685, -888, -1965, 10326, 1901, -115, 1123, 7169 ] // DNG
    },

    { // Quality A, Samples by zorgtool at RT forums
        "make_model": "Nikon D850",
        "dcraw_matrix": [ 10405,-3755,-1270,-5461,13787,1792,-1040,2015,6785 ], // DNG v13.2
        "ranges": {
            "white": [
                { "iso": [ 64, 80, 100, 125, 160, 200, 250, 320 ], "levels": [ 16250, 16050, 16250 ] }, // R,B 16383 G1,G2 16145-16155
                { "iso": [ 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500 ], "levels": [ 16150, 15950, 16150 ] }, // G1,G2 16110-16145
                { "iso": [ 3200, 4000, 5000 ], "levels": 16000 }, // G1,G2 16120-16145
                { "iso": [ 6400, 8000, 10000 ], "levels": 15700 }, // G1,G2 16120-16145
                { "iso": [ 12800, 16000 ], "levels": 15400 }, // 16383
                { "iso": [ 20000, 25600 ], "levels": 15000 }, // 16383
                { "iso": [ 32000 ], "levels": 14500 }, // 16383
                { "iso": [ 40000 ], "levels": 14000 }, // 16383
                { "iso": [ 51200 ], "levels": 13500 }, // nominal 16383
                { "iso": [ 102400 ], "levels": 12000 } // nominal 16383
            ],
            "white_max": 16383,
            "aperture_scaling": [
                // need for more data to properly fill all scale factors
                { "aperture": 1.4, "scale_factor": 1.050 }, // 37/35
                { "aperture": 1.6, "scale_factor": 1.040 }, // 68/65
                { "aperture": 1.8, "scale_factor": 1.030 }, // 65/63
                { "aperture": 2.0, "scale_factor": 1.000 }, //
                { "aperture": 2.2, "scale_factor": 1.000 }, //
                { "aperture": 2.5, "scale_factor": 1.000 }, //
                { "aperture": 2.8, "scale_factor": 1.000 }, //
                { "aperture": 3.2, "scale_factor": 1.000 }, //
                { "aperture": 3.5, "scale_factor": 1.000 } //
            ]
        }
    },

    { // Quality C
        "make_model": "Nikon D70s",
        "dcraw_matrix": [ 7732, -2421, -789, -8238, 15883, 2498, -859, 783, 7330 ] // DNG
    },

    { // Quality B
        "make_model": "Nikon D80",
        "dcraw_matrix": [ 8628,-2410,-883,-9055,16940,2171,-1491,1363,8520 ], // DNG v13.2
        "ranges": { "white": 3980 } // 12-bit files.
    },

    { // Quality C, only color matrix and PDAF lines info
        "make_model" : "Nikon Z 7",
        "dcraw_matrix" : [10405,-3755,-1270,-5461,13787,1792,-1040,2015,6785], // DNG v13.2
        "pdaf_pattern" : [0, 12],
        "pdaf_offset" : 29
    },

    { // Quality C
        "make_model" : "Nikon Z 7_2",
        "dcraw_matrix" : [13705, -6004, -1401, -5464, 13568, 2062, -940, 1706, 7618] // DNG
    },

    { // Quality C
        "make_model" : "NIKON Z 9",
        "dcraw_matrix" : [13389, -6049, -1441, -4544, 12757, 1969, 229, 498, 7390] //DNG
    },

    { // Quality C, only color matrix and PDAF lines info
        "make_model" : "Nikon Z 6",
        "dcraw_matrix" : [8210, -2534, -683, -5355, 13338, 2212, -1143, 1928, 6464], // DNG v13.2
        "pdaf_pattern" : [0, 12],
        "pdaf_offset" : 32
    },

    { // Quality C
        "make_model" : "Nikon Z 6_2",
        "dcraw_matrix" : [9943, -3270, -839, -5323, 13269, 2259, -1198, 2083, 7557] // DNG
    },

    { // Quality C
        "make_model" : "NIKON Z 5",
        "dcraw_matrix" : [8695, -2559, -648, -5015, 12710, 2575, -1280, 2215, 7514] // DNG v13.2
    },

    { // Quality A, white levels and PDAF lines measured by Yann Leprince #5851
        "make_model" : [ "Nikon Z 50", "Nikon Z fc" ],
        "dcraw_matrix" : [11640, -4829, -1079, -5107, 13006, 2325, -972, 1711, 7380], // Adobe DNG Converter 12.2.1 ColorMatrix2 (D65)
        "ranges": {
            "white": [
                // White level was consistently measured at 16383 for non-LENR images. These values are computed using
                // 16383 - 6 * read_noise (where read_noise values are extracted from
                // https://www.photonstophotos.net/Charts/RN_ADU.htm#Nikon%20Z%2050_14 for iso < 1600, fitted in the
                // 1600-10183 range, and extrapolated from that fit into the 12800-204800 range, where the read noise
                // provided by photonstophotos is underestimated due to in-body noise reduction. These values were
                // verified to be below the 1st percentile of the distribution, on LENR white frames taken with a 2 s
                // shutter in a variety of conditions (apertures from 1.8 to 6.3).
                {"iso": 100, "levels": 16374},
                {"iso": 126, "levels": 16371},
                {"iso": 159, "levels": 16367},
                {"iso": 200, "levels": 16367},
                {"iso": 251, "levels": 16364},
                {"iso": 318, "levels": 16360},
                {"iso": 400, "levels": 16366},
                {"iso": 503, "levels": 16364},
                {"iso": 636, "levels": 16362},
                {"iso": 800, "levels": 16358},
                {"iso": 1006, "levels": 16349},
                {"iso": 1273, "levels": 16345},
                {"iso": 1600, "levels": 16337},
                {"iso": 2011, "levels": 16327},
                {"iso": 2546, "levels": 16313},
                {"iso": 3200, "levels": 16298},
                {"iso": 4022, "levels": 16278},
                {"iso": 5091, "levels": 16253},
                {"iso": 6400, "levels": 16223},
                {"iso": 8045, "levels": 16186},
                {"iso": 10183, "levels": 16139},
                {"iso": 12800, "levels": 16082},
                {"iso": 16090, "levels": 16013},
                {"iso": 20366, "levels": 15924},
                {"iso": 25600, "levels": 15818},
                {"iso": 32180, "levels": 15687},
                {"iso": 40731, "levels": 15521},
                {"iso": 51200, "levels": 15321},
                {"iso": 102400, "levels": 14388},
                {"iso": 204800, "levels": 12633}
            ]
        },
        "pdaf_offset": 0,
        // Every 12th line from 285 to 3441. These lines (specifically, the blue subpixels) have a lower standard deviation on a black frame.
        "pdaf_pattern": [285, 297, 309, 321, 333, 345, 357, 369, 381, 393, 405, 417, 429, 441, 453, 465, 477, 489, 501, 513, 525, 537, 549, 561, 573, 585, 597, 609, 621, 633, 645, 657, 669, 681, 693, 705, 717, 729, 741, 753, 765, 777, 789, 801, 813, 825, 837, 849, 861, 873, 885, 897, 909, 921, 933, 945, 957, 969, 981, 993, 1005, 1017, 1029, 1041, 1053, 1065, 1077, 1089, 1101, 1113, 1125, 1137, 1149, 1161, 1173, 1185, 1197, 1209, 1221, 1233, 1245, 1257, 1269, 1281, 1293, 1305, 1317, 1329, 1341, 1353, 1365, 1377, 1389, 1401, 1413, 1425, 1437, 1449, 1461, 1473, 1485, 1497, 1509, 1521, 1533, 1545, 1557, 1569, 1581, 1593, 1605, 1617, 1629, 1641, 1653, 1665, 1677, 1689, 1701, 1713, 1725, 1737, 1749, 1761, 1773, 1785, 1797, 1809, 1821, 1833, 1845, 1857, 1869, 1881, 1893, 1905, 1917, 1929, 1941, 1953, 1965, 1977, 1989, 2001, 2013, 2025, 2037, 2049, 2061, 2073, 2085, 2097, 2109, 2121, 2133, 2145, 2157, 2169, 2181, 2193, 2205, 2217, 2229, 2241, 2253, 2265, 2277, 2289, 2301, 2313, 2325, 2337, 2349, 2361, 2373, 2385, 2397, 2409, 2421, 2433, 2445, 2457, 2469, 2481, 2493, 2505, 2517, 2529, 2541, 2553, 2565, 2577, 2589, 2601, 2613, 2625, 2637, 2649, 2661, 2673, 2685, 2697, 2709, 2721, 2733, 2745, 2757, 2769, 2781, 2793, 2805, 2817, 2829, 2841, 2853, 2865, 2877, 2889, 2901, 2913, 2925, 2937, 2949, 2961, 2973, 2985, 2997, 3009, 3021, 3033, 3045, 3057, 3069, 3081, 3093, 3105, 3117, 3129, 3141, 3153, 3165, 3177, 3189, 3201, 3213, 3225, 3237, 3249, 3261, 3273, 3285, 3297, 3309, 3321, 3333, 3345, 3357, 3369, 3381, 3393, 3405, 3417, 3429, 3441]
    },

    { // Quality C
        "make_model" : "Nikon Z f",
        "dcraw_matrix" : [ 11607, -4491, -977, -4522, 12460, 2304, -458, 1519, 7616 ] // DNG v16.1
    },

    { // Quality B, 16Mp and 64Mp raw frames
        "make_model": "OLYMPUS E-M5MarkII",
        "dcraw_matrix": [ 9422,-3258,-711,-2655,10898,2015,-512,1354,5512 ], // DNG_v8.8 D65
        "raw_crop": [ 0, 0, -6, -6 ], // largest valid, full 64Mp 9280x6938, official crop 0 0 9216 6912
        "ranges": {
            "white": [
                { "iso": [ 100, 200 ], "levels": 3950 }, // normal 4080-4095, HR Dpreview 4047, IR 3956
                { "iso": [ 400, 800, 1600, 3200 ], "levels": 4070 }, // 4070-4095
                { "iso": [ 6400, 12800, 25600 ], "levels": 4040 } // 4000-4095
            ]
        }
    },

    { // Quality C
        "make_model": "OLYMPUS E-M5MarkIII",
        "dcraw_matrix": [ 11896, -5110, -1076, -3181, 11378, 2048, -519, 1224, 5165 ] // DNG
    },

    { // Quality B, 20Mp and 80Mp raw frames
        "make_model": "OLYMPUS PEN-F",
        "dcraw_matrix": [ 9476,-3182,-765,-2613,10958,1893,-449,1315,5268 ], // dng_v9.5 D65
        //"raw_crop": [ 0, 0, 10372, -7780 ], // Highres mode largest valid, full 80Mp 10400X7796, official crop 10 10 10368 7776
        "ranges": {
            "white": [
                { "iso": [ 100, 200 ], "levels": 3950 }, // normal 4080-4095, HR Dpreview 4047, IR 3956
                { "iso": [ 400, 800, 1600, 3200 ], "levels": 4070 }, // 4070-4095
                { "iso": [ 6400, 12800, 25600 ], "levels": 4040 } // 4000-4095
            ]
        }
    },

    { // Quality B, 20Mp and 80Mp raw frames,
        "make_model": "OLYMPUS E-M1MarkII",
        "dcraw_matrix": [ 9383,-3170,-764,-2457,10702,2020,-384,1236,5552 ], // dng_V9.10 D65
        "raw_crop": [ 8, 8, -16, -8 ], // full raw 5240X3912, jpeg top12,left12,5184x3888, full hires 10400X7792, jpeg crop 8,8,10368x7776
        "ranges": {
            "white": [
                { "iso": [ 64, 100, 125, 160, 200, 250, 320, 400 ], "levels": 4090 }, // normal 4095
                { "iso": [ 500, 640, 800, 1000, 1600 ], "levels": 4080 }, // 4085-4095
                { "iso": [ 2000, 2500, 3200, 4000, 5000, 6400 ], "levels": 4060 }, // 4085-4095
                { "iso": [ 12800, 25600, 51200 ], "levels": 4060 } // guess
            ]
        }
    },

    { // Quality B, missing per ISO samples
        "make_model": "OLYMPUS E-M1",
        "global_green_equilibration" : true,
        "dcraw_matrix": [ 7687,-1984,-606,-4327,11928,2721,-1381,2339,6452 ], // dng d65
        "ranges": { "white": 4080 } // nominal 4095-4094, spread with some settings as long exposure
    },

    { // Quality C
        "make_model": "OLYMPUS E-M1MarkIII",
        "dcraw_matrix": [ 11896, -5110, -1076, -3181, 11378, 2048, -519, 1224, 5165 ] // DNG
    },

    { // Quality C, only raw crop for highres mode
        "make_model": "OLYMPUS E-M1X",
        "dcraw_matrix": [ 11896, -5110, -1076, -3181, 11378, 2048, -519, 1224, 5165 ], // DNG v11.2
        "raw_crop": [ 0, 0, 10388, 0 ] // Highres mode largest valid, full 80Mp 10400X7792, works also for non highres mode because larger width will be ignored
    },

    { // Quality B, crop correction
        "make_model": [ "OLYMPUS E-M10", "OLYMPUS E-M10MarkII", "OLYMPUS E-M10 Mark III" ],
        "dcraw_matrix": [ 8380,-2630,-639,-2887,10725,2496,-628,1427,5437 ], // DNG v13.2
        "raw_crop": [ 0, 0, 4624, 3472 ], // largest valid - full frame is 4640x3472
        //"raw_crop": [ 4, 4, 4616, 3464 ], // olympus jpeg crop 8, 8, 4608, 3456
        "ranges": { "white": 4080 }
    },

    { // Quality C
        "make_model": "OLYMPUS E-M10MarkIV",
        "dcraw_matrix": [ 9476, -3182, -765, -2613, 10958, 1893, -449, 1315, 5268 ],
        "ranges": { "white": 4000 }
    },

    { // Quality A, white level correction
        "make_model": "OLYMPUS E-PM2",
        "global_green_equilibration" : true,
        "dcraw_matrix": [ 8380,-2630,-639,-2887,10725,2496,-628,1427,5437 ], // DNG v13.2
        "ranges": { "white": 4040 } // nominal 4056
    },

    { // Quality C
        "make_model": [ "OLYMPUS E-PL9" ],
        "dcraw_matrix": [ 8380, -2630, -639, -2887, 10725, 2496, -628, 1427, 5437 ],
        "ranges": { "white": 4080 } // nominal 4093
    },

    { // Quality C
        "make_model": [ "OLYMPUS E-PL10" ],
        "dcraw_matrix": [ 9197, -3190, -659, -2606, 10830, 2039, -458, 1250, 5457 ]
    },

    { // Quality B, with long exposure noise reduction White Level gets WL-BL = around 256_12-bit levels less
        "make_model": [ "OLYMPUS E-PL7", "OLYMPUS E-PL8" ],
        "global_green_equilibration" : true,
        "dcraw_matrix": [ 9197,-3190,-659,-2606,10830,2039,-458,1250,5457 ], // DNG v13.2
        "ranges": { "white": 4080 } // nominal 4093
    },

    { // Quality B, per ISO WL measures missing
        "make_model": [ "OLYMPUS SH-2", "Olympus SH-3" ],
        "dcraw_matrix": [ 10156,-3426,-1077,-2611,11177,1624,-385,1592,5080 ], // DNG v13.2
        "ranges": { "white": 4050 } // safe for worst case detected, nominal is 4093
    },

    { // Quality B,
        "make_model": "OLYMPUS TG-5",
        "dcraw_matrix": [ 10899,-3833,-1082,-2112,10736,1575,-267,1452,5269 ], // DNG_V9.12 D65
        "raw_crop": [ 0, 0, -18, 0 ], // 18 pixels at right are garbage
        "ranges": { "white": 4050 } // safe for worst case detected, nominal is 4093
    },

    { // Quality B
        "make_model": [ "OLYMPUS TG-6", "OM Digital Solutions TG-7" ],
        "dcraw_matrix" : [10899, -3833, -1082, -2112, 10736, 1575, -267, 1452, 5269], // DNG v13.2
        "raw_crop": [ 0, 0, -24, 0 ] // 24 pixels at right are garbage
    },

    { // Quality C, only green equilibration
        "make_model" : ["OLYMPUS E-3", "OLYMPUS E-520"],
        "global_green_equilibration" : true
    },

    { // Quality C
        "make_model": ["OLYMPUS STYLUS1", "OLYMPUS STYLUS1,1s"],
        "dcraw_matrix" : [8360, -2420, -880, -3928, 12353, 1739, -1381, 2416, 5173] // DNG
    },

    { // Quality C
        "make_model": ["OM Digital Solutions OM-1"],
        "ranges": { "white": 4095 },
        "raw_crop" : [
           { "frame" : [10400, 7792], "crop": [0, 0, 10390, 7792] },
           { "frame" : [8180, 6132], "crop": [0, 0, 8172, 6132] },
           { "frame" : [5220, 3912], "crop": [0, 0, 5220, 3912] }
        ]
    },

    { // Quality X
        "make_model": ["OM Digital Solutions OM-5"],
        "dcraw_matrix": [ 11896, -5110, -1076, -3181, 11378, 2048, -519, 1224, 5166 ], // ColorMatrix2 using illuminant D65 from Adobe DNG Converter 15.0
        "ranges": { "white": 3825 },
        "raw_crop" : [
           { "frame" : [8200, 6132], "crop": [0, 0, 8172, 6132] },
           { "frame" : [5240, 3912], "crop": [0, 0, 5240, 3912] },
           { "frame" : [10400, 7792], "crop": [0, 0, 10390, 7792] }
        ]
    },

    { // Quality B
        "make_model": [ "Panasonic DC-LX100M2" ],
        //"dcraw_matrix": [ 11577, -4230, -1106, -3967, 12211, 1957, -759, 1762, 5610 ], // DNG v13.2
        "dcraw_matrix": [ 8585, -3127, -833, -4005, 12250, 1953, -650, 1494, 4862 ], // DNG v13.2 alternate
        "raw_crop": [ 0, 0, 0, 0 ],
        "ranges": { "black": 15 }
    },

    { // Quality C, proper ISO 100-125-160 samples missing, pixelshift files have no black offset etc. #4574
        "make_model": [ "Panasonic DC-G9" ],
        "dcraw_matrix": [ 7685, -2375, -634, -3688, 11700, 2249, -748, 1545, 5111 ], // DNG v13.2
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT reads the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 100, "levels": 3000 }, // gaussian 3100-3600 Exif_linearitylimit 2111
                { "iso": 125, "levels": 3500 }, // guessed
                { "iso": [ 160, 200, 250, 320, 400,500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality C
        "make_model": [ "Panasonic DC-G90", "Panasonic DC-G95", "Panasonic DC-G99" ],
        "dcraw_matrix": [ 9657, -3963, -748, -3361, 11378, 2258, -568, 1414, 5158 ], // DNG
        "ranges": { "black": 15 } // see above: RT already reads a value from exif
    },

    { // Quality C
        "make_model": [ "Panasonic DC-G100", "Panasonic DC-G110" ],
        "dcraw_matrix": [ 8370, -2869, -710, -3389, 11372, 2298, -640, 1598, 4887 ], // DNG
        "ranges": {
            "white": [ // Measured with DC-G100 (#6913). Levels affected by LENR for ISOs 1600-4000.
                { "iso": [ 200, 400, 800, 1250 ], "levels": 4095 },
                { "iso": 1600, "levels": 4050 },
                { "iso": 2000, "levels": 4040 },
                { "iso": 2500, "levels": 4025 },
                { "iso": 3200, "levels": 4010 },
                { "iso": 4000, "levels": 4000 },
                { "iso": [ 5000, 6400, 12800, 25600 ], "levels": 4095 }
            ]
        }
    },

    { // Quality C, only color matrix
        "make_model" : [ "Panasonic DC-GF10", "PANASONIC DC-GX880" ],
        "dcraw_matrix": [ 7610, -2781, -576, -4614, 12195, 2733, -1375, 2393, 6490 ], // DNG v13.2
        "raw_crop": [ 0, 0, 4600, 0 ], // SensorWidth=4816 SensorHeight=3464. Width=4600 to match DNG.
        "ranges": { "black": 15 }
    },

    { // Quality B, CameraPhone, some samples are missing but has the same sensor as FZ1000 ..
        "make_model": [ "Panasonic DMC-CM1", "Panasonic DMC-CM10" ],
        "dcraw_matrix": [ 8770,-3194,-820,-2871,11281,1803,-513,1552,4434 ], // dcp_v8.7 d65
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base BL from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 80, "levels": 3600 }, // Exif:3277 distribution peak at 3700 up to +/- 100
                { "iso": [ 100, 125, 200, 400, 800, 1600 ], "levels": 4050 }, // Exif 4095 distribution 4050-4095
                { "iso": [ 3200, 6400, 12600, 25600 ], "levels": 4080 } // Exif 4095 distribution 4080-4095
            ]
        }
    },

    { // Quality B
        "make_model": [ "Panasonic DC-FZ80", "Panasonic DC-FZ81", "Panasonic DC-FZ82", "Panasonic DC-FZ83" ],
        "dcraw_matrix": [ 11532, -4324, -1066, -2375, 10847, 1749, -564, 1699, 4351 ], // DNG v13.2
        "raw_crop": [ 0, 6, -8, -2 ], // fullraw4/3 5040x3688 official 8,8,4904,3680 = 4896X3672. Dcraw 0,0,4912,3688 RT's frame gets smaller than dcraw but works better with auto distortion
        "ranges": { "black": 15, "white": 4050 } // 15 is BL offset. dcraw/RT read the base offset from Exif and calculates total BL = BLbase+BLoffset
    },

    { // Quality C
        "make_model": "Panasonic DMC-FX150",
        "raw_crop": [
            { "frame": [ 4508, 2498 ], "crop": [ 0, 0, 4429, 2496] } // 16:9 ratio needs to shave a few extra pixels from dcraw's crop.
        ]
    },

    { // 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
        "ranges": { "black": 15, "white": 4050 } // 15 is BL offset. dcraw/RT read the base offset from Exif and calculates total BL = BLbase+BLoffset
    },

    { // Quality B,
        "make_model": [ "Panasonic DMC-FZ300", "Panasonic DMC-FZ330" ],
        "dcraw_matrix": [ 8378,-2798,-769,-3068,11410,1877,-538,1792,4623 ], // DNG-V9.1.1
        "ranges": { "black": 15, "white": 4050 } // 15 is BL offset. dcraw/RT read the base offset from Exif and calculates total BL = BLbase+BLoffset
    },

    { // Quality A, samples by helices at RT forums
        "make_model": [ "Panasonic DMC-FZ1000", "Leica V-LUX (Typ 114)" ],
        "dcraw_matrix": [ 7830,-2696,-764,-3325,11667,1865,-641,1712,4824 ], // DNG v13.2
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base BL from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 80, "levels": 3600 }, // Exif:3277 distribution peak at 3700 up to +/- 100
                { "iso": [ 100, 125, 200, 400, 800, 1600 ], "levels": 4050 }, // Exif 4095 distribution 4050-4095
                { "iso": [ 3200, 6400, 12600, 25600 ], "levels": 4080 } // Exif 4095 distribution 4080-4095
            ]
        }
    },

    { // Quality B,
        "make_model": [ "Panasonic DMC-FZ2500", "Panasonic DMC-FZ2000", "Panasonic DMC-FZH1" ],
        "dcraw_matrix": [ 7386,-2443,-743,-3437,11863,1757,-608,1660,4766 ], // DNG v13.2
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base BL from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 80, "levels": 3600 }, // Exif:3277 distribution peak at 3700 up to +/- 100
                { "iso": [ 100, 125, 200, 400, 800, 1600 ], "levels": 4050 }, // Exif 4095 distribution 4050-4095
                { "iso": [ 3200, 6400, 12600, 25600 ], "levels": 4080 } // Exif 4095 distribution 4080-4095
            ]
        }
    },

    { // Quality A, samples by helices at RT forums and Chris Power at github
        "make_model": [ "Panasonic DMC-ZS100", "Panasonic DMC-ZS110", "Panasonic DMC-TZ100", "Panasonic DMC-TZ101", "Panasonic DMC-TZ110", "Panasonic DMC-TX1" ],
        "dcraw_matrix": [ 7790,-2736,-755,-3452,11870,1769,-628,1647,4898 ], // dcp_v8.6 d65
        "raw_crop": [ 4, 4, -4, -4 ], // full raw frame 5488x3664 Exif crop 5472X3648 with 8pixel borders. Set the borders at 4 pixels which added with RT's 4 pixels border gives exactly the official frame.
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base BL from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 80, "levels": 3600 }, // Exif:3277 distribution peak at 3700 up to +/- 100
                { "iso": [ 100, 125, 200, 400, 800, 1600 ], "levels": 4050 }, // Exif 4095 distribution 4050-4095
                { "iso": [ 3200, 6400, 12600, 25600 ], "levels": 4080 } // Exif 4095 distribution 4080-4095
            ]
        }
    },

    { // Quality A
        "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 offset. dcraw/RT read the base offset from Exif and calculates total BL = BLbase+BLoffset
    },

    { // Quality A
        "make_model": [ "Panasonic DMC-TZ60", "Panasonic DMC-TZ61", "Panasonic DMC-ZS40", "Panasonic DMC-ZS41" ],
        "dcraw_matrix": [ 8607,-2822,-808,-3755,11930,2049,-820,2060,5224 ], // matrix from Adobe dcp v8.4
        "raw_crop": [ 8, 8, -8, -8 ], // crop according to Exif 4896 X 3672 plus 4 pixels borders. RT's frame gets smaller than dcraw but works better with auto distortion
        "ranges": { "black": 14, "white": 4050 } // 15 is BL offset. dcraw/RT read the base offset from Exif and calculates total BL = BLbase+BLoffset
    },

    { // Quality B
        "make_model": [ "Panasonic DMC-TZ70", "Panasonic DMC-TZ71", "Panasonic DMC-ZS50", "Panasonic DMC-ZS51" ],
        "dcraw_matrix": [ 8802,-3135,-789,-3151,11468,1904,-550,1745,4810 ], // DNG_V8.8 D65
        "raw_crop": [ 0, 0, -4, -4 ], // full raw 4/3 4144x3016 8,8,3008,4008 = 4000X3000. RT's frame gets smaller than dcraw but works better with auto distortion
        "ranges": { "black": 14, "white": 4050 } // 12+1+1 is BL offset
    },

    { // Quality C
        "make_model": [ "Panasonic DMC-ZS60", "Panasonic DMC-TZ80", "Panasonic DMC-TZ85" ],
        "dcraw_matrix": [ 8550, -2908, -842, -3195, 11529, 1881, -338, 1603, 4631 ] // DNG
    },

    { // Quality A, samples by Hombre
        "make_model": [ "Panasonic DC-ZS70", "Panasonic DC-TZ90", "Panasonic DC-TZ91", "Panasonic DC-TZ92", "Panasonic DC-TZ93" ],
        "dcraw_matrix": [ 9052,-3117,-883,-3045,11346,1927,-205,1520,4730 ], // DNG_V9.10.1 D65
        "raw_crop": [ 0, 6, -8, -2 ], // fullraw4/3 5264x3904 official 8,8,3896,5192 = 5184X3888. Dcraw 0,0,5200,3904 RT's frame gets smaller than dcraw but works better with auto distortion
        "ranges": { "black": 16, "white": 4050 } // 12+3+1 is BL offset
    },

    { // Quality C
        "make_model": [ "Panasonic DC-ZS80", "Panasonic DC-TZ95" ],
        "dcraw_matrix": [ 12194, -5340, -1329, -3035, 11394, 1858, -50, 1418, 5219 ] // DNG
    },

    // Panasonic DMC-FZ150,G10,G1,G2,G3,G5,GF1,GF2,GF3 are included as overwrites of the same items of rawimage.cc to test the dcraw9.21 patch

    { // Quality A, Replicated from rawimage.cc
        "make_model": [ "Panasonic DMC-G10", "Panasonic DMC-G2" ],
        "dcraw_matrix": [ 8310,-1811,-960,-4941,12990,2151,-1378,2468,6860 ], // Colin Walker
        "ranges": {
            "black": 15, // 15 is black offset, dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": [ 100, 200, 400, 800 ], "levels": 3920 }, // Exif:3967 distribution peak at 3967 +/- up to 50
                { "iso": [ 1600, 3200, 6400 ], "levels": 4060 } // Exif 3967, histogram peak 4095 and distribution down to 4070
            ]
        }
    },

    { // Quality A, Replicated from rawimage.cc
        "make_model": "Panasonic DMC-G1",
        "dcraw_matrix": [ 7477,-1615,-651,-5016,12769,2506,-1380,2475,7240 ], // Colin Walker
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": [ 100, 200, 400, 800 ], "levels": 3920 }, // Exif:4095 distribution peak at 3977 +/- up to 50
                { "iso": [ 1600, 3200 ], "levels": 4060 } // Exif 4095, histogram peak 4095 and distribution down to 4070
            ]
        }
    },

    { // Quality A, Replicated from rawimage.cc
        "make_model": "Panasonic DMC-G3",
        "dcraw_matrix": [ 6051,-1406,-671,-4015,11505,2868,-1654,2667,6219 ], // Colin Walker
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": 4060 } // Exif:4095 normal distribution 4080-4095, 4070-4095 on long exposure NR
    },

    { // Quality A, Replicated from rawimage.cc
        "make_model": "Panasonic DMC-G5",
        "dcraw_matrix": [ 7122,-2092,-419,-4643,11769,3283,-1363,2413,5944 ], // RT
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": 4060 // Exif:4095 normal distribution 4080-4095, 4070-4095 on long exposure NR
        }
    },

    { // Quality A, Replicated from rawimage.cc
        "make_model": "Panasonic DMC-GF1",
        "dcraw_matrix": [ 7863,-2080,-668,-4623,12331,2578,-1020,2066,7266 ], // Colin Walker
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": [ 100, 200, 400, 800 ], "levels": 3920 }, // Exif:4095 distribution peak at 3977 +/- up to 50
                { "iso": [ 1600, 3200 ], "levels": 4060 } // Exif 4095, histogram peak 4095 and distribution down to 4070
            ]
        }
    },

    { // Quality A, Replicated from rawimage.cc
        "make_model": "Panasonic DMC-GF2",
        "dcraw_matrix": [ 7694,-1791,-745,-4917,12818,2332,-1221,2322,7197 ], // Colin Walker
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": 4050 // Exif:4095 normal distribution 4080-4095, 4050-4095 on long exposure NR
        }
    },

    { // Quality A, Replicated from rawimage.cc
        "make_model": "Panasonic DMC-GF3",
        "dcraw_matrix": [ 8074,-1846,-861,-5026,12999,2239,-1320,2375,7422 ], // Colin Walker
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": 4050 // Exif:4095 normal distribution 4080-4095, 4050-4095 on long exposure NR
        }
    },

    { // Quality A, Replicated from rawimage.cc
        "make_model": "Panasonic DMC-GH1",
        "dcraw_matrix": [ 6360,-1557,-375,-4201,11504,3086,-1378,2518,5843 ], // Colin Walker
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": [ 100, 200, 400, 800 ], "levels": 3930 }, // Exif:4095 distribution peak at 3982 +/- up to 50
                { "iso": [ 1600, 3200 ], "levels": 4060 } // Exif 4095, histogram peak 4095 and distribution down to 4070
            ]
        }
    },

    { // Quality A, Replicated from rawimage.cc
        "make_model": "Panasonic DMC-GH2",
        //"dcraw_matrix": [ 6855,-1765,-456,-4223,11600,2996,-1450,2602,5761 ], // Colin Walker - disabled due to problems with underwater
        "dcraw_matrix": [ 7780,-2410,-806,-3913,11724,2484,-1018,2390,5298 ], // dcraw d65
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": [ 100, 200, 400, 800 ], "levels": 3930 }, // Exif:4095 distribution peak at 3982 +/- up to 50
                { "iso": [ 1600, 3200, 6400, 12800 ], "levels": 4060 } // Exif 4095, histogram peak 4095 and distribution down to 4070
            ]
        }
    },

    { // Quality B, variable WL
        "make_model": "Panasonic DMC-GH3",
        "dcraw_matrix": [ 6559,-1752,-491,-3672,11407,2586,-962,1875,5130 ], // dcp d65
        "ranges": {
            "black": 16, // 16 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 125, "levels": 3500 }, // gaussian 3600-4095
                { "iso": [ 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality B, some ISO WLevels are safely guessed
        "make_model": "Panasonic DMC-GH4",
        "dcraw_matrix": [ 7122,-2108,-512,-3155,11201,2231,-541,1423,5044 ], // DNG v13.2
        "ranges": {
            "black": 16, // 16 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 100, "levels": 2700 }, // gaussian center at 2870-2920 range +/- 150, Exif 2111
                { "iso": 125, "levels": 3100 }, // guessed
                { "iso": [ 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality C
        "make_model": "Panasonic DC-GH5",
        "dcraw_matrix": [ 7641,-2336,-605,-3218,11298,2187,-485,1338,5121 ], // DNG v13.2
        "ranges": {
            "black": 15, // 16 is BL offset. dcraw/RT read the base BL from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 100, "levels": 4080 }, // Exif_linearitylimit 2111
                { "iso": 125, "levels": 4080 }, // Exif_linearitylimit 2626
                { "iso": [ 160, 200, 250, 320, 400,500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality A
        "make_model": "Panasonic DMC-GM1",
        "dcraw_matrix": [ 6770,-1895,-744,-5232,13145,2303,-1664,2691,5703 ],
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 125, "levels": 3100 }, // bell shape 3150-3650 - Exif 2616
                { "iso": 160, "levels": 3600 }, // guessed from relative GX7 data
                { "iso": [ 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality B, uncertainty about ISO100 WL
        "make_model": "Panasonic DMC-GM5",
        "dcraw_matrix": [ 8238,-3244,-679,-3921,11814,2384,-836,2022,5852 ], // dng_v8.7 d65
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "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
            ]
        }
    },

    { // Quality A
        "make_model": [ "Panasonic DMC-GX7", "Panasonic DMC-GF7", "Panasonic DMC-GF8" ],
        "dcraw_matrix": [ 7610,-2780,-576,-4614,12195,2733,-1375,2393,6490 ],
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 125, "levels": 3100 },
                { "iso": 160, "levels": 3600 },
                { "iso": [ 200, 250, 320, 400,500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality A
        "make_model": [ "Panasonic DMC-G7", "Panasonic DMC-G70" ],
        "dcraw_matrix": [ 7610,-2781,-576,-4614,12195,2733,-1375,2393,6490 ], // DNG v13.2
        "ranges": {
            "black": 16, // 16 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 100, "levels": 2300 }, // gaussian 2300-2700 Exif_linearitylimit 2111
                { "iso": 125, "levels": 3180 }, // gaussian 3200-3600 Exif_linearitylimit 2626
                { "iso": [ 160, 200, 250, 320, 400,500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality B
        "make_model": [ "Panasonic DMC-GX80", "Panasonic DMC-GX85", "Panasonic DMC-GX7MK2" ],
        "dcraw_matrix": [ 7771,-3020,-629,-4029,11950,2345,-822,1976,6119 ], // DNG v13.2
        "ranges": {
            "black": 16, // 16 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 100, "levels": 2300 }, // gaussian 2300-2700 Exif_linearitylimit 2111
                { "iso": 125, "levels": 3180 }, // gaussian 3200-3600 Exif_linearitylimit 2626
                { "iso": [ 160, 200, 250, 320, 400,500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality X, no white-frames nor black-frames yet, see #4550
        "make_model": [ "Panasonic DC-GX9" ],
        "dcraw_matrix": [ 7564,-2263,-606,-3149,11238,2177,-540,1435,4853 ], // DNG v13.2
        "ranges": {
            "black": 16,
            "white": 4080
        }
    },

    { // Quality B, Same as Panasonic G7
        "make_model": [ "Panasonic DMC-G8", "Panasonic DMC-G80", "Panasonic DMC-G81", "Panasonic DMC-G85" ],
        "dcraw_matrix": [ 7610,-2781,-576,-4614,12195,2733,-1375,2393,6490 ], // DNG v13.2
        "ranges": {
            "black": 16, // 16 is BL offset. dcraw/RT read the base black from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 100, "levels": 2300 }, // gaussian 2300-2700 Exif_linearitylimit 2111
                { "iso": 125, "levels": 3180 }, // gaussian 3200-3600 Exif_linearitylimit 2626
                { "iso": [ 160, 200, 250, 320, 400,500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality B
        "make_model": "Panasonic DMC-GX8",
        "dcraw_matrix": [ 7564,-2263,-606,-3149,11238,2177,-540,1435,4853 ], // DNG v13.2
        "ranges": {
            "black": 15, // 16 is BL offset. dcraw/RT read the base BL from Exif and calculates total BL = BLbase+BLoffset
            "white": [
                { "iso": 100, "levels": 2800 }, // gaussian 2900-3200 Exif_linearitylimit 2111
                { "iso": 125, "levels": 3180 }, // guessed gaussian 3200-3600 Exif_linearitylimit 2626
                { "iso": [ 160, 200, 250, 320, 400,500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4080 } // nominal 4095
            ]
        }
    },

    { // Quality B, samples by Ingo, missing some long exposure at high ISO samples with LENR ON
        "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 offset. dcraw/RT read the base BL from Exif and calculates total BL = BLbase+BLoffset.
            "white": [
                { "iso": 100, "levels": 2400 }, // gaussian R,B 2450-2700 G1,G2 2550-2800 Exif_linearitylimit 2111
                { "iso": 125, "levels": 3000 }, // gaussian R,B 3050-3350 G1,G2 3170-3480 Exif_linearitylimit 2626
                { "iso": 160, "levels": 3800 }, // gaussian R,B 3850-median 4020 G1,G2 3870-median 4050 Exif_linearitylimit 3277
                { "iso": [ 200, 250, 320, 400 ], "levels": 4080 }, // nominal 4095
                { "iso": [ 500, 640, 800, 1000, 1250, 1600 ], "levels": 4060 }, // nominal 4095
                { "iso": [ 2000, 2500 ], "levels": 4040 }, // nominal 4095
                { "iso": [ 3200, 4000, 5000 ], "levels": 3950 }, // nominal 4095
                { "iso": [ 6400, 8000, 10000 ], "levels": 4020 }, // nominal 4095
                { "iso": [ 12800, 16000, 20000, 25600 ], "levels": 4000 } // nominal 4095
            ]
        }
    },

    { // Quality B, Intermediate ISOs missing
        "make_model": [ "Panasonic DMC-LX9", "Panasonic DMC-LX10", "Panasonic DMC-LX15" ],
        "dcraw_matrix": [ 7790,-2736,-755,-3452,11870,1769,-628,1647,4898 ], // DNg_v9.8 d65
        "raw_crop": [ 4, 4, -4, -4 ], // full raw frame 5488x3664 Exif crop 5472X3648 with 8pixel borders. Set the borders at 4 pixels which added with RT's 4 pixels border gives exactly the official frame.
        "ranges": {
            "black": 15, // 15 is BL offset. dcraw/RT read the base BL from Exif and calculates total BL = BLbase+BLoffset.
            "white": [
                { "iso": 80, "levels": 2800 }, // gaussian 2800-3000 Exif_linearitylimit 2626
                { "iso": 100, "levels": 3500 }, // gaussian 3500-3700 Exif_linearitylimit 3277
                { "iso": [ 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600, 2000, 2500, 3200, 4000, 5000, 6400, 12800, 25600 ], "levels": 4060 } // nominal 4095
            ]
        }
    },

    { // Quality A, issue #5204.
        "make_model": [ "Panasonic DC-S1" ],
        "dcraw_matrix": [ 9744, -3905, -779, -4899, 12807, 2324, -798, 1630, 5827 ], // ColorMatrix2 using illuminant D65 from Adobe DNG Converter 11.4
        "ranges": {
            "white": [
                { "iso": 50, "levels": 8400 }, // LENR 8000
                { "iso": 64, "levels": 10450 }, // LENR 10000
                { "iso": 80, "levels": 13050 }, // LENR 12400
                { "iso": 100, "levels": 16320 }
            ]
        }
    },

    { // Quality X, issue #5204. No white frames available.
        "make_model": [ "Panasonic DC-S1R" ],
        "dcraw_matrix": [ 11822, -5321, -1249, -5958, 15114, 766, -614, 1264, 7043 ], // ColorMatrix2 using illuminant D65 from Adobe DNG Converter 11.4
        "ranges": {
            "white": [
                { "iso": 50, "levels": 9500 },
                { "iso": [64, 80], "levels": 11600 },
                { "iso": 100, "levels": 16336 }
            ]
        }
    },

    { // Quality C
        "make_model": "Panasonic DC-S1H",
        "dcraw_matrix": [ 9397, -3719, -805, -5425, 13326, 2309, -972, 1715, 6034 ] // DNG
    },

    { // Quality C, possibly the same as DC-S1. We have a custom DCP which is better.
        "make_model": "Panasonic DC-S5",
        "dcraw_matrix": [ 9744, -3905, -779, -4899, 12807, 2324, -798, 1630, 5827 ] // DNG
    },

    { // Quality B, per ISO info missing
        "make_model": "PENTAX K-x",
        "dcraw_matrix": [ 8843,-2837,-625,-5025,12644,2668,-411,1234,7410 ], // adobe dcp d65
        "ranges": { "white": 4080 } // nominal at ISO200 4094
    },

    {
        "make_model": [ "PENTAX K-S1" ],
        "raw_crop": [ 0, 0, -8, 0 ]
    },

    { // Quality B, Intemediate ISO samples missing, Pentax_DNG WLtags are after BL sutraction and not valid
        "make_model": [ "RICOH PENTAX K-70", "PENTAX K-70" ],
        //"dcraw_matrix": [ 8050,-2061,-1264,-4359,12953,1515,-1096,1965,6075 ], // PENTAX DNG D65
        "dcraw_matrix": [ 8766,-3149,-747,-3976,11943,2292,-517,1259,5552 ], // Adobe DNGv9.8 D65
        "raw_crop": [ 58, 28, 6022, 4020 ], // full frame 6080x4064, useful raw frame 56,28,6080,4049, official DNG raw_crop 58,28,6080,4052, official jpeg crop 58+8,28+4 6000x4000
        //"raw_crop": [ 62, 28, 6000, 4000 ], // matched to official jpeg crop 58+8,28+4 6000x4000
        "ranges": {
            "white": [
                { "iso": 100, "levels": 16300 }, // 16319-16377
                { "iso": 200, "levels": 16250 }, // 16319-16315
                { "iso": 400, "levels": 16200 }, // 16255-16251
                { "iso": 800, "levels": 16050 }, // 16255-16120
                { "iso": 1600, "levels": 15750 }, // 15860
                { "iso": [ 3200, 6400 ], "levels": 16200 }, // 16350
                { "iso": [ 12800, 25600 ], "levels": 16100 }, // 16300
                { "iso": [ 51200, 102400 ], "levels": 16000 } // 16200
            ]
        }
    },

    { // Quality B, Intemediate ISO samples missing. Pentax_DNG WLtags are after BL sutraction and not valid
        "make_model": [ "RICOH PENTAX KP", "PENTAX KP" ],
        "dcraw_matrix": [ 7357,-2031,-1320,-4842,13555,1349,-1538,2416,5736 ], // Adobe DNGv9.12 D65
        "raw_crop": [ 52, 28, 6032, 4030 ], // full frame 6112x4060, useful raw frame 52,28,6084,4049, official DNG raw_crop 54,28,6082,4060
        "ranges": {
            "white": [
                { "iso": 100, "levels": 16300 }, // 16383
                { "iso": 200, "levels": 16250 }, // 16383
                { "iso": 400, "levels": 16250 }, // 16383
                { "iso": 800, "levels": 16200 }, // 16383
                { "iso": 1600, "levels": 16100 }, // 16383
                { "iso": [ 3200, 6400 ], "levels": 16000 }, // 16383
                { "iso": [ 12800, 25600 ], "levels": 15800 }, // 16383
                { "iso": [ 51200, 102400 ], "levels": 15500 }, // 16383
                { "iso": [ 204800, 409600 ], "levels": 15000 }, // 16383
                { "iso": [ 819200 ], "levels": 14500 } // 16383-16200
            ]
        }
    },

    { // Quality B, Intemediate ISO samples missing, Pentax_DNG WLtags are after BL sutraction and not valid
        "make_model": [ "RICOH PENTAX K-1", "PENTAX K-1" ],
        "dcraw_matrix": [ 8596,-2981,-639,-4202,12045,2431,-685,1424,6122 ], // DNG v13.2
        //"dcraw_matrix": [ 8566,-2746,-1201,-3612,12204,1550,-893,1680,6264 ], // PENTAX DNG
        //"raw_crop": [ 6, 18, 7376, 4932 ], // full frame 7392x4950, cropped to official DNG raw_crop 6,18,7382,4950, official jpeg crop 8,10,7360x4912
        "ranges": {
            "white": [
                { "iso": [ 100, 200, 400, 800 ], "levels": 16300 }, // 16380
                { "iso": [ 1600, 3200 ], "levels": 16250 }, // 16360
                { "iso": [ 6400, 12800 ], "levels": 16200 }, // 16330
                { "iso": [ 25600, 51200 ], "levels": 16100 }, // 16300
                { "iso": 102400, "levels": 16000 } // 16200
            ]
        }
    },

    { // Quality C, possibly the same as K-1
        "make_model": [ "RICOH PENTAX K-1 Mark II", "PENTAX K-1 Mark II" ],
        "dcraw_matrix": [ 8596, -2981, -639, -4202, 12045, 2431, -685, 1424, 6122 ] // DNG
    },

    { // Quality B, intermediate ISOs info missing
        "make_model": [ "RICOH PENTAX K-3", "PENTAX K-3" ],
        "dcraw_matrix": [ 7415,-2052,-721,-5186,12788,2682,-1446,2157,6773 ], // adobe dcp d65
        //"dcraw_matrix": [ 8542,-2581,-1144,-3995,12301,1881,863,1514,5755 ], // pentax DNG
        //"dcraw_matrix": [ 6464,-1574,-422,-5324,12712,2934,-1129,1724,6900 ], // DxO
        "raw_crop": [ 10, 4, 6028, 4024 ],
        "ranges": {
            "white": [
                { "iso": 100, "levels": 16310 }, // 16317 or 16350
                { "iso": 200, "levels": 16120 }, // 16254 or 16125
                { "iso": 400, "levels": 15860 }, // 16125 or 15868
                { "iso": 800, "levels": 15360 }, // 15868 or 15364-15370
                { "iso": [ 1600, 3200, 6400, 12800, 25600, 51200 ], "levels": 16300 } // 16383 - pentax dng tag is 15868-15350
            ]
        }
    },

    { // Quality C
        "make_model": ["RICOH PENTAX K-3 MARK III", "PENTAX K-3 MARK III"],
        "dcraw_matrix" : [7003, -1618, -887, -4614,  12728,  2065, -645,  1441,  5734],
        "raw_crop": [ 24, 34, -28, -14 ]
    },

    { // Quality B, intermediate ISOs info missing
        "make_model": [ "RICOH PENTAX 645Z", "PENTAX 645Z" ],
        "dcraw_matrix": [ 9519,-3591,-664,-4074,11725,2671,-624,1501,6653 ], // adobe dcp d65
        "raw_crop": [ 48, 0, 8276, 6208 ], // full sensor 8384x6208 - official jpeg 8256x6192
        "ranges": {
            "white": [
                { "iso": 100, "levels": 16310 }, // 16317 or 16350
                { "iso": 200, "levels": 16120 }, // 16254 or 16125
                { "iso": 400, "levels": 15860 }, // 16125 or 15868
                { "iso": 800, "levels": 15360 }, // 15868 or 15364-15370
                { "iso": [ 1600, 3200, 6400, 12800, 25600, 51200 ], "levels": 16300 } // 16383 - pentax dng tag is 15868-15350
            ]
        }
    },

    { // Quality B, intermediate ISOs info missing, spread due to blackframe subtraction guessed to be around 10levels
        "make_model": "PENTAX K10D",
        "dcraw_matrix": [ 9679, -2965, -811, -8622, 16514, 2182, -975, 883, 9793 ], // DNG v13.2
        //"raw_crop": [ 0, , 3888, 2608 ],
        "ranges": {
            "white": [
                { "iso": 100, "levels": 4080 }, // R,G1,B = 4095 G2= 4087
                { "iso": 200, "levels": 4080 }, // R,G1,B = 4093-94 G2= 4087or94
                { "iso": 400, "levels": 4080 }, // R,G1 = 4093-94, B=4094 G2= 4087or93or94
                { "iso": 800, "levels": 4070 }, // R,G1 = 4091-4093, B=4091-92 G2= 4078or82or84-86
                { "iso": [ 1600, 3200 ], "levels": 4060 } // 4067or4073-76
            ]
        }
    },

    { // Quality C, only raw crop
        "make_model": "Samsung EX2F",
        "raw_crop": [ 16, 7, -4, -4 ]
    },

    { // Quality B, corrections for raw crop vs dcraw9.21, matched to Samsung's default
        "make_model": "Samsung NX mini",
        "dcraw_matrix": [ 5222,-1196,-550,-6540,14649,2009,-1666,2819,5657 ], // dng 8.6 d65
        "raw_crop": [ 128, 36, 5480, 3656 ], // jpeg 5472x3648 - full raw: 5664 x 3710 - Samsung's official crop: 132, 40, 5604, 3688
        "ranges": { "white": 4030 } // double clipping point for each channel at a) 4095 and b) bell distribution with peak at 4038 .. used the conservative one
    },

    {  // Quality A, Conflict with "Samsung NX30" in dcraw_v9.21_r1.414, frame corrections and color data
        "make_model": [ "Samsung NX3000", "Samsung NX3300" ],
        "dcraw_matrix": [ 8060,-2933,-761,-4504,12890,1762,-630,1489,5227 ], // DNG_v8.7.1 D65
        "raw_crop": [ 92, 38, 5480, 3656 ] // jpeg 5472x3648 - full raw: 5600 x 3714 - Samsung's official crop: 96, 42, 5568, 3690
        },

    {  // Quality B, RT normally use the embedded data with DNGs but because various DNGs use different color matrix, adobe_coeff setting is used in dcraw.cc to always use the data from camconst.json for NX1
        "make_model": [ "Samsung NX1", "Samsung NX500" ],
        "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 v1.0
        "ranges": {
           "white": [
              { "iso": 100, "levels": 16000 }, // 16000 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 C, corrections for frame size, black and white levels not declared properly
        "make_model": "Sigma SD9",
        "dcraw_matrix": [ 14996,-3468,-1425,5576,3642,972,1761,3773,3720 ], // experimental calculated from sun0.icc data
        "ranges": { "black": 0, "white": 16383 }, // black is already subtracted by dcraw, white copied from x3dump data
        "raw_crop": [ 20, 8, -18, -12 ]
    },

    { // Quality C, corrections for frame size, black level not declared properly
        "make_model": "Sigma SD10",
        "dcraw_matrix": [ 12555,-1865,-1125,5093,4120,867,1929,3810,3507 ], // experimental calculated from .icc data
        "ranges": { "black": 0, "white": 16383 }, // black is already subtracted by dcraw, white copied from x3dump data
        //"raw_crop": [ 0, 0, -0, -0 ]
       "raw_crop": [ 20, 8, -18, -12 ]
    },

    { // Quality C, corrections for frame size, black and white levels not declared properly
        "make_model": "Sigma SD14",
        "dcraw_matrix": [ 16411,-4764,-2383,8110,2603,-645,3135,3878,1984 ], // experimental inverted icc wp12 - build with BL=15
        //"dcraw_matrix": [ 13804,-4156,-1896,6917,1909,-431,2768,2989,1741 ], // experimental inverted icc wp10 - build with BL=15
        "ranges": { "black": 15, "white": 7000 },
        "raw_crop": [ 18, 12, 2652, 1768 ]
    },

    { // Quality C, correction for frame width
        "make_model": "Sigma SD1",
        "dcraw_matrix": [ 5270,42,-814,3737,5506,124,1112,9714,4510 ], // experimental from icm 1.04477,-0.74838,1.01617, -0.54028,2.52690,-3.83257, 0.54869,-0.69556,3.73746
        "ranges": { "black": 16, "white": 4070 }, // BL is 16 or 31, should be measured at the horizontal black stripe at the top
        "raw_crop": [ 12, 52, -110, -8 ]
    },

    { // Quality C, correction for frame width, color matrix investigated ..
        "make_model": "Sigma SD1 Merrill",
        "dcraw_matrix": [ 7211,-1577,-769,4996,3428,440,2717,7117,4699 ], // experimental inverted icc cloudy8140 d65
        //"dcraw_matrix": [ 5666,139,-892,3780,5428,270,1366,9757,4526 ], // experimental inverted icc sunny8161
        //"dcraw_matrix": [ 10288,-2449,-1718,8976,1868,-1608,7011,5039,-249 ], // experimental inverted icc tungsten8130 wp11
        //"dcraw_matrix": [ 5864,679,-1491,2963,7635,-919,-640,13738,2790 ], // experimental inverted icc sunny8160
        //"dcraw_matrix": [ 14032,-2231,-1016,-5263,14816,170,-112,183,9113 ], // hardcoded
        "ranges": { "black": 16, "white": 4070 }, // BL is 16 or 31, should be measured at the horizontal black stripe at the top
        "raw_crop": [ 12, 52, -110, -8 ] // for small size all numbers/2
    },

    { // Quality C, correction for frame width, color matrix measured on a DP1 sample ..
        "make_model": [ "Sigma DP1 Merrill", "Sigma DP2 Merrill", "Sigma DP3 Merrill" ],
        //"dcraw_matrix": [ 2149,1003,-530,-494,6073,344,-3935,10665,3608 ], // experimental, inverted icc DP1_Merrill_dpreview_daylight WP1.2
        "dcraw_matrix": [ 2517,1175,-621,-587,7080,404,-4677,12402,4231 ], // experimental, inverted icc DP1_Merrill_dpreview_daylight WP1.4
        "ranges": { "black": 16, "white": 4070 }, // BL is 16 or 31, should be measured at the horizontal black stripe at the bottom
        "raw_crop": [ 12, 0, -110, -62 ] // for small size all numbers/2
    },

    { // Quality C, only raw crop for now - see #3858
        "make_model": "Sigma sd Quattro",
        "raw_crop": [ 200, 74, 5632, 3698 ]
    },

    { // Quality C
        "make_model": "Sigma fp",
        "dcraw_matrix": [ 12431, -5541, -1000, -4387, 12361, 2265, -732, 1526, 5970 ] // DNG
    },

    { // Quality C
        "make_model": "Sony NEX-F3",
        "dcraw_matrix": [ 5991, -1456, -455, -4764, 12135, 2980, -707, 1424, 6701 ] // DNG
    },

    { // 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
        "dcraw_matrix": [ 5991,-1456,-455,-4764,12135,2980,-707,1424,6701 ], // DNG v13.2
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality A, correction for frame width
        "make_model": "Sony NEX-5N",
        "dcraw_matrix": [ 5991,-1456,-455,-4764,12135,2980,-707,1424,6701 ], // DNG v13.2
        "raw_crop": [ 0, 0, 4920, 3276 ],
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality A
        "make_model": "Sony ILCA-77M2",
        "dcraw_matrix": [ 5991,-1732,-443,-4100,11989,2381,-704,1467,5992 ], // adobe dcp d65
        "raw_crop": [ 0, 0, 6024, 4024 ],
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality B
        "make_model": "Sony ILCA-68",
        "dcraw_matrix": [ 6435,-1903,-536,-4722,12448,2550,-663,1363,6516 ], // DNG v13.2
        "raw_crop": [ 0, 0, -30, 0 ],
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality B, correction for frame width, crop modes covered
        "make_model": "Sony ILCA-99M2",
        "dcraw_matrix": [ 6660,-1918,-472,-4613,12398,2485,-649,1433,6447 ], // DNG v13.2
        "raw_crop": [ 0, 0, -36, 0 ], // full raw frame 8000x5320 - 36 rightmost columns are garbage
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality C
        "make_model": "Sony ILCE-1",
        "dcraw_matrix": [ 8161, -2947, -739, -4811, 12668, 2389, -437, 1229, 6524 ] // DNG v13.2
    },

    { // Quality A, correction for frame width
        "make_model": [ "Sony ILCE-3000", "Sony ILCE-3500", "Sony ILCE-5000", "Sony ILCE-QX1" ],
        "dcraw_matrix": [ 5991,-1456,-455,-4764,12135,2980,-707,1424,6701 ], // DNG v13.2
        "ranges": { "black": 512, "white": 16300 },
        "raw_crop": [ 0, 0, 5476, 3656 ]
    },

    { // Quality A
        "make_model": "Sony ILCE-5100",
        "dcraw_matrix": [ 5991,-1456,-455,-4764,12135,2980,-707,1424,6701 ], // DNG v13.2
        "raw_crop": [ 0, 0, 6024, 4024 ],
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality A
        "make_model": "Sony ILCE-6000",
        "dcraw_matrix": [ 5991,-1456,-455,-4764,12135,2980,-707,1424,6701 ], // adobe dcp d65
        "raw_crop": [ 0, 0, 6024, 4024 ],
        "ranges": { "black": 512, "white": 16300 },
        // detected by hand, using the picture from https://www.dpreview.com/forums/thread/3923513
        // P 11 P 23 P 17 P 17 P 17 P 23 P 11 P 17 P 17 P 17 P 23 P 11 P 23 P 11 P 17 P 23 P 11 P 17 P 17 P 23 P 17 P 11 P 17 P 17 P 17 P 23 P 17 P 11 P 17 P 17 P 23 P 11 P 17 P 11 P 23
        "pdaf_pattern" : [ 0,12,36,54,72,90,114,126,144,162,180,204,216,240,252,270,294,306,324,342,366,384,396,414,432,450,474,492,504,522,540,564,576,594,606,630 ],
        "pdaf_offset" : 3
    },

    { // Quality B, probably similar to ILCE-6000 / 6300 / 6500, not checked
        "make_model": [ "Sony ILCE-6100","Sony ILCE-6400","Sony ILCE-6600" ],
        "dcraw_matrix": [ 7657, -2847, -607, -4083, 11966, 2389, -684, 1418, 5844 ], // DNG
        "raw_crop": [ 0, 0, 6024, 4024 ],
        "ranges": { "black": 512, "white": 16300 },
        "pdaf_pattern" : [ 0,12,36,54,72,90,114,126,144,162,180,204,216,240,252,270,294,306,324,342,366,384,396,414,432,450,474,492,504,522,540,564,576,594,606,630 ],
        "pdaf_offset" : 3
    },

    { // Quality A
        "make_model": [ "Sony ILCE-6300","Sony ILCE-6500" ],
        "dcraw_matrix": [ 5973,-1696,-419,-3826,11797,2293,-639,1398,5789 ], // DNG_v9.8 D65
        "raw_crop": [ 0, 0, 6024, 4024 ],
        "ranges": { "black": 512, "white": 16300 },
        // contributed by Horshak from https://www.dpreview.com/forums/post/60873077
        "pdaf_pattern" : [ 0,12,36,54,72,90,114,126,144,162,180,204,216,240,252,270,294,306,324,342,366,384,396,414,432,450,474,492,504,522,540,564,576,594,606,630 ],
        "pdaf_offset" : 3
    },

    { // Quality C
        "make_model": [ "Sony ILCE-6700" ],
        "raw_crop": [ 0, 0, 6244, 4168 ]
    },

    { // Quality C
        "make_model": "Sony ILCE-7C",
        "dcraw_matrix": [ 7374, -2389, -551, -5435, 13162, 2519, -1006, 1795, 6552 ]
    },

    { // Quality A, correction for frame width
        "make_model": "Sony ILCE-7R",
        "dcraw_matrix": [ 4913,-541,-202,-6130,13513,2906,-1564,2151,7183 ],
        "raw_crop": [ 0, 0, 7372, 4920 ],
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality A
        "make_model": "Sony ILCE-7M2",
        "raw_crop": [ 0, 0, 6024, 4024 ],
        "dcraw_matrix": [ 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 ], // DNGv8.7.1
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality C, correction for frame width
        "make_model": [ "Sony DSC-RX0", "Sony DSC-RX0M2" ],
        "dcraw_matrix": [ 9396, -3507, -843, -2497, 11111, 1572, -343, 1355, 5089 ],
        "raw_crop": [ 0, 0, -8, 0 ] // 8 rightmost columns are garbage
    },

    { // Quality C
        "make_model": "Sony DSC-RX1R",
        "dcraw_matrix": [ 6344, -1612, -462, -4863, 12477, 2681, -865, 1786, 6899 ]
    },

    { // Quality B, correction for frame width, crop modes covered
        "make_model": [ "Sony ILCE-7RM2", "Sony DSC-RX1RM2" ],
        "dcraw_matrix": [ 6629,-1900,-483,-4618,12349,2550,-622,1381,6514 ], // DNG_v9.1.1 D65
        "raw_crop": [ 0, 0, -36, 0 ], // full raw frame 8000x5320 - 36 rightmost columns are garbage
        "ranges": { "black": 512, "white": 16300 },
        // PDAF lines pattern detected from image provided by elite4jonny at https://github.com/Beep6581/RawTherapee/issues/6801.
        "pdaf_pattern" : [ 0,24,36,60,84,120,132,156,192,204,240,252,276,300,324,360,372,396,420,444,480,492,504,540,564,576,612,636,660,696,720,732,756,780,804,840 ],
        "pdaf_offset" : 31
    },

    { // Quality C, color matrix copied from ILCE-9, LongExposures 2-3sec only
        "make_model": "Sony ILCE-7M3",
        "dcraw_matrix": [ 7374, -2389, -551, -5435, 13162, 2519, -1006, 1795, 6552 ], // DNG v13.2
        // "raw_crop": [ 8, 8, 6008, 4008 ], // full raw frame 6048x4024 Dcraw auto identify 6024x4024, jpeg 12,12,6000x4000
        // "ranges": { "black": 512, "white": 16300 }
        "ranges": {
            "black": 512,
            "white": [
                { "iso": [ 50, 64 ], "levels": 16100 }, // typical compressed 16372, non compressed 16383, LongEx iso50,16150 , 16275
                { "iso": [ 80, 100, 125, 160 ], "levels": 16200 }, // typical compressed 16372, non compressed 16383, LongEx iso50,16150 , 16275
                { "iso": [ 200, 250, 320, 400, 500, 640, 800, 1000, 1250 ], "levels": 16200 }, // compressed 16372, non compressed 16383, LongExp 16275
                { "iso": [ 1600, 2000, 2500, 3200, 4000, 5000 ], "levels": 16200 }, // compressed 16372, non compressed 16383, LongExp 16275
                { "iso": [ 6400, 8000, 10000, 12800 ], "levels": 16200 }, // compressed 16372, non compressed 16365-16375-16383, LongExp 16275
                { "iso": [ 16000, 20000, 25600 ], "levels": 16100 }, // 16275-16340-16372, nc 16375-16325-16280, LongExp 16210
                { "iso": [ 32000, 40000, 51200 ], "levels": 16100 }, // 16210-16340-16372, nc 16330, LongExp 16210
                { "iso": [ 64000, 80000, 102400 ], "levels": 16100 }, // g16340 , nc 16330, LongExp 16210
                { "iso": [ 128000, 160000, 204800 ], "levels": 16000 } // r16275, g16340, nc 16330, LongExp 16330-16370
            ]
        },
        // A7III, from https://www.dpreview.com/forums/post/60843139
        // in the original post:
        //   P 5 P 17 P 11 P 11 P 17 P 11 P 5 P 11 P 11 P 11 P 17 P 11 P 5 P 11 P 11 P 17 P 5 P 11 P 17 P 5 P 17 P 5 P 11 P 11 P 11 P 17 P 5 P 11 P 11 P 11 P 5 P 17 P 5 P 17 P 11
        //
        // rotated to match the start of the frame
        //   P 11 P 11 P 11 P 17 P 11 P 5 P 11 P 11 P 17 P 5 P 11 P 17 P 5 P 17 P 5 P 11 P 11 P 11 P 17 P 5 P 11 P 11 P 11 P 5 P 17 P 5 P 17 P 11 P 5 P 17 P 11 P 11 P 17 P 11 P 5
        "pdaf_pattern" : [ 0,12,24,36,54,66,72,84,96,114,120,132,150,156,174,180,192,204,216,234,240,252,264,276,282,300,306,324,336,342,360,372,384,402,414,420],
        "pdaf_offset" : 9
    },

    { // Quality C
        "make_model": "Sony ILCE-7M4",
        "dcraw_matrix": [ 7460, -2365, -588, -5687, 13442, 2474, -624, 1156, 6584 ], // ColorMatrix2 using illuminant D65 from Adobe DNG Converter 14.2
        "raw_crop": [ 0, 0, -10, 0 ]
    },

    { // Quality C,
        "make_model": "Sony ILCE-7RM3",
        "dcraw_matrix": [ 6640,-1847,-503,-5238,13010,2474,-993,1673,6526 ], // DNG v13.2
        "raw_crop": [ 0, 0, -36, 0 ], // full raw frame 8000x5320 - 36 rightmost columns are garbage
        "ranges": { "black": 512, "white": 16300 },
        "pdaf_pattern" : [0, 24, 36, 60, 84, 120, 132, 156, 192, 204, 240, 252, 276, 300, 324, 360, 372, 396, 420, 444, 480, 492, 504, 540, 564, 576, 612, 636, 660, 696, 720, 732, 756, 780, 804, 840],
        "pdaf_offset" : 31
    },

    { // Quality C,
        "make_model": "Sony ILCE-7RM4",
        "dcraw_matrix": [ 7662, -2686, -660, -5240, 12965, 2530, -796, 1508, 6167 ],
        "raw_crop": [ 0, 0, -32, 0 ], // full raw frame 9600x6376 - 32 rightmost columns are garbage. Using -32 instead of 9568 to support also 16-shot pixelshift files
        "pdaf_pattern": [ 0,12,18,36,42,60,66,72,78,96,108,120,126,138,156,168,180,186,192,198,210,222,228,240,246,252,270,276,282,288,306,312,318,330,336,348,360,366,372,378,390,396,408,420 ], // Assume the pattern is the same as the ILCE-7CR.
        "pdaf_offset": 1
    },

    { // Quality B
        "make_model": [ "Sony ILCE-7CR", "Sony ILCE-7RM5" ], // 7RM5 is assumed to have the same sensor as the 7CR.
        "dcraw_matrix": [ 8200, -2976, -719, -4296, 12053, 2532, -429, 1282, 5774 ], // DNG v15.2 for ILCE-7CR and ILCE-7RM5.
        "raw_crop": [ 0, 0, 9564, 6374 ], // From ART
        "pdaf_pattern": [ 0,12,18,36,42,60,66,72,78,96,108,120,126,138,156,168,180,186,192,198,210,222,228,240,246,252,270,276,282,288,306,312,318,330,336,348,360,366,372,378,390,396,408,420 ], // From issue #6938. Slightly different every repetition, maybe the real pattern is 3 or more multiples of 420 pixels. This is a composite.
        "pdaf_offset": 1
    },

    { // Quality B, assumed correct for 9M2 as well
        "make_model": ["Sony ILCE-9","Sony ILCE-9M2"],
        "dcraw_matrix": [ 6389,-1703,-378,-4562,12265,2587,-670,1489,6550 ], // DNG_v9.12 D65
        "raw_crop": [ 8, 8, 6008, 4008 ], // full raw frame 6048x4024 Dcraw auto identify 6024x4024, jpeg 12,12,6000x4000
        "ranges": { "black": 512, "white": 16300 },
        // the A9 is the same as the A7III, rotated of 1 position
        // source: https://www.dpreview.com/forums/post/60857788
        // P 11 P 11 P 11 P 17 P 11 P 5 P 11 P 11 P 17 P 5 P 11 P 17 P 5 P 17 P 5 P 11 P 11 P 11 P 17 P 5 P 11 P 11 P 11 P 5 P 17 P 5 P 17 P 11 P 5 P 17 P 11 P 11 P 17 P 11 P 5
        "pdaf_pattern" : [ 0,12,24,36,54,66,72,84,96,114,120,132,150,156,174,180,192,204,216,234,240,252,264,276,282,300,306,324,336,342,360,372,384,402,414,420 ],
        "pdaf_offset" : -7
    },

    { // Quality C
        "make_model": "SONY ILCE-9M3",
        "raw_crop": [ 8, 8, 6008, 4008 ] // From ART
    },

    { // Quality B, correction for frame width
        "make_model": [ "Sony ILCE-7S", "Sony ILCE-7SM2" ],
        "dcraw_matrix": [ 5838,-1430,-246,-3497,11477,2297,-748,1885,5778 ], // DNG_v9.2 D65
        "raw_crop" : [
            { "frame" : [ 2816, 1872 ], "crop" : [ 0, 0, 2792, 1872 ] },
            { "frame" : [ 4254, 2848 ], "crop" : [ 0, 0, 4254, 2848 ] }
        ],
        "ranges": { "black": 512, "white": 16300 }
    },

    { // Quality C
        "make_model": "Sony ILCE-7SM3",
        "dcraw_matrix": [ 6912, -2127, -469, -4470, 12175, 2587, -398, 1477, 6492 ] // DNG
    },

    { // Quality C
        "make_model": [ "Sony DSC-HX95", "Sony DSC-HX99" ],
        "dcraw_matrix": [ 13076, -5686, -1481, -4027, 12851, 1251, -167, 725, 4937 ],
        "raw_crop": [ 0, 0, -8, 0 ], // 8 rightmost columns are garbage
        "ranges": { "black": 800, "white": 16300 }
    },

    { // Quality B
        "make_model": [ "Sony DSC-R1" ],
        "raw_crop": [ 0, 0, 3924, 2608 ],
        "ranges": { "white": 16368 }
    },

    { // Quality C
        "make_model": "Sony DSC-RX100",
        "dcraw_matrix": [ 8651, -2754, -1057, -3464, 12206, 1373, -568, 1398, 4434 ], // DNG
        "ranges": { "black": 800, "white": 16300 }
    },

    { // Quality A
        "make_model": [ "Sony DSC-RX100M2", "Sony DSC-RX100M3", "Sony DSC-RX100M4", "Sony DSC-RX100M5" ],
        "dcraw_matrix": [ 6596,-2079,-562,-4782,13016,1933,-970,1581,5181 ], // DNG_v9.8 D65
        "ranges": { "black": 800, "white": 16300 }
    },

    { // Quality C
        "make_model": "Sony DSC-RX100M5A",
        "dcraw_matrix": [ 11176, -4700, -965, -4004, 12184, 2032, -764, 1726, 5876 ], // DNG
        "ranges": { "black": 800, "white": 16300 }
    },

    { // Quality C
        "make_model": "Sony DSC-RX100M6",
        "dcraw_matrix": [ 7325, -2321, -596, -3494, 11674, 2055, -668, 1562, 5031 ], // DNG
        "ranges": { "black": 800, "white": 16300 }
    },

    { // Quality C
        "make_model": "Sony DSC-RX100M7",
        "dcraw_matrix": [ 10315, -4390, -937, -4859, 12734, 2365, -735, 1537, 5997 ], // DNG
        "ranges": { "black": 800, "white": 16300 }
    },

    { // Quality B
        "make_model": [ "Sony DSC-RX10M2", "Sony DSC-RX10M3" ],
        "dcraw_matrix": [ 6679,-1825,-745,-5047,13255,1953,-1580,2422,5183 ], //DNG v13.2
        "ranges": { "black": 800, "white": 16300 }
    },

    { // Quality B
        "make_model": "Sony DSC-RX10M4", // Similar to M2 and M3, different matrix
        "dcraw_matrix": [ 7699, -2566, -629, -2967, 11270, 1928, -378, 1286, 4807 ], // DNG v13.2
        "ranges": { "black": 800, "white": 16300 }
    },

    { // Quality C
        "make_model": "Sony DCZV1B", // Sony ZV-1
        "dcraw_matrix": [ 8280, -2987, -703, -3532, 11645, 2133, -550, 1542, 5312 ] // DNG
    },

    { // Quality C
        "make_model": "Sony SLT-A99V",
        "dcraw_matrix": [ 6344, -1612, -462, -4863, 12477, 2681, -865, 1786, 6899 ] // DNG
    },

    { // Quality A
        "make_model": "Sony ZV-1",
        "dcraw_matrix": [ 8280, -2987, -703, -3531, 11645, 2133, -550, 1542, 5312 ], // DNG v15.2
        "ranges": { "black": 800 }, // White level from EXIF.
        "raw_crop": [ 0, 0, 5496, 3672 ],
        "pdaf_pattern": [0, 24, 48, 72, 88, 120],
        "pdaf_offset": 17
    },

    { // Quality C, No proper color data, beta samples, frame set to official jpeg,
        "make_model": [ "XIAOYI M1", "YI TECHNOLOGY M1" ],
        "dcraw_matrix": [ 7158,-1911,-606,-3603,10669,2530,-659,1236,5530 ], // XIAO YI DNG D65
        "raw_crop": [ 4, 3, 5192, 3896 ], // full raw 5200x3902, official jpeg 5184X3888
        "ranges": {
            "white": [
                { "iso": 100, "levels": 4080 }, // typical 4092-4094
                { "iso": [ 200, 400, 800, 1600, 3200, 6400 ], "levels": 4080 }, // 4092-4095
                { "iso": [ 12800, 25600, 51200 ], "levels": 4080 } // 4090-4095
            ]
        }
    },

/*  Phase One: color matrices borrowed from Adobe DNG Converter, black/white levels tested on actual raw files.
    Note: the dcraw decoder makes black level subtraction and various corrections to the raw values based on
    metadata embedded in the IIQ format, so what we see here is the result after that, ie black level is 0,
    and white level is typically at or close to 65535. However sensors vary a bit and can be noisy around clip
    so we cut away 0.05 stop from top down to 63300 to be a bit conservative.
*/

    { // Quality A
        "make_model": [ "Phase One P40+", "Phase One IQ140", "Leaf Credo 40", "Phase One P65+", "Phase One IQ160", "Leaf Credo 60", "Phase One IQ260", "Phase One IQ3 60MP" ],
        "dcraw_matrix": [ 8035,435,-962,-6001,13872,2320,-1159,3065,5434 ],
        "ranges": { "black": 0, "white": 63300 }
    },

    { // Quality A
        "make_model": [ "Phase One IQ180", "Leaf Credo 80", "Phase One IQ280", "Phase One IQ3 80MP" ],
        "dcraw_matrix": [ 6294,686,-712,-5435,13417,2211,-1006,2435,5042 ],
        "ranges": { "black": 0, "white": 63300 }
    },

    { // Quality A
        "make_model": [ "Phase One P20", "Phase One P20+", "Phase One P25", "Phase One P25+" ],
        "dcraw_matrix": [ 2905,732,-237,-8135,16626,1476,-3038,4253,7517 ],
        "ranges": { "black": 0, "white": 63300 }
    },

    { // Quality A
        "make_model": [ "Phase One P21", "Phase One P21+" ],
        "dcraw_matrix": [ 6516,-2050,-507,-8217,16703,1479,-3492,4741,8489 ],
        "ranges": { "black": 0, "white": 63300 }
    },

    { // Quality A
        "make_model": [ "Phase One P30", "Phase One P30+"],
        "dcraw_matrix": [ 4516,-244,-36,-7020,14976,2174,-3206,4670,7087 ],
        "ranges": { "black": 0, "white": 63300 }
    },

    { // Quality A
        "make_model": [ "Phase One P45", "Phase One P45+" ],
        "dcraw_matrix": [ 5053,-24,-117,-5685,14077,1703,-2619,4491,5850 ],
        "ranges": { "black": 0, "white": 63300 }
    },

    { // Quality X, matrix taken from H5D-50c which has the same sensor, probably with the same CFA. Color looks good to the eye with files tested.
        "make_model": [ "Phase One IQ250", "Leaf Credo 50", "Phase One IQ3 50MP" ],
        "dcraw_matrix": [ 4932, -835, 141, -4878, 11868, 3437, -1138, 1961, 7067 ],
        "ranges": { "black": 0, "white": 64400 } // CMOS sensor, we dare to set white level a bit higher than for the more varying Phase One CCDs
    },

    { // Quality C, matrix made from crappy cc24 photo
        "make_model": [ "Phase One IQ3 100MP" ],
        "dcraw_matrix": [ 4479,-895,-536,-5818,13569,2742,-1186,2190,7909],
        "ranges": { "black": 0, "white": 64400 }
    },

    { // Quality B
        "make_model": ["HASSELBLAD NEX-7", "SONY NEX-7"], // Hasselblad NEX-7 also known as Hasselblad Lunar
        "dcraw_matrix": [ 5491,-1192,-363,-4951,12342,2948,-911,1722,7191 ], // DNG v13.2
        "ranges": { "black": 512, "white": 16372 } // Typical white level (samples provided by @ggc on Pixls, influence from LENR unknown
    },

    { // Quality A for tested CFV, the other models have the same sensor (16 megapixel square sensor)
        "make_model": [ "Hasselblad V96C", "Hasselblad CFV", "Hasselblad CFV-II" ],
        "dcraw_matrix": [ 8519, -3260, -280, -5081, 13459, 1738, -1449, 2960, 7809 ] // borrowed from Adobe's DNG converter
    },

    { // Quality A for tested CF-22, the other models have the same sensor
        "make_model": [ "Hasselblad CF-22", "Hasselblad CF-22MS", "Hasselblad CFH-22", "Hasselblad H3D-22", "Hasselblad H3DII-22" ],
        "dcraw_matrix": [ 8519, -3260, -280, -5081, 13459, 1738, -1449, 2960, 7809 ] // borrowed from Adobe's DNG converter
    },

    { // Quality A for tested H3D-31, the other models have the same sensor
        "make_model": [ "Hasselblad H3D-31", "Hasselblad H3DII-31", "Hasselblad H4D-31" ],
        "dcraw_matrix": [ 5458, -1448, 145, -4479, 12338, 2401, -1659, 3086, 6710 ] // borrowed from Adobe's DNG converter
    },

    { // Quality A for tested CFV-39, the other models have the same sensor. Small filter differences may exist so some might do better with a slightly different profile
        "make_model": [ "Hasselblad CF-39", "Hasselblad CF-39MS", "Hasselblad CFH-39", "Hasselblad CFV-39", "Hasselblad H3D-39", "Hasselblad H3DII-39", "Hasselblad H3DII-39MS" ],
        "dcraw_matrix": [ 3857, 452, -46, -6008, 14477, 1596, -2627, 4481, 5718 ] // borrowed from Adobe's DNG converter
    },

    { // Quality A for tested CFV-50, the other models have the same sensor
        "make_model": [ "Hasselblad CFV-50", "Hasselblad H3DII-50", "Hasselblad H3DII-50MS", "Hasselblad H4D-50", "Hasselblad H4D-50MS", "Hasselblad H4D-200MS", "Hasselblad H5D-50", "Hasselblad H5D-50MS", "Hasselblad H5D-200MS" ],
        "dcraw_matrix": [ 5656, -659, -346, -3923, 12306, 1791, -1602, 3509, 5442 ] // borrowed from Adobe's DNG converter
    },

    { // Quality A
        "make_model": [ "Hasselblad H4D-40", "Hasselblad H5D-40" ],
        "dcraw_matrix": [ 6159, -1402, -177, -5439, 12762, 3007, -955, 2200, 7104 ] // borrowed from Adobe's DNG converter
    },

    { // Quality A for tested H4D-60, the other models have the same sensor
        "make_model": [ "Hasselblad H4D-60", "Hasselblad H5D-60" ],
        "dcraw_matrix": [ 9662, -684, -279, -4903, 12293, 2950, -344, 1669, 6024 ] // borrowed from Adobe's DNG converter
    },

    { // Quality A
        "make_model": [ "Hasselblad H5D-50c", "Hasselblad CFV-50c" ],
        "dcraw_matrix": [ 4932, -835, 141, -4878, 11868, 3437, -1138, 1961, 7067 ]
    },

    { // Quality C
        "make_model": [ "Hasselblad H6D-100cMS" ],
        "raw_crop": [ 64, 108, 11608, 8708 ]
    },

    { // Quality C
        "make_model": "Hasselblad L1D-20c", // DJI Mavic 2 Pro
        "dcraw_matrix": [ 6267, -2021, -687, -4664, 13343, 1399, -234, 1019, 5524 ] // DNG 13.2
    },

    {
        "make_model": [ "HUAWEI DLI-L22" ],
        "dcraw_matrix": [ 6984, -812, -975, -4792, 13481, 1381, -1056, 2355, 4873 ] // ColorMatrix1 (D65, wrong order) from Adobe DNG Converter 11.2.1
    },

    {
        "make_model": [ "samsung SM-N960F" ],
        "dcraw_matrix": [ 6632, -622, -1104, -5659, 14819, 773, -1846, 4465, 4967 ] // ColorMatrix1 from Adobe DNG Converter 11.1
    },

    // Dummy test entry to test the parser and show the format with all entries active
    {
        "make_model": "DummyMake DummyModel",
        "dcraw_matrix": [ 7530,-1942,-255,-4318,11390,3362,-926,1694,7649 ],
        "raw_crop": [ 10, 20, 4000, 3000 ],
        "masked_areas": [ 51, 2, 3804, 156, 51, 5794, 3804, 5792 ],
        "ranges": {
            "aperture_scaling": [
                { "aperture": 1.2, "scale_factor": 1.1 },
                { "aperture": 1.4, "scale_factor": 1.08 }
            ],
            "black": [
                { "iso": 100 , "levels": [ 10, 20, 10, 20 ] },
                { "iso": [100, 200] , "levels": [ 30, 40, 30 ] },
                { "iso": 3200, "levels": [ 50, 60, 50, 60 ] }
            ],
            "white": [
                { "iso": 100 , "levels": [ 10000, 11000, 10000, 11000 ] },
                { "iso": 3200, "levels": [ 11000, 11000, 10000, 11000 ] }
            ],
            "white_max": 16383
        }
    }
]}
