It is currently 08 Mar 2021, 06:00

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | 🡆 Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Python fu to convert webp to gif?

GIMP or GIMP LEARN forum related Questions
Rendu
Newly Registered

Python fu to convert webp to gif?

Post#1 by Rendu » 21 Feb 2021, 16:11


New to both GIMP and Python, so I apologize if I have overlooked something obvious, but I have bashed and flailed at this for too long. I can use GIMP to convert webp to gif easily enough, but I cannot figure out how to automate the process. I have tried to decipher the descriptions in the procedure browser, but I think they assume more background with Python than I have. In particular, I am trying to puzzle out "file_gif_save2".
I keep getting "wrong number of parameters" errors, no matter whether I identify each parameter individually, just list them, or duplicate ones that seem redundant. Actually, if anyone even has a resource for Python-fu that actually *explains* things, that would be a huge help. Lots of googling has turned up nothing useful.
GIMP Learn rocks...

gibletsWithShaman
Forum Member

Post#2 by gibletsWithShaman » 22 Feb 2021, 01:44


I you put your code up in a attachment, then it is possible to fix it. Also, GimpForum has some excellent coders that can help if you put up a post there.

Charles
Everyday is a new experience with GIMP.

tim
GL Blogger

Post#3 by tim » 22 Feb 2021, 13:29


The first parameter (run-mode) isn't used so maybe you're passing in something for that parameter so it's error-ing on that param.
I tried it with the below code

Code: Select all

pdb.file_gif_save2(image,layer,'/home/tim/Desktop/test.gif','/home/tim/Desktop/test.gif',FALSE,FALSE,0,0,FALSE,FALSE,FALSE)
and got the "Operation not supported" error as it is reported as bug here
trying file_gif_save works

Code: Select all

pdb.file_gif_save(image,layer,'/home/tim/Desktop/test.gif','/home/tim/Desktop/test.gif',FALSE,FALSE,0,0)
You'll also need to convert you image into indexed or grayscale mode first before trying exporting as .gif.
Hope that helps
Note:
A lot of times (if not all the time) the run-mode parameter isn't used in stored-procedures, and passing in a value will give the wrong number of parameters error.
aka Tin

         

Rendu
Newly Registered

Post#4 by Rendu » 23 Feb 2021, 01:56


Wow! Thanks for the quick responses. This is very useful information- now I have to go home and see if I can make use of it. The bit about run-mode not being used as a parameter is probably causing the specific "wrong number' issue. Also good to know about the conversion thing- I did include that, but wasn't sure if it was really necessary. Since I am working with a mix of B&W and color images, can they both be indexed, or do I need to separate B&W to covert to grey-scale?

Thanks again- I really appreciate the help!
GIMP Learn rocks...

tim
GL Blogger

Post#5 by tim » 24 Feb 2021, 12:23


When you convert image to indexed all layers get indexed mode...so just indexed should be fine.
aka Tin

         


GIMP/GL:  Tutorials | Tips | 🡆 Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 8 guests