Python plug-in for GIMP3: ART editing plug-in

Hi,

I have written new Python plug-in for GIMP3. This is “ART editing plug-in for GIMP3”. It is a plug-in, like G’MIC-Qt, using raw processor ART as external editor of GIMP.

Generally, when using GIMP and Raw Processor together, it is common to process the image in Raw Processor first, and then perform edits that cannot be done in Raw Processor. However, when restoring and editing severely faded negative film images, I often use ImageJ and GIMP first to perform rough image restoration, and then use ART for the final edits. I developed this plugin for this workflow.

Also, this plugin enables you to use ART’s excellent features on GIMP without changing applications.

Of course, if you haven’t installed ART on your system yet, you’ll need to install it before installing this plug-in.

In installation this plug-in, you should edit config.ini in the installation directory to be appropriate to your environment. The default values are as follows.

[ART path on Windows]
COMMAND_NT;C:\\Program Files\\ART\\1.26.1\\ART

[ART path on Linux]
COMMAND_LINUX;/home/username/Programs/ART/ART

[ART path on Mac OS]
COMMAND_DARWIN;/Applications/ART.app/Contents/MacOS/ART

[Temp file bit depth]
TMP_FILE_BITDEPTH;16
# TMP_FILE_BITDEPTH specify temp file bit depth.
# The value of TMP_FILE_BITDEPTH must be 8, 16 or 32

[ART edited result pasted as layer]
IMPORT_AS_LAYER;False
# The value of IMPORT_AS_LAYER must be True or False

[Delete ART sidecar files]
DELETE_ARPS;False
# The value of DELETE_ARPS must be True or False

With IMPORT_AS_LAYER parameter, you can select importing ART edited result as new image or new layer of existing image. Default value is False (importing as new image).

With DELETE_APRS parameter, you can select keeping or deleting edited sidecar files. Default value is False (keeping sidecar files). Side car files will be made in the same directory of original image file.

After installation of this plug-in, you can start it from menu [Filters] > [ART Editing Plug-in…].

And it shows ART editing dialog.

After your editing, close the ART dialog and it will make edited image and import the image into GIMP as you specified in config.ini.

If you use it on GIMP3 flatpak version, you should start GIMP with “—socket=session-bus” option, and ART must be non-flatpak version, as flatpak does not support cli utilities.

1 Like

Thanks for another great plugin.

A quick note:

In ART, it opens not only the active layer, but also what’s visible.

