Processing RAW/DNG images from mobile phones

As an amateur hobbyist, I have a reasonable quality budget camera with interchangeable lenses and now exclusively shoot RAW which I process using Darktable. I’m still learning but I am pleased with the output.

But of course, these days there more pics taken using mobile phones. The quality of the output can be very good. But I’m not sure how to develop RAW photos from my mobile because programs like Darktable have only limited model support. Its website suggests that one can submit sample RAW images and possible the community will produce a facility for unlisted cameras. But I’m not sure of the process and whether there is enthusiasm for mobile phone cameras in the open source community.

Background: before it recently failed, I discovered I could also RAW using pro mode on a Samsung S6 mobile phone. I replaced the S6 with an Android based “realme 3 Pro” which, for a budget mobile has excellent cameras. Out of the box, it did not shoot RAW using the manufacture’s camera app. But I then discovered the joy of the open source “Open Camera” app for Android. It of course does support RAW on the realme 3 Pro.

The RAW output from Open Camera has file extension DNG. But loading these into Darktable, I do not see how I can process them as I do with my main camera (which is fully supported by Darktable).

Am I missing something? Can I submit sample RAW images somewhere? And if so is it likely that some support may be developed for such mobile cameras?

2 Likes

Hey hey and welome to the forum!

No, you are not missing anything, some cameras are not yet supported in the main programs we have here (Darktable and RawTherapee); and yes, there is an opportunity to help further camera support by submitting raw files that help us make the model supported. Unfortunately I am not currently up to date with exactly what data is required but we do have posts about it on the forum. :slight_smile:

this article may be relevant

1 Like

If it’s actually a DNG, it should work without any need for the developers to add support for it. Part of the idea behind DNG is standardization of the metadata - so what is hardcoded for many raw formats in the raw development software should be simply obtained from the DNG metadata for a properly created DNG.

