Page 1 of 1

Nik Script to open STANDALONE filters as plugins in PSP

PostPosted: Sun Jan 13, 2019 9:44 pm
by JoeB
While these scripts are available in another thread here, it's buried in the conversation and difficult to locate, so because of a request of forum member @iraisok I'm posting them here, along with information and instructions for use. Originally created by forum member @JSJ some years ago to be freely used, they were in another language. Member Alex Kang translated them to English and I'm posting his English version here. The scripts should work with all versions of PSP - at least starting with X4 but maybe earlier also.


Simply put, the script will allow you to open filters that have standalone versions (or even other graphic programs) in PSP as plugins in PSP. It creates a temporary copy of the image that's open in your PSP workspace in your Documents folder, then opens the standalone filter/graphic program which opens that temp image. You process it with the filter then use the Save option of the filter which will overwrite the temp image file in Documents with the filtered image (if prompted to overwrite, accept.). Then you close the filter and the script will fetch the processed image, paste it as a new layer on your image in PSP and then delete the temp file from the Documents folder.

SIMPLE EDITS TO THE SCRIPT (This info is also in the comments throughout the scripts!)

First, the script must be placed in your Script Trusted folder.

The script needs to know where to find the executable (.exe) file of the standalone filter/graphic program that you want to open as a plugin. So open it in a text editor (I recommend the free Notepad++, which puts line numbers beside each line of the script).

Lines 24 (if using 32bit filters) or 26 (for 64bit filters) have to be modified to show the actual path to that executable. JUST CHANGE THE PATH and PATH NAMES. DOUBLE BACK SLASHES RATHER THAN SINGLE ONES ARE NECESSARY AS PATH SEPARATORS IN SCRIPTS!

THAT'S REALLY ALL you HAVE to do, but to make things a bit more convenient you should make a couple more simple edits:

Line 21 provides the name you want the new, filtered layer to have in PSP. You can simply change it to the name of the filter/program you are opening as plugin in PSP so that the layer name makes sense.

Similarly, Line 35 provides the temp file name for the temp file created in your Documents folder. It makes sense to again simply change the present name to the same name you used in Line 21 (e.g., where it now says Nik_temp you could change it to ColorFX_temp or Perfectly Clear_temp).

Lines 29 and 31 determine whether the temp file created is saved as .jpg or .tif and presently defaults to .jpg. You might want to comment that out and uncomment .tif so that the save is lossless. NOTE: Adding a # character to the beginning of a line or command makes that command inactive in the script, and removing an existing # character from a line/command in the script makes that command active - i.e., visible to the script interpreter.

Finally, save your edited script with an appropriate name. It can be bound to an icon and added to your Effects menu if you want. I have actually created a separate category in my Effects menu named Plugin Scripts (which I placed directly under the Plugins category) and have a bunch of these modified scripts bound to an icon and placed in that flyout.

If you find any issues with the script not working as expected with specific programs, please post them here!

Re: Nik Script to open STANDALONE filters as plugins in PSP

PostPosted: Sun Jan 13, 2019 10:29 pm
by JoeB
I decided to post a bit of additional information about the scripts I posted (above) just in case some people find this info useful.


There are several reasons you might want to use the script.

1) I am using this script to open the Standalone version of Viveza 2 in PSP, even though there is an 8bf plugin available. That's because the plugin has a bug (at least when used in PSP) which desaturates the image colors in its workspace unless it is zoomed to at least 30%, and some large (pixel size) images will open there zoomed out to less than that. The Standalone version doesn't do this and displays proper color saturation regardless of the zoom level of the image.

2) I also have a script using the standalone version of DXO Viewpoint (a much more versatile perspective correction tool than that available in PSP) although a plugin is available. That's because the user interface of the standalone version is more advanced than the interface of the plugin with more, easily available, options.

3) Some filters are only standalone, with no actual plugin available (Painter Essentials is one of them).

4) If you prefer using PSP 64bit but have a filter you like that is only 32bit, if that filter has a 32bit standalone version then the script will open it as a plugin in PSP64bit. And vice versa - standalone 64bit plugins can be opened as plugins in 32bit PSP with the script if you prefer using PSP's 32bit version.

5) If you have a lot of 32bit plugins that you use but that don't have standalone versions, but you prefer using 64bit PSP, AND you also have an earlier version of PSP 32bit, then you can modify the script to use in your 64bit PSP so that it will open a previous version's 32bit PSP to use as a plugin. This will cause that 32bit version to open with a copy of whatever is in your 64bit PSP's workspace and you can process it using the 32 bit plugins. Save, close the 32bit version and the processed image will return as a layer in the image in your 64bit PSP. I have 2 versions of the script that does that - one which only sends the selected layer of a multi-layer image to the 32bit PSP, and one which sends all of the layers to the 32bit version. Those scripts have line 31 edited to save the temp image in .pspimage format.


