How to use the latest version of the PhotoFlow GIMP plug-in

This topic is intended to be a draft for a blog post or article about the usage of the PhotoFlow GIMP plug-in. The text is still work-in-progress and not yet complete, however I would appreciate any early feedback on what is already written, so that I can tweak the rest of the text according to the comments and suggestions already received…

The PhotoFlow GIMP plug-in


PhotoFlow currently provides two types of plug-ins:

  • an image loading plug-in that is used by to open and process RAW images
  • a filter plug-in that can be used to process a selected layer and output the modified image into a new layer, pretty much like the well known G’MIC plug-in

The loading plug-in is very easy to use: launch GIMP, go to File → Open, select a RAW file from disk and hit the Open button.
Instead of opening the file directly, GIMP will call the PhotoFlow plug-in and pass the file name to it. The PhotoFlow interface will open up with two pre-loaded layers, one for loading the RAW image and the second one which applies the RAW processing:

As shown in the screenshots below, double-clicking on the RAW processor layer gives access to the RAW processing controls: white balance, exposure and highlights reconstruction, chromatic aberrations correction, demosaicing method, color conversion:

White Balance settings

Exposure settings

Image correction settings

Demosaicing settings

Color conversion settings

Editing with PhotoFlow is not limited to the RAW processing. Several additional editing tools can be accessed by clicking on the red button at the top-left of the layer list. The pop-up dialog lets you choose among a quite large list of available tools. As shown belown, once chosen, the tools will be inserted into your edit as adjustment layers:

Once you are satisfied with your edit, the processed image can be sent back to GIMP by hitting the OK button below the preview area:

GIMP will most likely pop a dialog to inform you that the ICC profile of the PhotoFlow image differs from the built-in sRGB, and will ask you wether you prefer to keep the profile or convert the image to sRGB:

Running the PhotoFlow plug-in on an existing layer


At this point, you have a new GIMP image with a background layer containing the result of the RAW processing. However, you can still use the PhotoFlow plug-in to refine the RAW edit or further work on the initial processed RAW.

As already anticipated at the beginning, PhotoFlow provides a second version of the plug-in that works as an editing filter, and is accessible through the Filters → PhotoFlow… menu item:

Let’s see what happens if you run the PhotoFlow filter over the layer created by the RAW processing step. Once you have selected Filters → PhotoFlow… a pop-up dialog will inform you that the plug-in has recognised the selected layer as one created by the plug-in itself, and gives you two choices:

What does this mean? When the plug-in sends the pixel data back to GIMP, it also saves the editing configuration as a meta-data blob in the GIMP image structure, so that it can be retrieved when the same layer is edited again with the plug-in.

If the configuration meta-data is found in the selected layer, the PhotoFlow filter gives you the choice between starting a new edit (corresponding to the Create new option, in which case the input pixels will be taken from the selected layer and the output will be sent to a new layer above the selected one) or continue editing the current layer (corresponding to the Edit current option, in which case the input pixels will be taken from the layer below the selected one and the output will replace the contents of the selected layer).

Let’s choose for the moment the first option, Edit current. The plug-in will in this case read the name of the input RAW file as well as the value of all the RAW processing parameters from the meta-data stored in the GIMP image, and will restore the RAW processing in the state as it was when the image was sent to GIMP. Every aspect of the RAW processing can at this point be modified and tweaked, or new adjustment layers added to further edit the RAW image. For example, here I’m adding an optical corrections filter to compensate the barrel distortion of the wide angle lens used in the shot:

Hitting the Ok button will send the updated image back to GIMP, replacing the contents of the selected layer, and the new editing configuration will be saved into the GIMP image meta-data. At this point, running the plug-in once more will open the RAW image with the additional lens corrections applied…

Running the PhotoFlow plug-in to create a new GIMP layer


In the previous part we have seen how re-running the PhotoFlow plug-in on the background GIMP layer allows to re-adjust the RAW processing parameters and eventually add more adjustment layers. This is achieved by going to Filters → PhotoFlow… and then choosing the Edit current option in the small pop-up dialog that asks “Do you want to continue editing this layer or create a new one?”.

What if one chooses Create new instead?
In this case, the PhotoFlow plug-in will read the contents of the selected GIMP layer, put them into the background layer of a new editing session, and let you add more non-destructive adjustment layers to further refine your edit:

As an example, here I have added an RGB curve with an associated luminosity mask to selectively lighten the shadows without clipping the highlights:

Hitting the Ok button will send the processed image back to GIMP, creating a new layer above the one on which the plug-in has been run:

Once more, PhotoFlow will send to GIMP not only the processed image data, but will also store the editing configuration as meta-data attached to the newly created layer. Running the plug-in again from the Filters → PhotoFlow… menu item will detect the presence of this configuration meta-data, and will again pop-up a dialog asking if the user wants to continue editing the current layer or create a new one.

