It is currently Fri Mar 29, 2024 7:43 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: saving an animation as .gif in a script
PostPosted: Mon Aug 31, 2015 5:02 am  (#1) 
Online
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14803
Location: roma, italy
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Basic Level



Hi,
I'm creating (for the first time) an animation using a script.
When at the end I wanted to save the result as a .gif file (starting from the .xcf file on the display) i got a message saying that I cannot create a .gif starting from an RGB image because only indexed and grey input file are accepted.
In fact, entering in the script first a conversion of my .xcf file from RGB to Indexed then the save as .gif I got the .gif output without any problem.
Is it as such or is there a possibility to save (export) the .xcf file into a .gif file without passing thru the intermediate conversion from RGB to Indexed?
Does the export as .gif available online perform internally a similar conversion before creating the .gif?
Thanks

_________________
"Where am I ?"


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: saving an animation as .gif in a script
PostPosted: Mon Aug 31, 2015 6:31 am  (#2) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
dinasset wrote:
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Basic Level



Hi,
I'm creating (for the first time) an animation using a script.
When at the end I wanted to save the result as a .gif file (starting from the .xcf file on the display) i got a message saying that I cannot create a .gif starting from an RGB image because only indexed and grey input file are accepted.
In fact, entering in the script first a conversion of my .xcf file from RGB to Indexed then the save as .gif I got the .gif output without any problem.
Is it as such or is there a possibility to save (export) the .xcf file into a .gif file without passing thru the intermediate conversion from RGB to Indexed?
Does the export as .gif available online perform internally a similar conversion before creating the .gif?
Thanks

I not think that you will be able to convert an XCF file into a GIF file online, because I believe that any online conversion tool will not recognize XCF files.

Did you check that the Image Mode was set to Indexed before exporting as a GIF file?

By the way, what is the script that you're using to create an animated GIF image with?

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: saving an animation as .gif in a script
PostPosted: Mon Aug 31, 2015 8:58 am  (#3) 
Online
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14803
Location: roma, italy
when you have on the display an .xcf image ready to create a .gif, online you have simply to ask for:
file, export as -> .gif
this happens in one step, maybe inside it performs two steps, first conversion to indexed then .gif

when writing a script you do not have (or at least I didn't find) a pdb function to export as .gif, only a save function as .gif, but this requires in input an indexed or gray image, not an RGB
thus I had to enter two functions: 1-convert to indexed 2-save as .gif

(I'm not examining an existing script, I'm writing it)

_________________
"Where am I ?"


Top
 Post subject: Re: saving an animation as .gif in a script
PostPosted: Mon Aug 31, 2015 9:29 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Aug 13, 2015
Posts: 312
Location: Somewhere between lost and found.
The gif file format specification REQUIRES that the image be indexed. There is no way around this. Gifs are limited to a 256 color palette I believe.

The script/pdb command you will need is file-gif-save, but I've never used it.

_________________
The answer was 42. The question is long forgotten. The computer that solved it is now destroyed.
The MK-2 has been built. Should this be the next question?
(Solve if you can ... ;) )
Image


Top
 Post subject: Re: saving an animation as .gif in a script
PostPosted: Mon Aug 31, 2015 10:18 am  (#5) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
See next post...

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Mon Aug 31, 2015 4:32 pm, edited 1 time in total.

Top
 Post subject: Re: saving an animation as .gif in a script
PostPosted: Mon Aug 31, 2015 10:21 am  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
The PDB procedure 'file-gif-save' will save your image as an animation if the image has more than one layer. If your image is in RGB mode then you must first convert it to Indexed (or Grayscale). (You will not be able to convert to Indexed if your image contains Layer Groups.)

If you have a multi-layer image which you do NOT want to save as an animation, you must first merge the layers into a single layer. Merging should typically be done before converting the image to Indexed (to preserve anti-aliasing).

If you need to keep your original, multi-layer, RGB image in its orignal state, then create a duplicate of the image and perform your mode conversions and merging on the duplicate as necessary.

When run interactively (from either a script or with menu invocation), 'file-gif-save' will automatically perform any necessary conversion and merging before saving (without modifying your original image).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: saving an animation as .gif in a script
PostPosted: Mon Aug 31, 2015 1:41 pm  (#7) 
Online
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14803
Location: roma, italy
thanks Saulgoode, a confirmation of what I supposed
as with other functions, the pdb call has differences (limitations?) with the online call, but no problems, just a surprise the first time it is used/tried

_________________
"Where am I ?"


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Script for selecting, cropping the selection and saving the file

8

No new posts palette not saving

0

No new posts Attachment(s) LED Animation from Animation Plug-in

6

No new posts Attachment(s) Bimp - Not saving Jpegs

2

No new posts default setting for compressed saving xcf

0



* Login  



Powered by phpBB3 © phpBB Group