scripts newby
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.
scripts newby | imr | 28 Aug 18:32 |
scripts newby | Jeff Trefftzs | 29 Aug 05:11 |
scripts newby | imr | 01 Sep 15:31 |
scripts newby | Sven Neumann | 29 Aug 14:00 |
scripts newby | imr | 01 Sep 15:11 |
scripts newby | Jonathan Bartlett | 29 Aug 17:01 |
scripts newby
Hi,
I have a couple of question regarding scripts.
If you know of a good site for beginners in gimp scripting, dont hesitate to
tell me. I have been to a few of them but didnt find answers for that kind of
questions.
First, how can i close the image window i was working on during the script,
once i have saved it.
i found image_delete and display_delete fonctions, but the image_delete wont
work as long as there is a display opened, so how do I get the display?
Second and last, I have tried to save a picture as jpg with gimp_file_save non interractively. The image was saved with 0 quality, is there a way to set the jpg settings without using file_jpeg_save and without interractivity?
thx
scripts newby
On Thu, 2003-08-28 at 09:32, imr wrote:
Hi,
I have a couple of question regarding scripts. If you know of a good site for beginners in gimp scripting, dont hesitate to tell me. I have been to a few of them but didnt find answers for that kind of questions.First, how can i close the image window i was working on during the script, once i have saved it.
i found image_delete and display_delete fonctions, but the image_delete wont work as long as there is a display opened, so how do I get the display?
It's not clear why you would want to do this in the first place. If you're using the script to do something on an image you opened using the Gimp GUI, then you can just close it yourself, since you are interacting with the image anyway. If you are trying to run the script non-interactively, then you can go ahead and use gimp_display_delete to get rid of it after the script completes. (At least I think so. I've never written a script to run in batch mode).
Second and last, I have tried to save a picture as jpg with gimp_file_save non interractively. The image was saved with 0 quality, is there a way to set the jpg settings without using file_jpeg_save and without interractivity?
Why do you want to avoid file_jpeg_save? That is *the* function to use to save a jpeg image, and it allows you to set the quality at anything you desire.
Can you give us more background about what you are trying to do and why you are trying to do it? Possibly I'm misunderstanding your goals.
scripts newby
Hi,
imr writes:
First, how can i close the image window i was working on during the script, once i have saved it. i found image_delete and display_delete fonctions, but the image_delete wont work as long as there is a display opened, so how do I get the display?
Your script can only delete a display it created itself. When it creates a display using gimp-display-new it is returned a display ID. This ID can be used later to remove the display again using gimp-display-delete.
Second and last, I have tried to save a picture as jpg with gimp_file_save non interractively. The image was saved with 0 quality, is there a way to set the jpg settings without using file_jpeg_save and without interractivity?
It should have been saved with the default JPEG settings. IIRC, the default quality used to be 0.75 and was lately changed to 0.85. Are you sure that 0 was used? Which version of GIMP did you use?
Sven
scripts newby
Second and last, I have tried to save a picture as jpg with gimp_file_save non interractively. The image was saved with 0 quality, is there a way to set the jpg settings without using file_jpeg_save and without interractivity?
Why do you need to do this? What's wrong with file_jpeg_save?
Jon
thx
scripts newby
On Friday 29 August 2003 14:00, you wrote:
Hi,
Hi, and sorry for the delay in the answer
imr writes:
First, how can i close the image window i was working on during the script, once i have saved it. i found image_delete and display_delete fonctions, but the image_delete wont work as long as there is a display opened, so how do I get the display?
Your script can only delete a display it created itself. When it creates a display using gimp-display-new it is returned a display ID. This ID can be used later to remove the display again using gimp-display-delete.
well, i'm glad i didnt answer you too early, because i would have made us lose
some more time.
Reading my script and trying to figure out what I did wrong or what i didnt
understand, i must have skipped like one 100 times the nice simple line with
the open_display i just saw right now after a nice w-e.
So, yes, it works like it should, and yes, i kick me butt.
:(
Second and last, I have tried to save a picture as jpg with gimp_file_save non interractively. The image was saved with 0 quality, is there a way to set the jpg settings without using file_jpeg_save and without interractivity?
It should have been saved with the default JPEG settings. IIRC, the default quality used to be 0.75 and was lately changed to 0.85. Are you sure that 0 was used? Which version of GIMP did you use?
1.2.3 from mandrake
Since what happens in the above, i'm going to check in what order and how i do
this.
The script load an image, load an other one, copy it, create a layer in the
first image, paste into the layer, translate the layer, anchor it, display
the image, flatten it, save the resulting drawable with gimp_file_save and
delete whats left. It works nicely with png.
Sven
thx a lot,
rémi
scripts newby
On Friday 29 August 2003 05:11, Jeff Trefftzs wrote:
On Thu, 2003-08-28 at 09:32, imr wrote:
Hi,
Why do you want to avoid file_jpeg_save? That is *the* function to use to save a jpeg image, and it allows you to set the quality at anything you desire.
Can you give us more background about what you are trying to do and why you are trying to do it? Possibly I'm misunderstanding your goals.
i need to open, combine and save images of different types with this script.
i need to use it non interractively.
I figured that using file_gimp_load and file_gimp_save to do it might save me
the pain to do file type detection, at least in the beginning.
In the long run, i will do a front end script for it, to add interraction.
I'm also using this script as a way of learning gimp scripts and python. But i
also really need it for a video editing effect i could not find in any tool i
tried.
cheers,
rémi