In other words, the GIMP layers created through the PhotoFlow plug-in can be indefinitely edited in a non-destructive way, because the editing configuration is always stored and updated inside the GIMP image structure.

2 Likes

Is this the case at the moment with git-master? I didn’t know if mitch had fixed the darktable loading raw stuff yet to allow other raw handlers.

This is awesome, by the way… :slight_smile:

I don’t know… actually, the instructions on how to properly install and run the plug-in are one of the missing parts of the article.
I’m in close contact with Partha who is preparing updated Windows and OSX packages with the latest PhF plug-in included and working out-of-the-box.
For the linux case, I plan to ask Thorsten to possibly update his gimp-edge PPA, but only when the RAW loading code is fixed at the GIMP level.
For the moment, I’m afraid that having Darktable installed totally blocks the PhF plug-in… :frowning:

Yes, this is definitely the main step forward in this version, and also compared to other existing plug-ins.
One can effectively use the GIMP layers as placeholders for the various processing steps, keeping full non-destructive control on the way. Or you can mix edits with PhF, G’MIC and GIMP itself. For example, you can use the PhF filter plug-in to apply PhotoFlow’s shadows/highlights filter (directly derived from the awesome original Darktable module) to any existing GIMP layer…

1 Like

Bumping the topic because I’ve added the last part of the draft article.

1 Like

Want me to have a proofread and get ready to publish this week?

1 Like

Hi @patdavid! A proofread would be greatly appreciated!

For publishing I would rather prefer to wait until Partha’s packages have been updated, because there is currently no way to test the plug-in from pre-compiled packages.
There might also be Ubuntu packages coming soon, but I’m afraid there will still be a conflict with the Darktable plug-in…

Maybe we could already draft the article but not make it public yet? In fact I was considering a three-part article (1. how to install the plug-in and open a RAW image, 2. how to refine the RAW processing of an already opened image, 3. how to further edit the image with the PhotoFlow GIMP plug-in filter).
This is in order to make each part of the article shorter and easier to read.

What do you think?

1 Like

I’m here to help! :slight_smile: The three part article sounds like a good idea. I’ll give this a read later and wait for you to let me know what I can do next.

Now I try to build Ubuntu packages in my gimp-edge PPA.
Wish me luck! :slight_smile:

1 Like

Good luck!!! :wink:
I’m here to help with any building issue…

make[1]: Leaving directory ‘/«PKGBUILDDIR»/obj-x86_64-linux-gnu’
dh_install -O–parallel -O–buildsystem=cmake
dh_install: photoflow missing files: usr/lib
dh_install: missing files, aborting
debian/rules:34: recipe for target ‘binary’ failed

I’m working on it.

Update: It seems to work. This patch did the trick: http://pastebin.com/TwvZQPGE
Imho you should integrate it in your code.

PS: There is a built-in Gimp-2.9 plugin called file-darktable which tries to start darktable for raw image file handling. PhotoFlow will ignored. :frowning:

Did you check that PhF is ignored even if Darktable is not installed on the system.

Anyhow, this is a real problem… I guess not only PhF is ignored, but also the good old UFraw :frowning:
The issue has been already addressed on the gimp-developer mailing list, but there seems to be no big motivation for having other RAW loading plug-ins, or actually just the freedom to choose which one to use.

Maybe we can help me to revive the discussion?

Concerning your patch, I’ll definitely include it, thanks!

In your patch you do not install pfgimp-load (the RAW file loading plug-in), but only pfgimp:

INSTALL(TARGETS pfgimp RUNTIME DESTINATION lib/gimp/2.0/plug-ins)

Is this intentional or a mistake?

Thanks!

It’s intentional. The reason is that your plugin find it’s place.

You mean that we should wait until GIMP can effectively use it?

The right place for system wide plugins is normally here: /usr/lib/gimp/2.0/plug-ins/
But the problem is there are no registered file types e.g. RAW.
File types should be registered by it’s macgic, i.e. the handller had to recognise them by some bytes, not by file extension. This is the problem by now.
Please wait.

2 Likes

Ok, I’ll be patient… :wink:

I really hope this will be sorted out soon.

It’s on you, too. believe me.

Unfortunately I have no big knowledge of file formats and their “magic numbers”, and all RAW processors I know of seem to recognise RAW files by their extension.

Also, some RAW files are equivalent to TIFF files, and actually GIMP sometimes passes TIFF files to the RAW loading plug-ins. PhotoFlow passes such TIFF files back to GIMP, but again this is decided based on the file extension. By the way, this is exactly what UFraw is doing since long (the PhF plug-in code is derived from UFraw) and nobody seems to have complained in the past.

I’m not saying this is perfect, but on the other hand file extensions do have some meaning…

Fuck, I’m a German. :smiley:

2 Likes