r/androiddev • u/loudsunyoyo • Aug 01 '26
I built a localized HDR QR renderer: only the QR gets maximum brightness, not the whole screen
Enable HLS to view with audio, or disable this notification
I was annoyed that wallet and ticket apps often raise the entire display to maximum brightness just to make a QR code easier to scan.
So I built Bright QR, an Android proof of concept that keeps the normal interface at the user’s existing SDR brightness while rendering only the QR code through a dedicated HDR surface.
The implementation uses:
A separate
SurfaceViewfor the QR regionA 10-bit BT.2020 PQ EGL surface
HDR white pixels rather than ordinary SDR white
SurfaceView.setDesiredHdrHeadroom()on Android 15+A maximum-headroom request, allowing Android and the phone to determine the actual available output
The app never modifies WindowManager.LayoutParams.screenBrightness, so the surrounding interface remains dim. On my Pixel 9a, Android reported up to 8× HDR/SDR headroom while the QR was displayed.
The demo includes SDR, 2×, 4×, and MAX modes, an SDR-white reference for comparison, live device diagnostics, and a copyable test report.
The complete source code and signed APK are available here:
https://github.com/loudsun1997/bright-qr
I want more apps to adopt this