Code: Select all
#! /usr/bin/env python2 from gimpfu import * def python_Test(img, layer): #Check if image is grayscale mode is_gray = pdb.gimp_drawable_is_gray(img) if (is_gray==TRUE): pdb.gimp_image_convert_rgb(img) ... (if the 3 lines above are deleted, the remainder of code from here on works fine which is to duplicate the layer, rename it and make it the active layer.) newLayer = pdb.gimp_layer_copy(layer, pdb.gimp_drawable_has_alpha(layer)) #Duplicate layer pdb.gimp_image_insert_layer(img, newLayer, None, -1) pdb.gimp_drawable_desaturate(newLayer,3) #Desaturate duplicate layer active_layer_name = pdb.gimp_item_get_name(layer) + " copy" active_layer = newLayer
I would really appreciate any help because it bugs me that I can't grasp something that should be simple. Thank you.