GNOME Bugzilla – Bug 789967
HSV layer modes don't handle negative values properly
Last modified: 2018-05-24 18:34:55 UTC
I tried to edit a photo in gimp, but after some steps gimp crashes or the filter does not work: 1) Opening File in Gimp (opens in darktable, close darktable direktly) 2) convert 3) duplicate, invert, mode: "wert(HSV)" 4) create new layer from visible 5) magic lasso to new layer and desaturate 6) gmic "Localvariance normalization" 7) Color -> Values (Gimp crashes) Here you can find the xcf file: https://www.dropbox.com/s/iguvkbskkqg2ibl/_MG_8547.xcf?dl=0 In this xcf file the steps 1-6 were already done. Best regards, Martin
Sheesh, that's a nice one :) There's a snowball effect here... The original image has some pixels with negative components. The trouble starts on step 3, when you combine the second and third layers using Value mode. The HSV modes are not really prepared to handle negative RGB components, and in this case this leads to infinite results (layer 4). On step 5, the output of Desaturate is combined with the input (which has infinities) using Replace mode. Our compositing code, in turn, is not really prepared to deal with infinities, leading to NaN results (especially, since 0 * inf := NaN). Finally, on step 7, when you run Levels (not Values; I assume it's Werte), the NaN values cause the histogram (in the Levels UI) to segfault. The last bit is probably the same issue as bugs 786846 and 788394, which is straightforward. The other bits are trickier. In particular, how to handle negative RGB components in the HSV modes (and possibly other HSV code). While the simplest solution is to clip them, it's worth considering if there's a more intelligent (and meaningful) way to extend them to arbitrary values.
So that means darktable exports an image with negative pixels?
The crash is fixed in master, by commit b2b6552f1fe60ad2f276c537ca4cede3d2a1c362. The other issues still stand. (In reply to Martin from comment #2) > So that means darktable exports an image with negative pixels? Yes, but, in this case, this only means that those pixels are outside the sRGB gamut.
Let's put this on the 2.10 milestone, but not as a release blocker.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/1221.