Skip to content

Conversation

kmilos
Copy link
Collaborator

@kmilos kmilos commented Aug 26, 2025

No description provided.

@kmilos kmilos requested a review from LebedevRI as a code owner August 26, 2025 13:58
@LebedevRI LebedevRI merged commit c7e39a6 into develop Aug 26, 2025
64 of 65 checks passed
@kmilos kmilos deleted the kmilos/hb_x2dm2100c branch August 26, 2025 14:46
@RoztomilyKolousek
Copy link

Hi,
Would this be of any use here? I have no idea how to convert the colormatrix values to those in cameras.xml..

exiv2 -pe ./B0000594.3FR | grep -e UniqueCameraModel -e ColorMatrix -e Black -e White
Warning: Removing 1 characters from the beginning of the XMP packet
Exif.SubImage1.BlackLevel                    Rational    1  4096/1
Exif.SubImage1.WhiteLevel                    Short       1  64763
Exif.Image.UniqueCameraModel                 Ascii      23  Hasselblad X2D II 100C
Exif.Image.ColorMatrix1                      SRational   9  19913/33464 -14029/95647 -1356/39731 -37392/72475 5536/4383 28167/99667 -9919/95535 9151/54614 54310/88279

@RoztomilyKolousek
Copy link

and perhaps these:

Exif.SubImage1.ImageWidth                    Short       1  11904                                                                                                                                     
Exif.SubImage1.ImageLength                   Short       1  8842
Exif.SubImage1.DefaultCropOrigin             Short       2  128 96                                                                                                                                    
Exif.SubImage1.DefaultCropSize               Short       2  11656 8742
Exif.Image.AsShotNeutral                     Rational    3  65536/166400 65536/65536 65536/115248

@LebedevRI
Copy link
Member

LebedevRI commented Aug 28, 2025

Would this be of any use here? I have no idea how to convert the colormatrix values to those in cameras.xml..

You transform the rational values into decimals (just do the division) and then multiply by 10000 (10^4),
that converts it into mostly an integer, minimizing the fractional part which must be dropped.
https://www.wolframalpha.com/input?i=10000*%2819913%2F33464%2C+-14029%2F95647%2C+-1356%2F39731%2C+-37392%2F72475%2C+5536%2F4383%2C+28167%2F99667%2C+-9919%2F95535%2C+9151%2F54614%2C+54310%2F88279%29
This transform is lossy, yes.
I think normal rounding should be done there (0.5 -> 1., 0.4(9) -> 0., -0.5 -> -1., -0.4(9) -> -0.)

@kmilos
Copy link
Collaborator Author

kmilos commented Aug 28, 2025

The sensor is the same as in the gen 1, so this will be a straight copy once some samples are received at RPU.

@LebedevRI
Copy link
Member

@RoztomilyKolousek if you are interested in that camera being supported, consider contributing a full sample set (IIRC there should be 2 or 4 raw modes on these cameras) to https://raw.pixls.us/, of something daylight landscapey.

@RoztomilyKolousek
Copy link

RoztomilyKolousek commented Aug 28, 2025

Unfortunately the pic i have is not mine and comes from a pre-prod piece, so the full-featured contribution is not possible at the moment.

I've added some info to the placeholder and DT is able to open the raw without complaining :)

  <Camera make="Hasselblad" model="X2D II 100C">
    <ID make="Hasselblad" model="X2D II 100C">Hasselblad 100-20-Coated6</ID>
    <CFA width="2" height="2"> 
      <Color x="0" y="0">RED</Color>
      <Color x="1" y="0">GREEN</Color>
      <Color x="0" y="1">GREEN</Color>
      <Color x="1" y="1">BLUE</Color>
    </CFA>
    <Crop x="128" y="96" width="-120" height="-4"/>
    <Sensor black="4096" white="64763"/>
    <Aliases>
      <Alias id="X2D II 100C">Hasselblad X2D II 100C</Alias>
    </Aliases>
    <ColorMatrices>
      <ColorMatrix planes="3">
        <ColorMatrixRow plane="0">5951 -1467 -341</ColorMatrixRow>
        <ColorMatrixRow plane="1">-5159 12631 2826</ColorMatrixRow>
        <ColorMatrixRow plane="2">-1038 1676 6152</ColorMatrixRow>
      </ColorMatrix>
    </ColorMatrices>
  </Camera>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants