Bump Text - Watermark

Generates watermark by bump mapping the selected layer with the specified input text. Uses the bump mapping technique found here: http://www.gimp.org/tutorials/The_Basics/

AttachmentSize
bumptext-1.0.1.py3.07 KB
0
Average: 2.5 (2 votes)

Comments

Undo improvement

Hi,
I find that adding the two lines as follows you can undo the script with one click only.
Hope it helps,


...
#save the back and foreground colors
pdb.gimp_image_undo_group_start(image) <--- (added)
background = gimp.get_background()
foreground = gimp.get_foreground()
...
#reset to original back and foreground
gimp.set_background(background)
gimp.set_foreground(foreground)
pdb.gimp_image_undo_group_end(image) <--- (added)
...

Good advice on the UNDO

I would just add that instead of saving/restoring the foreground and background colors, one can use gimp-context-push and gimp-context-pop (this will also restore pattern, gradient, palette, font, and brush settings to their original state).

cant change font

This script is very nice. However I cannot change the font, it gives an error

"An error occured running python_fu_bumptext
AttributeError: 'NoneType' object has no attribute 'group' "

How to tackle this?

Personal hack

I made a small hack to the plug-in to enable it to use other fonts. Just make these changes:

Make your definitions like this:

def python_bumptext(image, drawable, text, fontname, fontsize, blur, depth, x, y, rotation, invert):

Comment out the following:

    #split the font size from the name
    #font = re.search("(.*) (\d+)", font)
    #fontname = font.group(1)
    #fontsize = font.group(2)

Add the following PF_FLOAT parameter (note its place in the list & leave out the <------):

    (PF_STRING, "text", "Text to bump", "Bump Me"),
    (PF_FONT, "font", "Choose Font", 'Arial'),
    (PF_FLOAT, "size", "Size of Font", 36.0),  <-------
    (PF_INT, "blur", "Text blur", '5'),
    (PF_INT, "depth", "Depth", '3'),
    (PF_INT, "x", "Text X Placement", '0'), 
    (PF_INT, "y", "Text Y Placement", '0'),
    (PF_SLIDER, "rotation", "Text Rotation", 0, [-180, 180, .5]),
    (PF_TOGGLE, "invert", "Invert", 0)

That gives you the ability to adjust font size.

Just one small problem when making a Font selection, if you click the Font choice on the menu and decide to keep the original font, it will throw a layer error on the image, and not complete. Just undo the current process and start all over.

I understand the need to separate font size from font name (font widget string format), but I have no idea why font.group has no attributes, even tried to figure out how it would even work without them. I guess that's for the author to explain.

Enjoy!

I fixed line 33 in the

I fixed line 33 in the script. I don't know if it's because I was usying pygimp on windows, if the l changed to L pygimp side, or if it was just my typo. Enjoy.

?

Does this need to be run from the Python Console or can I make it show in my menus with some editing?

just look with a text editor

just look close to the bottom the registration path you will see ">Image

just look with a text editor 2

sorry seems no way to post as plain text on this site and so info went easily stripped away; i try again ...you will see the registration path Image/Phyton-Fu/alpha to logo/bump text

bumptext-1.0.0.py

I faced following error: An error occured running python_fu_bumptext: AttributeError: 'module' object has no attribute 'layer' Traceback (most recent call last): File "/usr/lib/gimp/2.0/python/gimpfu.py", line 692, in response dialog.res = run_script(params) File "/usr/lib/gimp/2.0/python/gimpfu.py", line 353, in run_script return apply(function, params) File "/home/abc/.gimp-2.6/plug-ins/bumptext-1.0.0.py", line 33, in python_bumptext textlayer = gimp.layer(image, "textlayer", drawable.width, drawable.height, RGBA_IMAGE, AttributeError: 'module' object has no attribute 'layer' Maybe some error in installing or using the script.

typo?

33: s/gimp.layer/gimp.Layer/

Bump text-please rename!!

Thank for the cool script but please correct the name Nobody will never guess that " bump text "is a script to create watermark, "Bumped Watermark" will give a better hint and will give results in google and other search engine, including that of this side for "gimp watermark" while under that original name will be impossible to search and find
Syndicate content