For example, neither Darktable nor RawTherapee have any explicit support for the Xiaomi Mi Sphere 360 camera, but both have no trouble opening the DNGs. (As to getting the colors right, that’s a whole other story, and it’s Xiaomi’s fault - see “Better Color Representation” in https://sites.google.com/view/h360/misphere-converter - I need to retag the ColorMatrix1 metadata on every shot I take…)

My guess is that in this case because you’re using an el cheapo device, it is outputting incorrect/broken DNGs. I’ve played with Open Camera a little bit, but if I recall correctly, the Android Camera2 API should provide an app with a DNG that includes all relevant metadata.

I should probably play with Open Camera on my Z2 Play again - the Z2 Play is one of those devices where all of the software for Camera2 API support is present but it is disabled via a build.prop directive. So it’s a good candidate for somehting that may produce “broken” DNGs.

If you run exiftool against the DNGs, do you see required metadata like a ColorMatrix1 tag?

It’s @HimAgain! Get him! Sorry, couldn’t resist. :stuck_out_tongue: Welcome to the forum!

DNGs may be standardized but not all DNGs are made the same or have readable metadata. Same with raw files.

As @stefan.chirila said, it would be helpful to submit your images to RPU; however, they require a full set, meaning every version of the file your device could possibly produce. Detailed instructions are on the site.

But first, probably the easiest thing to do is drag-and-drop the file(s) into the forum editor, so that some of us can take a look. Perhaps, the files are already easily accessible!

1 Like

Thanks all. Really useful posts so far. I will take a detailed look at these tomorrow.

I should have made clear, Darktable is opening my Open Camera DNG files no problem. But it is the colours etc and I assumed that was lack of a specific profile for my hardware. Darktable also opened the Samsung S6 raw outputs too from its built in camera app. The raw output also opened on geeqie.

The output from Open Camera on realme opens on Darktable but not on geeqie. But Digikam opens them too. So something different to the Samsung format.

Thank you all so much.

1 Like

I recently found that jpegs from some Galaxy phones mangle the metadata badly. It was crashing our publishing pipine at work. The horror!

The metadata for ColorMatrix1 tag is present.

I took some sample RAW pictures yesterday and below is a copy of all the tags from one of the DNG photos. I should explain realme is a new mobile/cell phone brand recently launched in Europe by OPPO. The mobile model is realme 3 Pro but it may also be known as RMX1851 which comes up in the EXIF data. It has 1 front and two rear facing cameras and one of the rear is described as a Sony in the marketing. The samples I took are of course only rear.

======== IMG_OCT_20191005_150058.dng
ExifTool Version Number : 10.80
File Name : IMG_OCT_20191005_150058.dng
Directory : .
File Size : 31 MB
File Modification Date/Time : 2019:10:05 15:00:58+01:00
File Access Date/Time : 2019:10:05 18:03:40+01:00
File Inode Change Date/Time : 2019:10:05 18:01:15+01:00
File Permissions : rwxr-----
File Type : DNG
File Type Extension : dng
MIME Type : image/x-adobe-dng
Exif Byte Order : Little-endian (Intel, II)
Subfile Type : Full-resolution Image
Image Width : 4656
Image Height : 3496
Bits Per Sample : 16
Compression : Uncompressed
Photometric Interpretation : Color Filter Array
Image Description :
Make : Realme
Camera Model Name : RMX1851
Strip Offsets : (Binary data 30280 bytes, use -b option to extract)
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 1
Strip Byte Counts : (Binary data 17479 bytes, use -b option to extract)
X Resolution : 72
Y Resolution : 72
Planar Configuration : Chunky
Resolution Unit : inches
Software : Realme/RMX1851EEA/RMX1851L1:9/PKQ1.190101.001/1566479375:user/release-keys
Modify Date : 2019:10:05 15:00:58
CFA Repeat Pattern Dim : 2 2
CFA Pattern 2 : 2 1 1 0
Copyright :
Exposure Time : 1/649
F Number : 1.8
GPS Version ID : 2.3.0.0
GPS Latitude Ref : North
GPS Longitude Ref : West
GPS Time Stamp : 14:00:56
GPS Date Stamp : 2019:10:05
ISO : 100
Date/Time Original : 2019:10:05 15:00:58
Focal Length : 4.3 mm
TIFF-EP Standard ID : 1 0 0 0
DNG Version : 1.4.0.0
DNG Backward Version : 1.1.0.0
Unique Camera Model : RMX1851-Realme-Realme
CFA Plane Color : Red,Green,Blue
CFA Layout : Rectangular
Black Level Repeat Dim : 2 2
Black Level : 63 64 64 63
White Level : 1023
Default Scale : 1 1
Default Crop Origin : 8 8
Default Crop Size : 4640 3480
Color Matrix 1 : 0.3515625 -0.09375 -0.0625 -0.328125 1.3125 0 -0.140625 0.4765625 0.5546875
Color Matrix 2 : 0.890625 -0.2265625 -0.1640625 -0.328125 1.3125 0 -0.1015625 0.328125 0.3828125
Camera Calibration 1 : 1 0 0 0 1 0 0 0 1
Camera Calibration 2 : 1 0 0 0 1 0 0 0 1
As Shot Neutral : 0.4912109375 1 0.5546875
Baseline Exposure : 0
Calibration Illuminant 1 : D55
Calibration Illuminant 2 : Standard Light A
Active Area : 0 0 3496 4656
Forward Matrix 1 : 0.5625 0.140625 0.265625 0.1484375 0.7890625 0.0625 0.015625 -0.4765625 1.28125
Forward Matrix 2 : 0.5625 0.140625 0.265625 0.1484375 0.7890625 0.0625 0.015625 -0.4765625 1.28125
Opcode List 2 : (Binary data 3908 bytes, use -b option to extract)
Opcode List 3 : (Binary data 4 bytes, use -b option to extract)
Noise Profile : 0.000113406166 9.5309258140625e-07 0.000113406166 9.5309258140625e-07 0.000113406166 9.5309258140625e-07
Aperture : 1.8
CFA Pattern : [Blue,Green][Green,Red]
GPS Date/Time : 2019:10:05 14:00:56Z
GPS Latitude : 53 deg 14’ 37.89" N
GPS Longitude : 2 deg 13’ 42.38" W
GPS Position : 53 deg 14’ 37.89" N, 2 deg 13’ 42.38" W
Image Size : 4656x3496
Megapixels : 16.3
Shutter Speed : 1/649
Focal Length : 4.3 mm
Light Value : 11.0

Herewith a sample DNG. The EXIF data are above.

IMG_OCT_20191005_150058.dng (31.1 MB)

My phone’s pictures with Raw Therapee have this problem (my is Honor 6a, i have uploaded the raw to raw.pixls.us a lot of time ago): https://github.com/Beep6581/RawTherapee/issues/5414

Your phone’s the same.

Second problem i have made a vignetting profile for lensfun a lot of time ago, but it isn’t yet commited ( https://github.com/lensfun/lensfun/pull/876 ) . And vignetting is heavy on my phone.

Third problem, even if i change the relevant xml local file, Raw Therapee has troubles with so big vignetting correction, that leads to clipped highlights. https://github.com/Beep6581/RawTherapee/issues/4169

Seems like vignetting could be fixed with dng opcodes but atm no oss software seems to support them.

4th colors are not that great but i don’t have an it8.

Anyway i have made some good pictures with my phone. And i have tried with your picture and the camera seems even better! Shot in raw soon or later i think they will be even better supported.

Opens just fine here in RT. I know darktable has opened DNGs from cameras without explicit support before (Xiaomi Mi Sphere), although I haven’t used it in quite a while. I’m guessing there’s something about that particular DNG it doesn’t like but I don’t know what.

1 Like

You should add your lensfun profile to your lensfun installation and then you can use it. It doesn’t have to be accepted by lensfun (but that would be nice).

1 Like

Based on what I could glean from Anders’ dcamprof missive, I think this is the matrix that should be amended to camconst.json… @Morgan_Hardwood?

1 Like

As previously indicated, I can open this file in Darktable but cannot get it to look very nice. The JPG you developed in RawTherapee looks good. I have RT too and I was aware that it can open my DNGs.

I have started to get vaguely comfortable with Darktable with my main camera. I tried RT a while ago and it looked good. But learning Darktable was already stretching my grey cells to the limit so decided not to try to learn RT too.

I’ve just loaded the image in RT and it does look better and have been able to get somewhere near the vibrancy you achieved in the JPG above.

But for some reason on my PC, the picture is very grainy in RT when I zoom in. It remains high definition in both Darktable and qeeqie. I’m not sure if that is my RT installation on Ubuntu, or maybe its normal and the resulting JPG from RT would not be so grainy.

I will look to upload this RAW sample image as suggested by @stefan.chirila

Thanks again.

It would be great if you provided some screenshots of RT and dt (with version info) to show us what you mean. darktable (the d is lowercase :wink:) has good out of the box profiled denoising but it could be another issue…

Thanks @afre this is the screenshot of a zoomed in section via RTScreenshot%20from%202019-10-06%2019-47-02

It seems clearer in darktable

Screenshot%20from%202019-10-06%2019-47-46

The zoom level seems to be different. Could you also provide the pp3 and xmp?

Correction geeqie does not display the realme’s dngs only the S6’s. I got confused just now because I had restored the camera’s own jpg and geeqie had paired them. Apologies.

@afre the zoom I used is approximately the same but the graininess is massively better with darktable.

These are un-cropped. I created my screen shots by simply zooming in.

IMG_OCT_20191005_150058.dng.pp3 (10.1 KB) IMG_OCT_20191005_150058.dng.xmp (3.8 KB)