RSS/Atom feed Twitter
Site is read-only, email is disabled

Script-Fu - Batch Mode Problem

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

7 of 7 messages available
Toggle history

Please log in to manage your subscriptions.

Script-Fu - Batch Mode Problem matt@solinus.com 19 Dec 20:35
  Script-Fu - Batch Mode Problem Carol Spears 19 Dec 21:14
  Script-Fu - Batch Mode Problem Marc) (A.) (Lehmann 20 Dec 05:26
Script-Fu - Batch Mode Problem matt@solinus.com 19 Dec 22:45
Script-Fu - Batch Mode Problem matt@solinus.com 26 Dec 20:04
  Script-Fu - Batch Mode Problem Marc) (A.) (Lehmann 27 Dec 01:56
Script-Fu - Batch Mode Problem matt@solinus.com 30 Dec 16:35
matt@solinus.com
2002-12-19 20:35:36 UTC (over 21 years ago)

Script-Fu - Batch Mode Problem

Hello,

I am having an issue with a Script that I have written being called from the command line.

Here is what I am trying to do. I have written a script using Scheme that runs great when I have Gimp loaded up (ie not from the command line). No problems, does everything that I want. The real point of the script is to automate some image resizing from the command line. I know that many of you out there are going to point out that ImageMagick will do what I am looking for. I have already gone down that path and the image quality of the scaled images is not up to the quality that client wants. However, I can make a better, smaller image using Gimp....now I just need to make it completely automated.

here is the rub.....

I have the script streamlined down and everything is set to be non-interactive. So i should just be able to pass in the variables and away we go.... My thinking is obviously flawed here as it doesn't quite work.

here is how I am calling the script:....

gimp -b '(script-fu-automated-resize 1 "200" "200" "/export/home/matt/toprocess/Imagein.jpg" "/export/home/matt/toprocess/Imageout.jpg")' '(gimp-quit 0)'

The script takes in a height, width, beginning image and output image. I pass it a 1 before all of that for non-interactive. The script is designed to open the beginning image, resize accordingly, and then save to the output image.

I get the following response..... batch command: executed successfully.

One would think that I should be able to check my system and I should see the end image....nope....nada...nothing. If I change the option of 1 to 0 to run in interactive mode...I get the prompt for the default values of the script. Height, Width, Image to process....final image. If I enter those in, click the ok button....it runs like a champ. What am I missing? I have the non-interactive bit set on the file open which I assume is what is causing this dialog to pop up.

Any ideas? tips? Pointer? References? Anyone already have a thumbnail script that works in this way that can shed some light on the subject?

Matt Patterson matt@solinus.com

Carol Spears
2002-12-19 21:14:42 UTC (over 21 years ago)

Script-Fu - Batch Mode Problem

hi

lord knows, i don't know the answer to that directly, but it might be here:
http://adrian.gimp.org/batch/batch.html

carol

On 2002-12-19 at 1935.36 -0000, matt@solinus.com typed this:

Hello,

I am having an issue with a Script that I have written being called from the command line.

Here is what I am trying to do. I have written a script using Scheme that runs great when I have Gimp loaded up (ie not from the command line). No problems, does everything that I want. The real point of the script is to automate some image resizing from the command line. I know that many of you out there are going to point out that ImageMagick will do what I am looking for. I have already gone down that path and the image quality of the scaled images is not up to the quality that client wants. However, I can make a better, smaller image using Gimp....now I just need to make it completely automated.

here is the rub.....

I have the script streamlined down and everything is set to be non-interactive. So i should just be able to pass in the variables and away we go.... My thinking is obviously flawed here as it doesn't quite work.

here is how I am calling the script:....

gimp -b '(script-fu-automated-resize 1 "200" "200" "/export/home/matt/toprocess/Imagein.jpg" "/export/home/matt/toprocess/Imageout.jpg")' '(gimp-quit 0)'

The script takes in a height, width, beginning image and output image. I pass it a 1 before all of that for non-interactive. The script is designed to open the beginning image, resize accordingly, and then save to the output image.

I get the following response..... batch command: executed successfully.

One would think that I should be able to check my system and I should see the end image....nope....nada...nothing. If I change the option of 1 to 0 to run in interactive mode...I get the prompt for the default values of the script. Height, Width, Image to process....final image. If I enter those in, click the ok button....it runs like a champ. What am I missing? I have the non-interactive bit set on the file open which I assume is what is causing this dialog to pop up.

Any ideas? tips? Pointer? References? Anyone already have a thumbnail script that works in this way that can shed some light on the subject?

Matt Patterson matt@solinus.com

matt@solinus.com
2002-12-19 22:45:06 UTC (over 21 years ago)

Script-Fu - Batch Mode Problem

Yeah...I have read that already and have gotten a ton of great tips on how to make things work....but I am still having the problem after all that is said and done. It appears that the script doesn't want to accept the parameters that I am passing in properly.

This has been frustrating me for several days now so I am open to any suggestions.

Matt Patterson
matt@solinus.com

On Wed, 18 Dec 2002 20:05:26 -0000 (GMT), Carol Spears wrote:

hi

lord knows, i don't know the answer to that directly, but it might be here:
http://adrian.gimp.org/batch/batch.html

carol

On 2002-12-19 at 1935.36 -0000, matt@solinus.com typed this:

Hello,

I am having an issue with a Script that I have written being called from

the

command line.

Here is what I am trying to do. I have written a script using Scheme that

runs

great when I have Gimp loaded up (ie not from the command line). No

problems,

does everything that I want. The real point of the script is to automate

some

image resizing from the command line. I know that many of you out there

are

going to point out that ImageMagick will do what I am looking for. I have already gone down that path and the image quality of the scaled images is

not up

to the quality that client wants. However, I can make a better, smaller

image

using Gimp....now I just need to make it completely automated.

here is the rub.....

I have the script streamlined down and everything is set to be non-interactive. So i should just be able to pass in the variables and

away we

go.... My thinking is obviously flawed here as it doesn't quite work.

here is how I am calling the script:....

gimp -b '(script-fu-automated-resize 1 "200" "200" "/export/home/matt/toprocess/Imagein.jpg" "/export/home/matt/toprocess/Imageout.jpg")' '(gimp-quit 0)'

The script takes in a height, width, beginning image and output image. I

pass

it a 1 before all of that for non-interactive. The script is designed to

open

the beginning image, resize accordingly, and then save to the output image.

I get the following response..... batch command: executed successfully.

One would think that I should be able to check my system and I should see

the

end image....nope....nada...nothing. If I change the option of 1 to 0 to

run in

interactive mode...I get the prompt for the default values of the script. Height, Width, Image to process....final image. If I enter those in, click

the

ok button....it runs like a champ. What am I missing? I have the non-interactive bit set on the file open which I assume is what is causing

this

dialog to pop up.

Any ideas? tips? Pointer? References? Anyone already have a thumbnail

script

that works in this way that can shed some light on the subject?

Matt Patterson matt@solinus.com

Marc) (A.) (Lehmann
2002-12-20 05:26:54 UTC (over 21 years ago)

Script-Fu - Batch Mode Problem

On Thu, Dec 19, 2002 at 07:35:36PM -0000, matt@solinus.com wrote:

image resizing from the command line. I know that many of you out there are going to point out that ImageMagick will do what I am looking for. I have already gone down that path and the image quality of the scaled images is not up

Then you probably have done sth. wrong, as ImageMagick's algorithms are way superior (and way slower ;) to the mere cubic interpolation gimp uses.

Are you sure you tried sth. like:

convert sourcefile -filter mitchell -geometry destfile

also, other filters than the mitchell filter (which is usually best) are also worth a try, "cubic" for example should rather closely match gimp's quality.

The script takes in a height, width, beginning image and output image. I pass it a 1 before all of that for non-interactive. The script is designed to open

Well, I am no scirpt-fu expert, but I get a lot of mail that tells me that scirpt-fu simply doesn't work noninteractively, or at leats not correctly, or returns too earfly etc.. etc..

matt@solinus.com
2002-12-26 20:04:42 UTC (over 21 years ago)

Script-Fu - Batch Mode Problem

On Thu, 19 Dec 2002 04:32:07 -0000 (GMT), wrote:

On Thu, Dec 19, 2002 at 07:35:36PM -0000, matt@solinus.com wrote:

image resizing from the command line. I know that many of you out there

are

going to point out that ImageMagick will do what I am looking for. I have already gone down that path and the image quality of the scaled images is

not up

Then you probably have done sth. wrong, as ImageMagick's algorithms are way superior (and way slower ;) to the mere cubic interpolation gimp uses.

Are you sure you tried sth. like:

convert sourcefile -filter mitchell -geometry destfile

ok, I tried this....and I got an image that was not up to par with what can be done with Adobe's Image ready doing a similiar process. However, with Gimp, I can produce an image that is better and smaller than what Image Ready and ImageMagick can do. The mitchell filter was better than the cubic filter by far...but they were still pixelated when you started to look at the images closely. I personally think the images are good enough for the web....however, the client that I am working for is accustom to having an image of a very high quality.

also, other filters than the mitchell filter (which is usually best) are also worth a try, "cubic" for example should rather closely match gimp's quality.

Well, I am no scirpt-fu expert, but I get a lot of mail that tells me that scirpt-fu simply doesn't work noninteractively, or at leats not correctly, or returns too earfly etc.. etc..

Ok, if script-fu is not meant to be run from the command line without interaction....then why the batch mode option?

from the gimp man pages.... -b, --batch
Execute the set of non-interactively. The set of is typically in the form of a script that can be executed by one of the Gimp scripting extensions.

Based on the documentation I have seen, I should be able to call a script-fu function and everything should work. That is not the case.

Attached is a cut down version of the script that I am attempting to call. I am calling this script from the command line as follows......

gimp -b '(script-fu-test-script 1 "200" "200" "/export/home/matt/toprocess/W-49M01_ven.jpg" "/export/home/matt/toprocess/W-49M01_ven_n.jpg")'

When this is run...I get back batch command: executed successfully.

However, there is no outputted image to be found. If I change the 1 to 0 to run interactivly, it pops up the prompt for me to enter in the values needed for the script and runs successfully. Is there any way of outputting what has been passed into a script?

Thoughts? Comments?

Matt Patterson matt@solinus.com

Marc) (A.) (Lehmann
2002-12-27 01:56:34 UTC (over 21 years ago)

Script-Fu - Batch Mode Problem

On Thu, Dec 26, 2002 at 07:04:42PM -0000, matt@solinus.com wrote:

convert sourcefile -filter mitchell -geometry destfile

ok, I tried this....and I got an image that was not up to par with what can be done with Adobe's Image ready doing a similiar process. However, with Gimp, I

Well, there are also other filters. Quadratic or Cubic should closely emulate gimp's behaviour. But from the script I see that you are using jpegs. I hope you are aware of the fact that jpegs can and do introduce lots of pixel errors?

Ok, if script-fu is not meant to be run from the command line without interaction....then why the batch mode option?

To run script-fu from the commandline. The fact that script-fu is broken in lots of areas _currently_ does not mean it was designed to be broken ;) OTOH, Simon Budig always explains to me that script-fu was not designed for this kind of thing, and he knows a lot more about it.