A solution to this issue would be interesting (as it relates to how Gimp saves multi-layered images) and applies to all external editors I know of (e.g., Nik Collection https://github.com/iiey/nikgimp). Theoretically, various solutions are possible:

  1. Open the active layer as a new image, which will be saved for use by the external editor.
  2. Use the code from Kamil Burda’s Batcher ( GitHub - kamilburda/batcher: Batch Processing Plug-in for GIMP 3 ) ‘Export Selected Layer’:

Thank you for your advice. The operation of this plug-in is intended. As I thought if user would like to import selected one layer, user may make only one layer visible to do it. However, in next version, I would like to modify this plug-in to allow user to select importing visual image or selected one layer with config.ini.

Here is updated version of this plug-in.

In this version I added the option of importing selected layer(s) to ART. Users can specify the option selection with [Selected layers import mode] parameter in config.ini .

[ART path on Windows]
COMMAND_NT;C:\\Program Files\\ART\\1.26.1\\ART

[ART path on Linux]
COMMAND_LINUX;/home/username/programs/ART/ART

[ART path on Mac OS]
COMMAND_DARWIN;/Applications/ART.app/Contents/MacOS/ART

[Temp file bit depth]
TMP_FILE_BITDEPTH;16
# TMP_FILE_BITDEPTH specify temp file bit depth.
# The value of TMP_FILE_BITDEPTH must be 8, 16 or 32

[ART edited result pasted as layer]
IMPORT_AS_LAYER;False
# The value of IMPORT_AS_LAYER must be True or False
# Default is False (import as a new image)

[Delete ART sidecar files]
DELETE_ARPS;False
# The value of DELETE_ARPS must be True or False
# Default is False (keep sidecar files)

[Selected layers import mode]
IMP_SEL_LAYERS;False
# The value of IMP_SEL_LAYERS must be True or False
# Default is False (import visible image to ART)

However if you select multiple layers before starting this plug-in, visible image between them will be imported in ART and if you select all layers it is same as visible image import mode (default mode).

Many thanks for solving the problem that interests me. :grinning:

1 Like

Really great idea! Reminds me of the Photoshop Camera Raw Filter.

I have ART installed as a Flatpak. I’ve updated the config file to use the command that opens ART on my system, but the plugin doesn’t launch ART.

Any ideas why?

[ART path on Windows]
COMMAND_NT;C:\\Program Files\\ART\\1.26.1\\ART

[ART path on Linux]
COMMAND_LINUX;/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=ART --file-forwarding us.pixls.art.ART @@ %f @@

[ART path on Mac OS]
COMMAND_DARWIN;/Applications/ART.app/Contents/MacOS/ART

[Temp file bit depth]
TMP_FILE_BITDEPTH;16
# TMP_FILE_BITDEPTH specify temp file bit depth.
# The value of TMP_FILE_BITDEPTH must be 8, 16 or 32

[ART edited result pasted as layer]
IMPORT_AS_LAYER;False
# The value of IMPORT_AS_LAYER must be True or False
# Default is False (import as a new image)

[Delete ART sidecar files]
DELETE_ARPS;False
# The value of DELETE_ARPS must be True or False
# Default is False (keep sidecar files)

[Selected layers import mode]
IMP_SEL_LAYERS;False
# The value of IMP_SNGL_LAYER must be True or False
# Default is False (import visible image to ART)

Hi, Chuck
To operate this plug-in, it is needed to ART non-flatpak version, Because Flatpak does not officially support cli utilities, and this plug-in uses ART-cli. It is recommended to use official binary. Its installation is very easy like appImage. GIMP flatpak version is OK however launch it using ‘–socket=session-bus’ option.

See following site.

1 Like

Thanks @yasuo, this is really great!

1 Like

Hi,
I have updated this plug-in that allows users to use ART Flatpak version as client program as I have found the method to control flatpak app and cli utilities from GIMP plug-in.

To use ART Flatpak version as client program, you need to modify the description in config.ini file as below.

[ART directory path on Linux]
COMMAND_LINUX;flatpak run us.pixls.art.ART

Good to know. Are there any other changes aside from Flatpak support?

Hi,
Only Flatpak support was added. Thanks!

Hm. I think I configured config.ini correctly but I’m getting these errors:

  ART Editing Plug-in Warning
ART flatpak will be operated!

  ART Editing Plug-in Warning
/home/chuck/Pictures/suyian-lodge-michaelis-boyd-safari-resort-north-kenya-architecture_dezeen_2364_col_7 (2).png

  ART Editing Plug-in Warning
fileRootName: /home/chuck/Pictures/suyian-lodge-michaelis-boyd-safari-resort-north-kenya-architecture_dezeen_2364_col_7 (2)

  ART Editing Plug-in Warning
Making tmp file result: True

  GIMP Error
Calling error for procedure 'gimp-file-load':
Procedure 'file-tiff-load' has been called with value '<not transformable to string>' for argument 'file' (#2, type GFile). This value is out of range.

Here’s my config.ini:

[ART path on Windows]
COMMAND_NT;C:\\Program Files\\ART\\1.26.1\\ART

[ART path on Linux]
COMMAND_LINUX;COMMAND_LINUX;flatpak run us.pixls.art.ART
# If your ART is Flatpak version...
#COMMAND_LINUX;flatpak run us.pixls.art.ART

[ART path on Mac OS]
COMMAND_DARWIN;/Applications/ART.app/Contents/MacOS/ART

[Temp file bit depth]
TMP_FILE_BITDEPTH;16
# TMP_FILE_BITDEPTH specify temp file bit depth.
# The value of TMP_FILE_BITDEPTH must be 8, 16 or 32

[ART edited result pasted as layer]
IMPORT_AS_LAYER;False
# The value of IMPORT_AS_LAYER must be True or False
# Default is False (import as a new image)

[Delete ART sidecar files]
DELETE_ARPS;False
# The value of DELETE_ARPS must be True or False
# Default is False (keep sidecar files)

[Selected layers import mode]
IMP_SEL_LAYERS;False
# The value of IMP_SNGL_LAYER must be True or False
# Default is False (import visible image to ART)

And here is my us.pixls.art.ART.desktop file:


[Desktop Entry]
Type=Application
Version=1.0
Name=ART
GenericName=Raw photo editor
GenericName[cs]=Editor raw obrzk
GenericName[fr]=Éditeur d'images raw
GenericName[pl]=Edytor zdj raw
Comment=An advanced raw photo development program
Comment[cs]=Program pro konverzi a zpracovn digitlnch raw fotografi
Comment[fr]=Logiciel de conversion et de traitement de photos numriques de format raw (but de capteur)
Comment[pl]=Zaawansowany program do wywoywania zdj typu raw
Icon=us.pixls.art.ART
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=ART --file-forwarding us.pixls.art.ART @@ %f @@
Terminal=false
MimeType=image/jpeg;image/png;image/tiff;image/x-adobe-dng;image/x-canon-cr2;image/x-canon-cr3;image/x-canon-crf;image/x-canon-crw;image/x-fuji-raf;image/x-hasselblad-3fr;image/x-hasselblad-fff;image/x-jpg;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-leaf-mos;image/x-leica-rwl;image/x-mamiya-mef;image/x-minolta-mrw;image/x-nikon-nef;image/x-nikon-nrw;image/x-olympus-orf;image/x-panasonic-raw;image/x-panasonic-rw2;image/x-pentax-pef;image/x-pentax-raw;image/x-phaseone-iiq;image/x-raw;image/x-rwz;image/x-samsung-srw;image/x-sigma-x3f;image/x-sony-arq;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-tif;inode/directory;
Categories=Photography;Graphics;2DGraphics;RasterGraphics;GTK;
Keywords=raw;photography;develop;pp3;graphics;
StartupWMClass=ART
X-Flatpak-RenamedFrom=ART.desktop;
X-Flatpak=us.pixls.art.ART

I am sorry for the inconvenience.

The reason for the error is that your file name contains spaces or parentheses. This is a limitation of using this plug-in with the ART Flatpak version. If you use it with the ART non-Flatpak version, this problem does not occur.
In my other plug-ins that handle the ART Flatpak version, I added warning messages when users try to select a file whose name contains spaces or parentheses. However, I forgot to add warning messages to this plug-in.

I’m not sure if the cause is the Flatpak CLI or the os.system of Python, anyway I have not found a solution yet.

I updated this plug-in (ver. 0.4):
https://drive.google.com/file/d/1AeyK4a4D1QYX6Ke7PrV6SAmJ5Na7Du7p/view?usp=drive_link.

This version fixes the issue where files containing spaces or parentheses could not be read if the user was using the ART Flatpak version.

1 Like

I updated this plug-in (ver. 0.5).

Revised points:

1) If the current image does not have file name, it will be named automatically to avoid an error.
2) Improve error handling.

I have updated this plug-in (ver.0.5a).

In this version, I have fixed bug in error processing of ARTsubprocess.py.