Ok, I made it work, I just replaced newlayer for newimage in the gimp-edit-paste call and it worked. But pasting into the image should work, shouldn't ?, do I have to set up a current layer or something ? bests, Pablo On Tuesday 16 December 2008 12:52:49 Pablo Yaggi wrote: > Well, following all advices I decide to make the plugins I need for gimp, > and use it in batch mode, this way plugins will be available for everybody. > But my first attempt is not working fine, I'm coping/pasting the following > code into the script-fu console, and I get a black image as glam-out.jpg > with correct size, could you tell me why ?, > (this is a test that should make an image which is double in height than > input, and the upper half size has the input copied as is and the lower > half size has the input copied rotated 180) > > (let* ( > (image (car(gimp-file-load 1 "/home/pablo/glam.jpg" > "/home/pablo/glam.jpg"))) > (width (car (gimp-image-width image))) > (height (car (gimp-image-height image))) > (newheight (* height 2)) > (newimage (car(gimp-image-new width newheight RGB))) > (newlayer (car (gimp-layer-new newimage width newheight RGBA-IMAGE > "Copy" 100 NORMAL-MODE))) > ) > (gimp-context-push) > > (gimp-image-add-layer newimage newlayer -1) > (gimp-drawable-set-visible newlayer TRUE) > (gimp-selection-all image) > (gimp-edit-copy-visible image) > (gimp-rect-select newimage 0 0 width height CHANNEL-OP-ADD FALSE 0) > (let ((floating-sel (car (gimp-edit-paste newimage FALSE)))) > (gimp-floating-sel-anchor floating-sel) > ) > (gimp-selection-none newimage) > (gimp-rect-select newimage 0 height width height CHANNEL-OP-ADD FALSE 0) > (let ((floating-sel (car (gimp-edit-paste newimage FALSE)))) > (gimp-rotate floating-sel FALSE 180) > (gimp-floating-sel-anchor floating-sel) > ) > (gimp-file-save 1 newimage newlayer "/home/pablo/glam-out.jpg" > "/home/pablo/glam-out.jpg") > > (gimp-context-pop) > ) > > > > > > > > > > > > Best Regards, > Pablo > > > > > On Sunday 14 December 2008 16:36:10 saulgoode@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx > > wrote: > > Quoting Pablo Yaggi <pyaggi@xxxxxxxxxxxxxxx>: > > > So ..., I think a couple of things are not clear to me about gimp, > > > if plugins communicate with the core of gimp thought a pipe, I > > > should be able to create a plugin to do what i want, even > > > call other plugins, but could that plugin be executed from outside > > > the core ?, ... > > > > Yes. > > > > > even so it is necesary that gimp is running before > > > doing it ? > > > > Yes, if you want to use plug-ins or scripts then you will want GIMP to > > be running (unless you want to reimplement all of the functionality of > > handling those plug-ins using libgimp). > > > > > are the core and gui strict releated, i mean are the same > > > thing? can the gui be down, and the core working ? > > > > Yes, you can execute GIMP without the GUI by passing the > > '--no-interface' ('-i') option on the command line. Script-fu code can > > be passed to GIMP on the command line as well, if you know what that > > code is in advance. If you need a more interactive approach, you could > > also have GIMP running in a server mode where Script-fu commands are > > passed over TCP. > > > > > In other words, is it possible in any way to use gimp for > > > automatic image processing/generating, because GEGL its very > > > promissing but gimp is fully charged with plugins and tools, > > > and It sould be very nice to use all that power for automatic > > > process. > > > > First, I would propose that you investigate Imagemagick command line > > tools ( http://www.imagemagick.org/ ) and see if they present a better > > solution. > > > > Second, you should investigate using GEGL. It is particularly targeted > > for the type of activity you are pursuing and your participation could > > help advance its progress. > > > > If neither of those two options seem desirable then I would present > > the following GIMP-based options: > > > > 1) Invoke GIMP from your C program, passing the commands you wish > > executed as Script-fu in batch mode ('-b'). > > > > 2) If you need lower level processing than provided by Script-fu, > > write your code as a GIMP plug-in and invoke your plug-in from a batch > > Script-fu command. Example: > > gimp -i -b '(plug-in-pablos-function RUN-NONINTERACTIVE parameter1 > > parameter2)' -b '(quit 0)' > > > > 3) Run an interactive server, as briefly described in this ML posting: > > ( > > http://flashingtwelve.brickfilms.com:2095/horde/imp/message.php?index=113 > >69 ) > > > > 4) Write your code as a GIMP plug-in per the tutorial described here: > > ( http://gimp.org/docs/plug-in/sect-essentials.html ) > > > > however, you should register an 'init' procedure which invokes your > > plug-in (perhaps passing it command line parameters). > > > > This will have the effect of your plug-in automatically being executed > > when GIMP is run; therefore do NOT put your autoexecuted plug-in into > > the standard GIMP plug-in folders (or you will "break" normal usage of > > GIMP). Instead, create a custom gimprc file (e.g., > > "$HOME/gimprc.pablo") which adds the path of your autoexecuted plug-in > > to the plug-in search path: > > (plug-in-path > > "${gimp_dir}/plug-ins:$HOME/.gimp-2.6/plug-ins:$HOME/autoexec/plug-ins") > > > > You then can invoke GIMP, specifying the alternate gimprc: > > gimp -i -g $HOME/gimprc.pablo > > > > ======================= > > > > There is little difference between 2) and 4) in net effect, but I > > thought I would try to explain it anyway (I have never tried the > > fourth method). Usually the 'init' procedure is not used for > > individual plug-ins -- it is used to configure things for entire > > packages of multiple plug-ins (such as Python-fu or the GIMP Animation > > Package). > > > > > > > > _______________________________________________ > > Gimp-developer mailing list > > Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx > > https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer |
_______________________________________________ Gimp-developer mailing list Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer