Bug 337691 - FILEIO : add new option to convert automatically JPEG file in 16 bits color depth
Summary: FILEIO : add new option to convert automatically JPEG file in 16 bits color d...
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-JPEG (show other bugs)
Version: 4.1.0
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-22 11:54 UTC by Christian
Modified: 2017-07-30 16:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian 2014-07-22 11:54:04 UTC
Many users decided to work in jpg workflow with high res cameras.
DigiKam supports 16Bit depth, but jpgs will always be opened in 8Bit Resolution.

Suggestion 1: Default Depth for JPG should be 16 Bit (Auto-Conversion)
              - an option to open jpgs with 8 Bits is added to the settings

Suggestion 2: Default Depth for JPG should be 8 Bit 
              - an option to open jpgs with 16 Bits is added to the settings

Note: Jpgs are already transformed to 8 Bit when saving without warning. Thats fine for me.

Reason: Most corrections need 16Bit depth for computation, one does not know what corrections are needed when opening an image. Best choice is alwas work in 16 Bit depth with jpgs (unless very old hardware is used).
Comment 1 Christoph Feck 2014-07-22 13:19:26 UTC
Can you provide a link to the specification of 16 bit JPEG?
Comment 2 Christian 2014-07-22 16:16:47 UTC
(In reply to Christoph Feck from comment #1)
> Can you provide a link to the specification of 16 bit JPEG?

Hi Chris,

The latest Jpeg specs are all restricted to 8 bit. The conversion to 16 bit color depth in digiKam should take place after opening an 8 bit jpg without any user action to minimize computation errors.
The conversion back to 8 bit is already implemented.

Christian
Comment 3 Christoph Feck 2014-07-22 18:06:19 UTC
Ah, I now understood this request. You want the JPEG loader to convert the data to 16 bit internally before doing any further operations, so that you do not have to do it manually after each load. Makes sense.
Comment 4 caulier.gilles 2014-07-22 18:50:34 UTC
Converting 8 bits image to 16 bits will introduce noise to fill histogram holes :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/libs/dimg/dimg.cpp#L2757

Gilles Caulier
Comment 5 Christian 2014-07-22 23:04:55 UTC
(In reply to Gilles Caulier from comment #4)
> Converting 8 bits image to 16 bits will introduce noise to fill histogram
> holes :
> 
> https://projects.kde.org/projects/extragear/graphics/digikam/repository/
> revisions/master/entry/libs/dimg/dimg.cpp#L2757
> 
> Gilles Caulier

I am not an expert in digital imaging. But as far as I can see the results, the artificial noise is a minor problem compared to artefacts caused by 8 bit rounding errors. 

The noise is added to the 8 bit version before the transformation takes place? Or in 16 bit mode? Noise in 8 bit mode would be a drawback for jpgs with less than 12 MP.

Well distributed entropy in 16 bit mode might be cleaned when the colors are transferred back to 8 bit mode. I can't tell. My results where fine in print and on a high resolution / wide gammut monitor using argb profile for 20 MP jpgs. 

But this is no proof in any way. 

I will continue using the 16 bit conversion before I apply gradiation and the like - artefacts/gradients are worse than noise for me.
Comment 6 caulier.gilles 2014-07-23 06:41:07 UTC
Look in code, noise is apply to 16 bits image during conversion from 8 to 16.

Gilles Caulier
Comment 7 Christian 2014-07-23 18:44:10 UTC
(In reply to Gilles Caulier from comment #6)
> Look in code, noise is apply to 16 bits image during conversion from 8 to 16.
> 
> Gilles Caulier

Thank you. Auto-Conversion to 16 bit would be a great feature for me.
Dont know if is wanted by others.
Comment 8 caulier.gilles 2015-05-11 13:34:33 UTC
Maik,

Technically, this one is very simple to implement, as all background code is already here.

A new option must be add to FileIO settings to convert automatically JPEG to 16 bits color depth. This must be available only for Editor and BQM. Other part of digiKam must still use 8 bits color depth for performance reason.

In JPEGLoader, loading file must apply DImg::convert8to16bits method in case of option is on.

Gilles