Photo HDR

Capturing Photos in High-Dynamic-Range (HDR)

Photo HDR fuses multiple Frames together to capture Photos in a higher dynamic range, allowing for much brighter highlights and deeper shadows. In most HDR pipelines, an underexposed Frame, a regular exposed Frame, and an overexposed Frame are captured at the same time, and merged together at ISP-level.

Capture HDR Photos

To capture HDR Photos, ensure your currently selected CameraDevice supports Photo HDR, and enable a { photoHDR: ... } constraint:

function App() {
  return (
    <Camera
      style={StyleSheet.absoluteFill}
      isActive={true}
      device="back"
      constraints={[
        { photoHDR: true }
      ]}
    />
  )
}
function App() {
  const camera = useCamera({
    isActive: true,
    device: 'back',
    constraints: [
      { photoHDR: true }
    ]
  })
}
const device = ...
const session = ...

const controllers = await session.configure([
  {
    input: device,
    outputs: [],
    constraints: [
      { photoHDR: true }
    ]
  }
], {})

HDR Camera Extensions

Some Android Phones have vendor-specific CameraExtensions. If the phone has a 'hdr' extension, you can enable it to capture HDR Photos. This does not require enabling Photo HDR via the { photoHDR: ... } constraint, but instead just requires the extension to be enabled:

function App() {
  const device = ...
  const extensions = useCameraExtensions(device)
  const hdrExtension = extensions.find((e) => e.type === 'hdr')

  return (
    <Camera
      {...props}
      cameraExtension={hdrExtension}
    />
  )
}

Tip

See "Camera Extensions" for more information.

On this page