Rear camera resolution blocked at 3 MP instead of 13 MP

Hello

I took some pictures with my Librem 5 Saturday but the resolution was surprisingly low, about 3 megapixels instead of 13 (“Back Camera 13 Mpx with flash LED” according to the hardware specifications). I contacted the support but nobody replied. Am I missing something obvious? Is it an hardware limitation? Is there a setting somewhere in Cheese (the default camera software on the Librem 5)? Should I rather install Megapixels?

Best regards.

2 Likes

Welcome @gouessej !

Cheese is not the default camera software on the L5. Millipixels is, although it appears as “Camera (Dev Preview)” in the app grid. It should be already installed… unless you bought your device second-hand, the previous owner tried alternate camera software, and you haven’t reflashed the operating system to the default…?

1 Like

Provide us your operating system codename.

lsb_release -c

If it is Amber, upgrade it to Byzantium.

Millipixels (which is the name of the default camera app for the Librem 5) creates 3 megapixels only .jpgs intentionally, as the conversion to jpg a lot faster this way (and allows you to take the next picture quicker). If you want images in full resolution, you can use the *.dng files in the Pictures folder on your PC with a program like DarkTable or RawTherapee to develop these into jpg that then have full resolution.

3 Likes

I confirm that it appears as “Camera (Dev Preview". Ok thank you, sorry for my mistake, it seems that the librem 5 uses a fork of Megapixels. I haven’t reflashed my librem 5 yet.

1 Like

If you want reflashing instructions for Byzantium, let me know.

I understand the reason of this choice but I want to take pictures of 13 megapixels even though it takes longer. If I wanted to take pictures of 3 or 5 megapixels, I would go on using my Pinephone. Thank you for the workaround. I’ll probably write a request for enhancement to add an optional setting somewhere in order to please everyone, i.e please people happy with the default behaviour and allow me to take high quality pictures directly.

I currently use Byzantium.

1 Like

Do you know which configuration file I have to edit to use the maximum resolution?

By the way, lsb_release -c displays:
Codename: byzantium

1 Like

The configuration file seems to be in /usr/share/millipixels/config/ but the ini files mention capture-width and capture-height with correct values, respectively 4208 and 3120. Where can I find the modified capture height and width?

1 Like

My best guess is that you can find the change in one of the commits that are linked in this issue (because they mention the issue): Speed up photo saving (#64) · Issues · Librem5 / millipixels · GitLab

Addendum: Also, having used Millipixels before the change to faster processing, I would not want to go back, especially given the fact taking a good look at the raw files and taking the time to develop them into jpg’s carefully can only improve the resulting images.

(I wish I could recommend a mobile friendly app to do this (it surely would be slow), but I am not aware of any despite maintaining https://linuxphoneapps.org/ , although I tend to forget things :wink: )

2 Likes

Thank you so much, the culprit seems to be in the shell script :slight_smile:

I’m accustomed with the noticeable delays, it’s what happens on my Pinephone and I can keep an unchanged version of the script somewhere just in case I need to switch back temporarily. Sometimes, I take hundreds of photos a day, developing them one by one would take ages. I have a particular use case.

2 Likes

I think the answer is to edit /usr/share/millipixels/postprocess.sh and remove -s on the line that invokes the postprocess program.

Disclaimers apply:

  • before editing a file like this take a copy of the original
  • change not tested
  • your change will probably get wiped out by a future software update so plan and prepare accordingly
  • your change may get invalidated by a future software update if something more flexible is offered in the future
1 Like

Yes it’s what I plan to do, “-s” causes the boolean variable “half_size” to be set to true, I have to look at the C/Vala source code to check whether it really reduces the resolution and not only something else that would reduce the weight of the saved file.

1 Like

Yes, it just cuts the width and height in half by considering each RGGB Bayer sector as a single colored pixel, so no color interpolation needs to be done which speeds things up significantly.

Since full-res DNGs are always stored, you can simply run postprocess again by yourself in a loop with -s omitted and have all your past photos developed again in higher resolution.

6 Likes

@dos Before testing your solution, I’ll have to write a bug report because the pictures are all wrong, the last lines in the bottom come from the top, I’ll upload most of these faulty pictures in some days to help you to see what I mean, it only happens with Millipixels under Pure OS Byzantium on the Librem 5, this bug isn’t reproducible with Megapixels under Mobian Linux Trixie on the Pinephone. I’ve already checked that this problem wasn’t introduced later when editing each picture, while rotating or when editing the metadata with exiftool, the unchanged pictures are wrong, I haven’t kept the DNG files.

1 Like

@dos This picture illustrates the bug I mentioned:
https://gouessej.wordpress.com/wp-content/uploads/2024/04/img20240330101105.jpg

Many other pictures have the same problem:
https://gouessej.wordpress.com/2024/04/10/mon-week-end-dans-les-gorges-du-verdon-my-weekend-in-the-verdon-gorge/

3 Likes

This picture is rotated. Can you post a JPEG produced directly by Millipixels that exhibits this issue? (ideally together with an accompanying DNG)

I know that eog (Eye of GNOME) has a bug that leads to such artifacts after rotating, but these shouldn’t be present in the original files.

1 Like

You got some nice pictures of nature trail and you found a bug :beetle: :space_invader: :cockroach: :spider: :ant:

2 Likes

@dos I’ll take a new picture with my librem 5 then but I use Gwenview under Debian Linux (Plasma/KDE as desktop environment) instead of Eye of GNOME. I’ll have to take another picture in order to obtain a DNG file.

1 Like

Exactly how would this be done, which program needs to be run, which options used, to create a higher resolution photo from one of the DNG files?

2 Likes