IRMAX: Shooting 1.43:1 IMAX Framing on an Android Phone
No phone camera sensor outputs a 1.43:1 image. Android's Camera2 HAL exposes a short list of fixed resolutions and aspect ratios, such as 4:3, 16:9 and 1:1, and none of them matches the full-frame 15/70 IMAX ratio. Every camera app on every phone runs into the same wall. I built IRMAX, a native Android camera app, to work around it: you compose in a live 1.43:1 frame, and the app crops the result to exactly that ratio right after capture.
Why I built it
I have a companion desktop script, convert_to_imax.sh, that masters footage into a full theatrical IMAX spec: 7680x5372, HEVC 10-bit, BT.2020, 200 Mbps, EAC3, in an MKV container. That script needs clean input that is already framed for 1.43:1. Cropping a 16:9 clip after the fact means guessing what you would have composed differently. I wanted to see the final framing while shooting, on the phone I carry, a Samsung Galaxy Z Fold7. IRMAX does not repeat the mastering step. It only captures correctly framed input for it.
What it does
The app does three things in order: discover, frame, crop.
- Discover. It queries the device at runtime for every back-facing lens and for every still size and video quality tier the selected lens supports. Nothing is hardcoded.
- Frame. A live guide overlay dims everything outside the region that will survive the crop, and a rule-of-thirds grid sits inside the guide box.
- Crop. After capture, the photo or video is cropped to an exact 1.43:1, a watermark is baked into the bottom-right corner at 10% of frame width and 30% opacity, and the result is published to the Gallery (
Pictures/IRMAXfor photos,Movies/IRMAXfor video).
Other pieces of the interface:
- A bubble level based on the rotation-vector sensor. It turns green and gives a haptic tick when the phone is level.
- A lens picker that labels cameras by focal length rank instead of assuming which one is which.
- A resolution picker filled from
CameraCharacteristicsandCamcorderProfile, covering 480p up to whatever the HAL reports, for example 4K UHD. - A capabilities screen that dumps every size and quality the back cameras report as plain text.
- Fold awareness, so folding or unfolding the phone does not tear down the camera session or recreate the Activity mid-shot.
How it works
One crop rule for everything
The core of the app is a single piece of math in ImaxCrop.kt. Given a source ratio R and the target 1.43:
- If R is greater than 1.43, such as 16:9 video at about 1.78, the source is wider than the target, so the crop trims left and right.
- If R is less than 1.43, such as a 4:3 photo at about 1.33, the source is narrower, so the crop trims top and bottom.
The same function drives the viewfinder overlay, the photo crop and the video crop. That is the reusable lesson: when a preview has to match an output exactly, compute both from one function. The guide and the final crop cannot drift apart because there is only one implementation.
Stack
- Kotlin and Jetpack Compose in a single Activity, with no navigation library. A handful of screens are swapped by local state.
- CameraX with Camera2 interop for lens selection, resolution pinning and capability probing.
- Media3 Transformer for the video crop and watermark. It runs on the GPU, so there is no ffmpeg or other native binary to ship.
- Minimum SDK 31, target and compile SDK 35. There is no DI framework and no multi-module Gradle setup, which suits a solo project.
Code layout
The files are split by responsibility. CameraEngine.kt binds the CameraX use cases. CameraCapabilities.kt probes lenses, resolutions and video qualities. FramingOverlay.kt and LevelIndicator.kt draw the viewfinder aids. PhotoCropper.kt and VideoCropper.kt do the crop and watermark. GalleryPublisher.kt writes finished files to MediaStore. CaptureActions.kt orchestrates taking a photo or starting a recording.
Captured files are kept in the app's private storage under IMAXCam/, both the untouched _RAW capture and the cropped _143crop deliverable. Only the cropped versions are also published to the Gallery. Keeping the raw file means a crop can always be redone.
What I learned
Measure capabilities, do not assume them. On my test unit, a Galaxy Z Fold7 (SM-F966B), the public Camera2 API exposes a 12.5MP main lens capped at 4K UHD video. There is no 8K and no 200MP mode. Samsung's own camera app reaches higher because it uses private vendor extensions that third-party apps cannot call. Because IRMAX queries the device at runtime and has a capabilities screen, it shows what is actually reachable on that phone instead of promising a number it cannot deliver.
Crop after capture is the only honest option. Since the sensor cannot produce 1.43:1, the best approach is to shoot at the highest resolution actually available and trim. Handling both the top/bottom and left/right cases with the same math removes a whole class of bugs.
Media3 Transformer is enough for simple video edits. A crop plus an overlay is a small job, and a GPU-accelerated pipeline avoids bundling ffmpeg.
Fold handling needs care. Letting the camera session survive fold and unfold transitions, instead of restarting the Activity, keeps the app usable mid-shot on a foldable.
Try it
The project has a live page at https://irmax.iramesh.com. To run the app itself you need Android Studio or an Android SDK with platform 35, and a device on Android 12 (API 31) or newer. Running ./gradlew installDebug builds it and installs it on a connected device through adb. On first launch it asks for camera and microphone permission, since audio is needed for video recording.
Conclusion
IRMAX exists because no phone sensor outputs 1.43:1, so the app discovers what the camera can do, shows an accurate frame while you shoot, and crops to the exact ratio afterwards. The most reusable ideas are a single shared crop function for preview and output, and probing device capabilities at runtime instead of trusting assumptions. If you have questions about the project, you can reach me at hello@iramesh.com.