Based on the documentation I have seen, I should be able to call a script-fu function and everything should work. That is not the case.

The script will (hopefully) enable some script-fu expert (not me) to find the problem. Or maybe fix script-fu, if it really is the problem.

matt@solinus.com
2002-12-30 16:35:32 UTC (over 21 years ago)

Script-Fu - Batch Mode Problem

"Quality" is pretty subjective. After reading your messages, I resized some images with ImageMagick and the Gimp and I found an interesting thing: When I looked at the resized images without zooming, the ImageMagick-resized images looked sharper, clearer and showed finer detail than the Gimp-resized images, which looked softer and smoother (not really blurred, but definitely less detailed). Zoomed in, however, the Gimp images looked much better. It appears that the ImageMagick algorithm introduced a little pixelization that looks bad up close, but not only looks fine at 100%, but even produces some "hints" of lines that my eye interprets as fine details. The images I was playing with were of people, and the most obvious differences were visible in lines in hair, particularly bangs.

Also, you may want to make sure that you were using the same quality settings for the JPEG encoding in your tests. Both Gimp and ImageMagick default to a quality setting of 75, I believe, but if you were saving your Gimp-resized images with a higher quality setting, that would create a false advantage.

You can use "-quality nn" with ImageMagick, where "nn" is the quality setting you want to use.

--
Shawn

I definately agree that quality is subjective. I personally think that the images that I was producing with ImageMagick with good enough for the web. However, the client that i am doing all this for....does not agree. The quality that they had been getting with another product was better than the ImageMagick Images but not as good as the Gimp images. However, it is a manually process that they want automated.

I have tried using the --quality flag with the imagemagick implementation. However, It was still not up to the clients standards and the gimp image was still a cleaner image. Basically, Imagemagick is not an option for us. Getting this script working from the command line is our best solution at this time.

Thanks for the information.

--Matt