Wednesday, February 22, 2017

The new PhotoFlow GIMP plug-in interface

Recently I have been working on a complete re-write of the PhotoFlow GIMP plug-in interface.

The new plug-in code is a simple wrapper that saves and loads the image data into temporary floating point TIFF files, and then invokes the standard photoflow executable with those TIFF files as parameters.  It also saves and retrieves the accompanying PFI files with the processing parameters that get stored in the GIMP layer meta-data.

There are few advantages in this approach:

  • the main PhotoFlow package is now completely independent from GIMP, and can be released separately from the plug-in
  • the plug-in code itself is easier to maintain, has very few dependencies and is very fast to compile
  • hopefully  it will be easier in the future to add wrapper plug-ins for other editors... here I'm thinking in particular about Krita. Wouldn't be nice to have a RAW loader plug-in for Krita based on PhotoFlow?

The new plug-in code can be found on GitHub here.

Compilation and installation

Compiling and installing the plug-in should be rather easy:

  • install the GIMP development files (from sources or via your preferred package manager)
    The PhFGimp plug-ins are only compatible with GIMP version 2.9.5 or higher.
  • clone the git repository:
      git clone
  • create the build directory:
      cd PhFGimp
      mkdir -p build
      cd build
  • configure, build and install the plug-ins:

      make install (or sudo make install depending on the location of the GIMP plug-ins folder)
    or copy the file-photoflow and phf_gimp files to the custom GIMP plug-ins folder (usually $HOME/.config/GIMP/2.9/plug-ins under Linux)

Integration with the photoflow executable

