Raw file via Darktable to G'mic for Gimp shows random noise pattern


(paul matthijsse) #1

@David_Tschumperle.
Hello David, I discovered a strange behavior in G’mic but perhaps this fault is produced elsewhere.

When I instruct Gimp 2.10.6 to open raw files with Darktable, Darktable produces 32-bit linear floating point files. When I open them with G’mic for Gimp they show sometimes - but not always - a random colored pattern. See attached screenshot.

noise

Strange enough these patterns show up when the Preview is set to … Off! Sometimes they are visible when Preview is set to On though. It’s a bit random.

When I downsize these files to 16-bit integer, the problem disappears.

I am unable to determine if Darktable is responsible for this or Gimp or G’mic. I don’t find a setting in Darktable to convert my raws to 16-bit integer.

G’mic 2.3.4 for Gimp 2.10.6 on Xubuntu 18.04/64bit.

Regards, Paul.


(G'MIC staff) #2

Could it be your float-valued image has values less than 0 or higher than 1.0 ?


(paul matthijsse) #3

I don’t know. How can I determine that?


(G'MIC staff) #4

If you can use gmic from the command line and read the corresponding .tif file maybe ?


(paul matthijsse) #5

Darktable converts my NEF file into a 32 bit linear floating point OpenEXR file. When I save this one as a XCF (Gimp’s internal format) and run gmic DSC_4637.xcf in a terminal, I see the following error message.

paul@graveyron:~/Bureaublad$ gmic DSC_4637.xcf
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Input file ‘DSC_4637.xcf’ at position 0convert-im6.q16: memory allocation failed DSC_4637.xcf' @ error/xcf.c/ReadXCFImage/1342. convert-im6.q16: no images definedpnm:-’ @ error/convert.c/ConvertImageCommand/3258.

[gmic]-0./ *** Error *** [instance(1,16,0x556f1d0ac728)] gmicList::load(): Failed to recognize format of file ‘DSC_4637.xcf’.


(paul matthijsse) #6

And when I save that file as a TIFF and say in a terminal

$ gmic DSC_4637.tif

it shows the image, including certain values. When I move the mouse around, I indeed see some values smaller than 0 and some greater than 1. Resides the problem here perhaps?

Regards, Paul.


(paul matthijsse) #7

And some more info in the terminal, mind the bold part:

paul@graveyron:~/Bureaublad$ gmic DSC_4637.NEF.tif
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Input all frames of TIFF file ‘DSC_4637.NEF.tif’ at position 0 (1 image 4946x3278x1x3).
[gmic]-1./ Display image [0] = ‘DSC_4637.NEF.tif’.
[0] = ‘DSC_4637.NEF.tif’:
size = (4946,3278,1,3) [185 Mio of floats].
data = (0.942341,0.939409,0.935256,0.929871,0.925475,0.923983,0.92402,0.927715,0.925562,0.927644,0.931747,0.930315,(…),0.426605,0.400979,0.389719,0.37498,0.35571,0.336379,0.317511,0.397255,0.445775,0.485481,0.489664,0.50395).
min = -2.85177, max = 1.2109, mean = 0.334295, std = 0.280126, coords_min = (21,1696,0,0), coords_max = (4112,2702,0,0).
[gmic]-1./ End G’MIC interpreter.


(G'MIC staff) #8

So yes, that’s probably it.
I think the preview window assumes a float-valued image has values in [0,1], and that would probably require a clamp when displaying the image in the preview widget.
I’ll contact Sébastien about this issue. Thanks !


(paul matthijsse) #9

Okay. One more thing about Preview on and off, with this photo it shows in both cases the same amount of noise…

noise2


(G'MIC staff) #10

Thanks ! Seb has worked also on this issue, it should be fixed for the next release !


(paul matthijsse) #11

Thanks for being that reactive!
Regards, Paul.


(G'MIC staff) #12

Today, we are releasing version 2.3.6 with this fix included, should be ready in an hour or so.