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.
My script code:
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.
Code:
ImportError: No module named gimpfu
My script code:
Code:
import os,glob
from gimpfu import *
ctrl = 0
os.chdir('D:/z')
for tiffile in glob.glob('*tif'):
print tiffile
tiffile = 'D:/z/' + tiffile
if ctrl == 0:
image = pdb.gimp_file_load(tiffile,tiffile)
ctrl = 1
else:
newlayer = pdb.gimp_file_load_layer(image, tiffile)
image.add_layer(newlayer, -1)
newlayer.mode = LAYER_MODE_GRAIN_MERGE
mask_channel = newlayer.create_mask(ADD_MASK_WHITE)
newlayer.add_mask(mask_channel)
pdb.gimp_display_new(image)
gimp.displays_flush()