well, I should provide some motivation. The first person who posts a working script (as below) gets exclusively a high resolution tif (3526 x 3246) of the attached photo for private usage. (I am the copyright holder and I have the permission to publish the photo.)
The script has to be written in python-fu, and I want to call the script from cygwin under windows 20 (64bit).
I have files t00.tif, ..., t11.tif (single page tifs) in the current directory. The script should generate a single file with
t00.tif, ..., t11.tif as layers. t00.tif should be the top layer, ..., t11 the bottom layer.
The above 11 layers should get a white layer mask, and the mix method should be "grain merge".
I wrote this based on your first incomplete specification to give me some practice with Python-Fu, and as you've now changed to a new incomplete specification, you can regard this as a starter for you to continue with.
(09-14-2020, 07:28 AM)Kevin Wrote: I wrote this based on your first incomplete specification to give me some practice with Python-Fu, and as you've now changed to a new incomplete specification, you can regard this as a starter for you to continue with.
Thank you, I will have a look at the script late in the evening.
09-16-2020, 11:19 PM (This post was last modified: 09-16-2020, 11:22 PM by DanielDD.
Edit Reason: fixed typo
)
Hallo,
based on Kevins script I wrote the code, below.
When I copy and paste the code into Gimp's python console, it works fine.
However, when I want to run the code outside Gimp (e.g. by double clicking
GIMP 2/bin/python.exe), it cannot import from gimpfu.
The script is not executed, but I see the error message:
Code:
File "C:\Program Files\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 827, in _run
return apply(func, params[1:])
File "C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins\python-eval\python-eval.py", line 25, in code_eval
exec code in globals()
File "<string>", line 1, in <module>
NameError: name 'WaveletImporter' is not defined
However, the script appears in the "Filters"-menu, and when I click on it, it works fine.
When I call gimp from windows, it shows the same behavior, but I do not see the error message.
Because your script as seen from Gimp is really hidden in pdb.python-fu-WaveletImporter. Under the hood this procedure starts your script as a new process that loads the .py file.
On the SO example, the bit sys.path=['.']+sys.path; that you didn't copy adds the current directory (which is hopefully the one with the python script) to the Python path, so that the subsequent import finds it.