In order to use the PhFGimp plug-ins, you also need to install the latest version of the PhotoFlow editor (for example from here or from Dariusz Duma's PPA).

The photoflow executable is searched in different locations depending on the operating system:

  • under Linux, it is searched in the folders included in the PATH environment variable
  • under OSX, the plug-ins will use the
    executable if available
  • under Windows, the plug-ins will use the
    executable if available

This choices can be overridden by setting the PHOTOFLOW_PATH environment variable to the full path of the PhotoFlow executable.


  1. Hi,
    I have been following the instructions to install the PhotoFlow GIMP plugin
    and have found an error when I reach the "cmake -DBABL_FLIPS_DISABLED=OFF -DCMAKE_BUILD_TYPE=Release .." instruction.

    "no package lcms2 found."
    I am using Ubuntu 16.04LTS and have installed the latest Gimp 2.9.5 and PhotoFlow.
    Could you please suggest how I should proceed.
    Many thanks,
    Michael Fay

  2. You need to install few development packages in order to be able to compile the plug-in from sources.

    In particular, you will need the liblcms2-dev, libtiff5-dev and libgimp2.0-dev development packages (the first two might be already pulled in as dependencies if you install the GIMP development packages).

  3. Thanks for your reply. I installed the packages as you suggested and found I needed to install a further package i.e. libgexiv2-dev. This overcame a further error but I have reached another impasse.
    "-- GEXIV2_INCLUDE_DIRS: /usr/include/glib-2.0/usr/lib/x86_64-linux-gnu/glib-2.0/include
    -- Checking for module 'gimp-2.0>=2.9.0'
    CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message):
    A required package was not found"

    This is proving too complicated for me but thank you for your help

    Michael Fay

    1. What is the version of the libgimp2.0-dev package you installed? The plug-in is only compatible with GIMP 2.9.5, available from the gimp-edge PPA:

  4. I installed libgimp2.0-dev again and got this message
    "libgimp2.0-dev is already the newest version (2.9.5~91-0x3~ppa~49b7f25)"

    I updated from the PPA 2 days ago.

    1. Hi Michael, here is modules needed:
      cmake 3.5.1-1ubuntu3
      cmake-curses-gui 3.5.1-1ubuntu3
      cmake-data 3.5.1-1ubuntu3
      cmake-qt-gui 3.5.1-1ubuntu3
      cmake-extras 3.5.1-1ubuntu3
      extra-cmake-modules 5.28.0-0ubuntu1

      GIMP 2.95 Dev GIMP-GIT from Dimula73
      gimp 2.9.5-87
      gimp-data 2.9.5-87
      libgimp2.0 2.9.5-87
      libgimp2.0-dev 2.9.5-87
      icc-profiles-free 2.0.1

      LIB NEEDED=>
      liblcms2-2 2.6
      liblcms2-2:i386 2.6
      liblcms2-2-utils 2.6
      liblcms2-2-dev 2.6

      libtiff5 4.0.6-1
      libtiff5:i386 4.0.6-1
      libtiff5-dev 4.0.6-1
      libtiffxx5 4.0.6-1

      libfreeimage3 3.17.0+ds1-2

      libgexiv2-2 0.10.3-2
      libgexiv2-2-dev 0.10.3-2
      gir1.2-dexiv2-0.10 0.10.3-2

      libgegl-0.3-0 1:0.3.13
      libgegl-dev 1:0.3.13

      libvips42 8.4.5-1
      libgutenprint2 5.2.11-1
      printer-driver-gutenprint 5.2.11-1

      gimp-dds 3.0.1-1

      libglib2.0-0 2.48.2-0ubuntu1
      libglib2.0-0:i386 2.48.2-0ubuntu1
      libglib2.0-0-bin 2.48.2-0ubuntu1
      libglib2.0-0-data 2.48.2-0ubuntu1
      libglib2.0-0-dev 2.48.2-0ubuntu1

      libijs-0.35 0.35-12

      libvips42 8.4.5-1dhor~xenial

      libgdk2-common 2.40.13-3
      libgdk2-common:i386 2.40.13-3

      libgdk-pixbuf2.0-0 2.32.2-1
      libgdk-pixbuf2.0-0:i386 2.32.2-1
      libgdk-pixbuf2.0-0-common 2.32.2-1
      libgdk-pixbuf2.0-0-dev 2.32.2-1

      libsvg2.common 2.40.13-3
      libsvg2.common:i386 2.40.13-3

      libcairo2 1.14.6-1
      libcairo2:i386 1.14.6-1
      libcairo2-dev 1.14.6-1
      libcairo2-gobject2 1.14.6-1
      libcairo2-gobject2:i386 1.14.6-1
      libcairo-script-interpreter2 1.14.6-1

      libjson-glib-1.0-0 1.1.2-0ubuntu1
      libjson-glib-1.0-0-dbg 1.1.2-0ubuntu1
      libjson-glib-1.0-common 1.1.2-0ubuntu1
      libjson-glib-dev 1.1.2-0ubuntu1

    2. Hi.

      I'm trying to compile the Photoflow plugin for GIMP.
      I always receive an error.
      This is what appears in my terminal (end of the message).

      Any idea ?

      /home/carol/PhFGimp/ error: cannot convert ‘gchar** {aka char**}’ to ‘gchar* {aka char*}’ in initialization
      gchar *argv = ( source_layer_id >= 0 ) ? argv1 : argv2;
      /home/carol/PhFGimp/ error: cannot convert ‘gchar* {aka char*}’ to ‘gchar** {aka char**}’ for argument ‘2’ to ‘gboolean g_spawn_sync(const gchar*, gchar**, gchar**, GSpawnFlags, GSpawnChildSetupFunc, gpointer, gchar**, gchar**, gint*, GError**)’
      NULL, NULL, error)) {
      /home/carol/PhFGimp/ error: expected ‘}’ at end of input
      CMakeFiles/phf_gimp.dir/build.make:62 : la recette pour la cible « CMakeFiles/phf_gimp.dir/ » a échouée
      make[2]: *** [CMakeFiles/phf_gimp.dir/] Erreur 1
      CMakeFiles/Makefile2:104 : la recette pour la cible « CMakeFiles/phf_gimp.dir/all » a échouée
      make[1]: *** [CMakeFiles/phf_gimp.dir/all] Erreur 2
      Makefile:127 : la recette pour la cible « all » a échouée
      make: *** [all] Erreur 2

    3. There was a stupid mistake in the last git commit... could you update your local copy and try to compile again? I just tested the master branch and for me it compiles and works fine.


  5. Thanks for this helpful Blog.
    I used a WordPress plugin that I found interesting. So I would like to recommend it.
    The plugin helps me quickly create and customize images before inserting them in my blog post.
    Check at:
    It’s free.

  6. Thanks for this helpful Blog.
    I used a WordPress plugin that I found interesting. So I would like to recommend it.
    The plugin helps me quickly create and customize images before inserting them in my blog post.
    Check at:
    It’s free.