[Gimp-user] Error on the bash command line
I think that what you've done is fine up to a point. When the drop-shadow is created, it's put onto it's own layer, so your image now has two layers, BUT when you then set the drawable to the active layer: (set! drawable (car (gimp-image-get-active-layer image))) and save that layer ONLY: (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) you are only saving the original image/layer, resized to allow for the drop shadow. I think you need to merge the layers before you set the drawable to the active layer: (set! drawable (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE))) -- paynekj (via gimpusers.com) ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error on the bash command line
On Tue, Apr 19, 2011 at 06:14:39PM +0200, houghi wrote: I am very well aware of that. It is also hard to ask when you don't understand what you are asking. ;-) I hate questions like It doesn't work! and I hate myself for coming across like that. OK. Status update: Things work, but not due to me. Basically I kept on searching and found scripts from others. I am able to read them and sometimes even edit them. I am still unable to make my own. Here my thoughts on how I think the process is going: From the command line: gimp -i -c -d -b '(batch_fuzzy_border ./alyssa01.jpg pink 40 TRUE 10 TRUE 50) ' -b '(gimp-quit 0)' This is read by the script with (define (batch_fuzzy_border pattern color size blurt gran shadowt shadowp) This then is passed on to the real script with script-fu-fuzzy-border image drawable color size blurt gran shadowt shadowp FALSE TRUE) All the rest is to open andf close the file(s). This all works, so I try to implement this for script-fu-drop-shadow where I want to use the standard settings for all. In scrpt-fu console I get the following: (script-fu-drop-shadow run-mode image drawable value value value color value toggle) As I only want to change the name, I get the following: (define (batch_drop_shadow pattern) (let* ((filelist (cadr (file-glob pattern 1 (while (not (null? filelist)) (let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable (car (gimp-image-get-active-layer image))) ) (script-fu-drop-shadow image drawable 8 8 15 black 80.0 TRUE) (set! drawable (car (gimp-image-get-active-layer image))) (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image) ) (set! filelist (cdr filelist)) ) ) ) The command I use is: gimp --verbose -i -c -d -b '(batch_drop_shadow file.png )' -b '(gimp-quit 0)' This results in: Starting extension: 'extension-script-fu' No batch interpreter specified, using the default 'plug-in-script-fu-eval'. batch command executed successfully. The result is however not a dropshadow, although something is done, as the size is different before and after. With all the time I spend on this, it must be me that is unable to grasp how things are done and perhaps better just ask when O need a script. The end goal is to be able to do this for all of the scripts that are either included or downloaded at a later time. I am afraid this will be not for me. :-/ houghi -- Theologians can pursuade themselves of anything. Anyone who can worship a trinity and insists that his religion is a monotheism can believe anything -- just give him time to rationalize it. Robert A. Heinlein, JOB: A Comedy of Justice ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error on the bash command line
On 04/16/2011 04:36 AM, houghi wrote: On Wed, Apr 06, 2011 at 06:15:52PM -0700, Patrick Horgan wrote: The command and output is: houghi@penne : gimp --verbose --batch-interpreter plug-in-script-fu-eval -i -b "(script-fu-fuzzy-border \"file.jpg\" '(0 0 0) 50 0 16 FALSE 1 FALSE)" -b '(gimp-quit 0)' This command: gimp -i -c -d -b '(batch_fuzzy_border "./alyssa01.jpg" "pink" 40 TRUE 10 TRUE 50) ' -b '(gimp-quit 0)' just worked for me with the attached versions of batchfuzzy.scm and fuzzyborder.scm using GNU Image Manipulation Program version 2.7.2. I made some changes here and there to fix errors in the scripts and to get rid of calling deprecated methods. This may make it not work on earlier versions. YMMV. I'm sorry that no one bothered to look at the problem and led you on wild goose chases. This group is usually more helpful than that. I should add that if it doesn't work on your version, you can ask and I'll get it working on whatever version you have. You might have fun browsing the procedures yourself in the script-fu console. If you need help figuring that out, let me know. Where I put ./alyssa01.jpg you could also put "./*.jpg" if you would rather batch process a lot of files at once with the same arguments. I have the fuzzyborder working, but unfortunatly only by copy and pasting. I have looked at the code and have absolutely no idea on how to get it working for slide.scm or drop-shadow.scm houghi, I assume from your previous emails that you understand fuzzyborder and its arguments. Unfortunately, it's written to work with an image in gimp, not a file on the harddisk. So batchfuzzy.scm was written to bridge the gap. What it does, is to accept all the arguments that you want to pass on to fuzzyborder and additionally, the list of files that you want to apply them to. Then, one by one, it loads the files into gimp, applies fuzzy-border to them, and then saves the result back out under the original filename. Below is the script that does this, and below it I'll go line by line and explain how it does what it does. If you get lost in the line by line description below, feel free to refer back up to here so you can see the whole thing. (define (batch_fuzzy_border pattern color size blurt gran shadowt shadowp) (let* ((filelist (cadr (file-glob pattern 1 (while (not (null? filelist)) (let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable (car (gimp-image-get-active-layer image))) ) (script-fu-fuzzy-border image drawable color size blurt gran shadowt shadowp FALSE TRUE) (set! drawable (car (gimp-image-get-active-layer image))) (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image) ) (set! filelist (cdr filelist)) ) ) ) We are making a procedure. The syntax for making a procedure this way is: (define (name formal_parameters) body) You see below, that the name of our procedure is batch_fuzzy_border, and the formal_parameters are pattern, color, size, blurt, gran, shadowt, and shadowp then a right parenthesis closes the formal parameters, and everything up to the last ) is the body of the procedure. (define (batch_fuzzy_border pattern color size blurt gran shadowt shadowp) Remember that we called gimp like this: gimp -i -c -d -b '(batch_fuzzy_border "./alyssa01.jpg" "pink" 40 TRUE 10 TRUE 50) ' -b '(gimp-quit 0)' Look at the part that calls batch_fuzzy_border: (batch_fuzzy_border "./alyssa01.jpg" "pink" 40 TRUE 10 TRUE 50) You can see that each of the arguments matches up with something from the formal parameter list. pattern will be set to "./alyssa01.jpg" color will be set to "pink" size is set to 40 blurt is set to TRUE gran is set to 10 shadowt is set to TRUE shadowp is set to 50 You always have to make sure that the arguments you pass to a procedure match what the procedure is expecting. Ok, now we're in the body of the procedure batch_fuzzy_border. The first thing we're going to do is to make local variables that are only visible within a certain area. The syntax for doing this is (let* ((var1 exp1) (var2 exp2) . . . (varn expn)) body) Each of the variables is set to the value of its _expression_, var1=expr1, etc, and then these are visible inside the body portion of the let. In this case, there's only one variable, filelist, defined, and it's visible for the rest of the procedure--well,
Re: [Gimp-user] Error on the bash command line
On Tue, Apr 19, 2011 at 02:00:11AM -0700, Patrick Horgan wrote: I assume from your previous emails that you understand fuzzyborder and its arguments. I do. At least I understand the arguments Unfortunately, it's written to work with an image in gimp, not a file on the harddisk. OK. Suddenly things are much more logical. snip a whole lot If you have other scripts you want to run that expect and image or layer, you will have to write a wrapper script similar to this one. Any differences will come from the arguments that the script expects. You'll have to accept all the arguments that the user will specify, along with a filename or fileglob, open the file, and then pass all the right arguments from the wrapper to the script you want to call. If you get stuck, just tell me another script you want to wrap like this and I'll write a little tutorial. OK. Thanks. Due to being busy (great weather in Belgium, so a beer is in order) I will be looking at all of this in more detail at a later date. It is a pity that documentation about this is pretty hard to find (at least I was not able to find it) and should have a more promenet place in the GIMP documentation, but then that is just my opinion. I can understand if I am only one of the few who wants to processing many images at the same time AND is basically a script kiddie. I will see how far I get to do the same, with the explanation above, for slide.scm and drop-shadow.scm and will post both failure and success here most likely next week. If you have more questions, please ask. I don't know what you don't understand if you don't ask:) I am very well aware of that. It is also hard to ask when you don't understand what you are asking. ;-) I hate questions like It doesn't work! and I hate myself for coming across like that. Already I owe you a beer (or something else if you do not want beer) for the efford you have put into this. houghi -- Knock-knock. Who's there? Under the Patriot Act, we don't have to tell you that. ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error on the bash command line
On Wed, Apr 06, 2011 at 06:15:52PM -0700, Patrick Horgan wrote: The command and output is: houghi@penne : gimp --verbose --batch-interpreter plug-in-script-fu-eval -i -b (script-fu-fuzzy-border \file.jpg\ '(0 0 0) 50 0 16 FALSE 1 FALSE) -b '(gimp-quit 0)' This command: gimp -i -c -d -b '(batch_fuzzy_border ./alyssa01.jpg pink 40 TRUE 10 TRUE 50) ' -b '(gimp-quit 0)' just worked for me with the attached versions of batchfuzzy.scm and fuzzyborder.scm using GNU Image Manipulation Program version 2.7.2. I made some changes here and there to fix errors in the scripts and to get rid of calling deprecated methods. This may make it not work on earlier versions. YMMV. I'm sorry that no one bothered to look at the problem and led you on wild goose chases. This group is usually more helpful than that. I should add that if it doesn't work on your version, you can ask and I'll get it working on whatever version you have. You might have fun browsing the procedures yourself in the script-fu console. If you need help figuring that out, let me know. Where I put ./alyssa01.jpg you could also put ./*.jpg if you would rather batch process a lot of files at once with the same arguments. I have the fuzzyborder working, but unfortunatly only by copy and pasting. I have looked at the code and have absolutely no idea on how to get it working for slide.scm or drop-shadow.scm I understand that I need to write some sort of batch or something else to use them, but all I do is stare at a lot of code and have no idea on how to commence, regardless of the many websites I read. http://www.gimp.org/docs/scheme_plugin/ is just one of them. Or do I understand wrongly and there is a (secret) way to directly adress the scm files from the command line? houghi -- This is written under the inluence of the following: Artist : Mercedes Sosa Song : Doña Ubensa Album : Como un pájaro libre ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error on the bash command line
On 04/06/2011 10:51 PM, houghi wrote: On Wed, Apr 06, 2011 at 06:15:52PM -0700, Patrick Horgan wrote: gimp -i -c -d -b '(batch_fuzzy_border "./alyssa01.jpg" "pink" 40 TRUE 10 TRUE 50) ' -b '(gimp-quit 0)' just worked for me with the attached versions of batchfuzzy.scm and fuzzyborder.scm using GNU Image Manipulation Program version 2.7.2. Just tried it and it works in 2.6.11 as well. I made some changes here and there to fix errors in the scripts and to get rid of calling deprecated methods. As these were scripts that were provided by my distro, I assume they are somewhat 'standard' for GIMP. To know there are errors in it, is perhaps more importand to solve then me getting errors. Perhaps a good time to overhaul all the ones that come standard with GIMP. As it was coming with GIMP the last thing I was thinking about was problems with the script. Yeah, batchfuzzy.scm does NOT come with gimp but fuzzyborder.scm does, and it has two places where inImage should be theImage (lines 90 and 99), and the line: (gimp-selection-layer-alpha theLayer) should be: (gimp-image-select-item theImage CHANNEL-OP-REPLACE theLayer) to get rid of a deprecated function warning. Other than that it's fine. Patrick ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error on the bash command line
On Thu, Apr 07, 2011 at 12:31:44AM -0700, Patrick Horgan wrote: I opened a bug and attached a patch to fix the minor problems in fuzzyborder.scm. https://bugzilla.gnome.org/show_bug.cgi?id=646993 Thanks. houghi -- This is written under the influence of tv channel Vijf TV (as there was nothing else on). I am now watching : The Nanny ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Error on the bash command line
On Wed, Apr 06, 2011 at 06:15:52PM -0700, Patrick Horgan wrote: gimp -i -c -d -b '(batch_fuzzy_border ./alyssa01.jpg pink 40 TRUE 10 TRUE 50) ' -b '(gimp-quit 0)' just worked for me with the attached versions of batchfuzzy.scm and fuzzyborder.scm using GNU Image Manipulation Program version 2.7.2. Just tried it and it works in 2.6.11 as well. I made some changes here and there to fix errors in the scripts and to get rid of calling deprecated methods. As these were scripts that were provided by my distro, I assume they are somewhat 'standard' for GIMP. To know there are errors in it, is perhaps more importand to solve then me getting errors. Perhaps a good time to overhaul all the ones that come standard with GIMP. As it was coming with GIMP the last thing I was thinking about was problems with the script. This may make it not work on earlier versions. YMMV. I'm sorry that no one bothered to look at the problem and led you on wild goose chases. This group is usually more helpful than that. And I also should have looked at the group where I posted it as well. Will get the solution to there as well. I should add that if it doesn't work on your version, you can ask and I'll get it working on whatever version you have. You might have fun browsing the procedures yourself in the script-fu console. If you need help figuring that out, let me know. Where I put ./alyssa01.jpg you could also put ./*.jpg if you would rather batch process a lot of files at once with the same arguments. As I now have a starting point, I can start looking for solutions and also see what I can do to get others working. Ones I have tried and had problems with are batch-slide and batch-drop-shadow, but there will be others as well. For the next two weeks I won't have much time, so it could take a while before I can give feedback about this. houghi -- Listen do you hear them drawing near in their search for the sinners? Feeding on the power of our fear and the evil within us. Incarnation of Satan's creation of all that we dread. When the demons arrive those alive would be better off dead! ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
[Gimp-user] Error on the bash command line
Hello, I am running openSUSE 11.4, GIMP 2.6.11 and bash 4.1.10 On my openSUSE 11.3 the following worked: gimp -i -b --verbose '(batch-slide file.jpg FileName 23)' -b '(gimp-quit 0)' Now I get the following error: GIMP-Error: Opening '/home/houghi/tmp/gimp/test/(batch-slide file.jpg FileName 23)' failed: No such file or directory I have this also with other things, like `gimp -i -b --verbose \ (batch_fuzzy_border \$FILE\ '$COLOR 30 FALSE 4.5 TRUE 75 ) -b \ (gimp-quit 0)` Clearly it sees the whole as a file, instead of precessing it. Adding --batch-interpreter plug-in-script-fu-eval to it does not change anything. All are standard things already included in GIMP, so no self made script-fu things where I could have made a mistake. My question is: what am I doing wrong? houghi -- This is written under the inluence of the following: Artist : Bruce Springsteen Song : Jungleland Album : Born to run ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user