1) Usually, a standalone plugin or graphic program will save the file you processed in it into the same folder in which it found the image, so using the Save option of the filter opened with the script should try to save in Documents and overwrite the temp file. But a few of them have a default save folder set in their Preferences/Options which can be anything. In such cases just change that folder to your Documents folder in the program's preferences.

2) I also ran into a program (Luminar, I think) that saves .tif files as .tiff, so it wouldn't overwrite the .tif temp file. If you have that issue with a program (e.g., the layer returned to PSP doesn't seem to have been processed with the filter because the program saved as .tiff instead of .tif) then simply edit Line 31 for that script to .tiff from .tif for that particular script. NOTE: You can actually change the save format to anything you want (e.g., PNG). PNG can be useful if the image/layer you're going to process has transparency AND ONLY if the standalone program you're calling will also save the processed image as PNG with the existing transparency! Many programs don't have the ability to default to saving PNG with existing transparency or to save transparency at all!

3) Some third party filters and programs, when saving images, will add their own name to the end of the file name but before the extension (e.g., your temp file name might be Luminar_temp.tif but the Luminar filter might have added Luminar to it so now it reads Luminar_temp_Luminar.tif in the filename save field - See @iraisok's post below). If that happens, just delete the _Luminar at the end before saving so that the saved file reflects the same name as the temp file originally saved in the Documents folder and can then overwrite it so that the processed image is then returned as a layer to your image in the PSP workspace.

4) You can modify copies of the script to use with several programs (I have 8 of them, bound to icons and in my Effects menu). Just make sure to name the script for the program it's going to open and not overwrite the original you're modifying!

Re: Nik Script to open STANDALONE filters as plugins in PSP

PostPosted: Mon Jan 14, 2019 5:29 am
by iraisok
JoeB and originator of the process and others who offered assistance. A BIG THANK YOU!

I created scripts for a few standalone programs. With the exception of AfterShot that requires its own export process that does not work yet (I will explore it later), Painter Essentials and Ben Vista PhotoArtist worked properly AFTER I changed the path to where I save files, Ex: tmpFilename = 'C:\\tmp\\Painter Essentials_temp' + tmpFileExt instead of tmpFilename = os.path.expanduser("~\\Documents\\Painter Essentials_temp") + tmpFileExt. Also, Ben Vista PhotoArtist likes to add (PhotoArtist) to the saved file name. I striped that off before saving in PhotoArtist. That way, the tmp file name is as defined in the script when written to my tmp folder for it to be found to become the new layer.

JoeB - I very much appreciate the time you spent to clearly write the above two (2) replies, to change a script for a standalone application to serve as a plugin to PSP.

Re: Nik Script to open STANDALONE filters as plugins in PSP

PostPosted: Mon Jan 14, 2019 6:17 pm
by JoeB
Glad to do it and that it helped with your request in the main forum to be able to use Painter Essentials as a plugin. I have found the script to be very useful also as you can appreciate from my second post with the extra info.

And yes, the script does have a comment telling you that you can change the path to where you want to save the temp file. But because that temp file is overwritten and then deleted by the script anyway I'm sure the vast majority of users will be satisfied to simply keep the default Documents path for the temp file purpose for all the scripts they might modify for different programs, so I didn't bother mentioning it. However, if some program insists on defaulting to some specific Save path that won't save the processed file in Documents, then of course editing that path just for that script to point to the path the program insists on is a good way to do it.

And yes, as you found out, some standalone programs might have their own quirks in terms of how they export or save files, including default file extension formats (the latter of which I mentioned above about .tif and .tiff files). And what you found with PhotoArtist (which adds Photoartist to the end of the original file names when saving) is something that some other programs also do. But more often than not if you find that an image is not being returned properly as a processed layer, then it just takes a bit of thought about what that program might be doing differently than most others to be able to change things to make it work - i.e., perhaps a slight script edit, or perhaps changing the default properties in the standalone program.

In the case of PhotoArtist you did find the issue and solved it by simply stripping out the added part of the file name. Also, if the program actually opens the folder tree showing the path to the original temp and the temp file name is visible, you can just click that original temp file name in the directory tree which will place that name in the Save As Name field, thus replacing the file name that was modified by the program. If the program doesn't open the file tree on Save then try using the Save As option. It's just that if you can simply use Save instead of Save As then it saves a click or two. :-) And if you use Save As... make sure that the Save As type shown in that dialogue is the same format you chose in the script - i.e., jpg, tif or tiff, png, etc.

Again, glad it helped!