2014年9月21日 星期日

2014年9月20日 星期六

2014年9月14日 星期日

This example shows how to curve-bend an label stuck on a cylindrical surface to
rectangular area.

Save the following Python-fu script to C:\Program Files\GIMP
2\lib\gimp\2.0\plug-ins\my_curve_bend.py
(Assume GIMP is installed in C:\Program Files\GIMP 2)
Note that the pdb.plug_in_curve_bend() is used.

Open the sample label in GIMP.

Goto Menu Windows -> New Toolbar. Double click the "Path" toolbar

Draw a upper path along the curved surface. Please use maximum 16 segments.
(Note you can use Ctrl + Mouse scroll to zoom-in)

Press the Shift key to start a new path segment.
Draw a lower path along the curved surface. Please use maximum 16 segments.

Start the bending by go to Menu Python-fu -> My curve bend.
Here is the result:

# This is the plugin registration function# I have written each of its parameters on a different line register(#Your plugin's main function name, as it will be found in Gimp's Procedure Browser. #This means that your plugin will be callable by other plugins, using this function#name (even by a script in a another language)!"my_curve_bend",

#Your plugin's "documentation" name, as it will also appears in the Procedure Browser.#This name should describe your plugin briefly."My Curve Bend Python-Fu",

#Plugin's help. Here you should explain in a more detailed manner what kind of function #your plugin provides."This script does the reverse of curve bending",

#The name of the author of this plugin"Y Lam",

#Any copyright information needed"Y Lam",

#The date this version of the plugin was released"Sep 2014",

#The path in the menu where your plugin should be found"<Image>/Python-Fu/My Curve Bend",

#The image types supported by your plugin"*",

#The list of the parameters needed by your plugin [],

#The results sent back by your plugin [],

#The name of the local function to run to actually start processing, which will be called with a set of parameters. my_curve_bend, )