GNOME Bugzilla – Bug 734657
Import as 32-bit floating-point linear by default
Last modified: 2017-01-22 21:07:35 UTC
GIMP uses 32-bit linear floating-point internally and working on an image with that precision is radically faster than in any other precision. The other day I measured that adding an alpha layer to an image in 16-bit precision took about 22 seconds (!!!), while doing the same to the image after first converting it to 32-bit linear fp took 1 second! Therefore this feature request: Please add a setting to Preferences which allows the user to specify that all images with a bit depth higher than 8-bit should open in 32-bit linear floating-point precision so we don't have to convert them manually - a tedious task if you repeat this many times per day.
(In reply to BugsBunny from comment #0) > Please add a setting to Preferences which allows the user to specify that > all images with a bit depth higher than 8-bit should open in 32-bit linear > floating-point precision so we don't have to convert them manually - a > tedious task if you repeat this many times per day. From curiosity, why the proposed exclusion for 8-bit images? I would like a way to tell GIMP to automatically promote imported images to 32-bit floating point. But I'd like that to apply to 8-bit images as well as images at other bit depths. Even with 8-bit camera jpegs, I always edit them at 32-bit floating point precision. But sometimes I forget to promote the precision upon import until I'm several steps into the editing process, and then I have to start over. It would be very helpful, and also save repetitive editing steps, to be able to set a switch in the user preferences that says "always promote to 32-bit floating point upon import".
I assumed that when editing 8-bit images users would want to remain in that precision to not do unnecessary conversion, to avoid screwing up and also to use less memory, though I don't know GIMP internals and I don't know how much of that is really the case - I suppose conversions will be done internally anyway, but I do know that less memory will be used overall. As for the possibility of screwing up if a user stays in 8-bit mode, that's up to GIMP. This could be easily solved with either one checkbox to automatically convert all opened images to 32-bit float linear on opening (no annoying popups!), or a checkbox with a combobox: the checkbox turns the feature on or off, the combobox lets you pick from which source precision should the conversion be done, e.g. from 16-bit integer upwards. I'm fine with either solution.
This is only vaguely related, but removes one source of error when converting to 8-bit or floating point: commit da49a3fadf3a5a6178e9dd982923eea0be3ea5bb Author: Michael Natterer <mitch@gimp.org> Date: Thu Nov 10 13:50:56 2016 +0100 app: always default to linear for float precision and gamma for 8-bit In the "New Image" and "Convert Precision" dialogs. The "Gamma/Linear" switches get adjusted automatically to the new defaults, but can be changed manually. app/dialogs/convert-precision-dialog.c | 24 +++++++++++++- app/widgets/gimptemplateeditor.c | 87 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 89 insertions(+), 22 deletions(-)
The concern of performance of other storage precisions have been mostly removed by implementing relevant fast paths for babl. Previously only 8bpc and single precision float had had any effort towards optimizing. pippin/linear-is-the-new-black contains code that auto-promotes to 32bit floating point, which - when turned into a preferences configuration - probably will land in master.
*** Bug 760277 has been marked as a duplicate of this bug. ***
Fixed in master, not special casing u8 images except for the dithering. commit 27519fc7987bfbc9dacc8a83a6d76af0dc997e46 Author: Michael Natterer <mitch@gimp.org> Date: Sun Jan 22 22:03:55 2017 +0100 Bug 734657 - Import as 32-bit floating-point linear by default Optionally convert all imported (not XCFs) images to 32 bit linear floating point, and optionally add a little noise in order to distribute the colors minimally. The new options are on a new "Image Import & Export" prefs page that needs a new icon. Original dithering patch by pippin. app/config/gimpcoreconfig.c | 30 +++++++++++++++++++++++++- app/config/gimpcoreconfig.h | 2 ++ app/config/gimprc-blurbs.h | 8 +++++++ app/core/gimpimage-convert-precision.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ app/core/gimpimage-convert-precision.h | 3 +++ app/dialogs/preferences-dialog.c | 24 +++++++++++++++++++++ app/file/file-open.c | 23 ++++++++++++++++++++ 7 files changed, 147 insertions(+), 1 deletion(-)