tv_savemode gif options not working

A forum dedicated to George scripting questions
Post Reply
User avatar
NathanOtano
Posts: 1209
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

tv_savemode gif options not working

Post by NathanOtano »

Hey :) I'm trying to use the command

Code: Select all

tv_savemode "gif" "local" "nodither" "32"
Problem is that even if I specify a savemode in my script, it does'nt export following my parameters. I indeed get a gif, but I can't change the "local" "dither" and "number of colors" unless i first do an export by hand
Is this a bug or am I doing it wrong?
Best,
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: tv_savemode gif options not working

Post by Svengali »

My GIF save script includes a tv_AlphaSaveMode NOPREMULTIPLY. Do you designate an AlphaSaveMode?

At the same time, I don't think I've ever been able to designate alternative explicit SaveMode parameters... My current script always uses tv_SaveMode GIF B24 MAT.

sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Hironori Takagi
Posts: 313
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: tv_savemode gif options not working

Post by Hironori Takagi »

In the case I experienced before:

tv_SaveMode "(something)"
tv_SaveMode

I have solved it with the above description.
The reason is unknown.
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
NathanOtano
Posts: 1209
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: tv_savemode gif options not working

Post by NathanOtano »

I tried setting the alphamode but it didn't change much of my problem, the setting was already in nopremultiply anyway. But i'll give it another shot!
I'll try your suggestion Hirinori to see if it updates correctly! Will keep you posted
Best,
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
User avatar
NathanOtano
Posts: 1209
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: tv_savemode gif options not working

Post by NathanOtano »

I tried both solutions above and, even if my seconde "tv_savemode" returns the right settings, my gif is still exported the same way no matter how I set the first tv_savemode. It seems it has no influence on my export whatsoever, it's with the same color and size
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: tv_savemode gif options not working

Post by Xavier »

NathanOtano wrote: 07 Sep 2021, 17:35 Hey :) I'm trying to use the command

Code: Select all

tv_savemode "gif" "local" "nodither" "32"
Problem is that even if I specify a savemode in my script, it does'nt export following my parameters. I indeed get a gif, but I can't change the "local" "dither" and "number of colors" unless i first do an export by hand
Is this a bug or am I doing it wrong?
Best,
Hi, if it's a bug then it's been here for a while :shock:
I would need to run the command using the debugger to check if it works properly.
User avatar
Hironori Takagi
Posts: 313
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: tv_savemode gif options not working

Post by Hironori Takagi »

NathanOtano wrote: 09 Sep 2021, 13:41 I tried both solutions above and, even if my seconde "tv_savemode" returns the right settings, my gif is still exported the same way no matter how I set the first tv_savemode. It seems it has no influence on my export whatsoever, it's with the same color and size
Nathan, I tried the same command as you.

tv_SaveMode "GIF" "local" "NODITHER" "32"
tv_SaveMode
tv_Warn result

The result is "gif local nodither 32",
I check file-> export and it doesn't change.
Wait for the development reply.
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: tv_savemode gif options not working

Post by Xavier »

Ah, I get it : when you open the export panel it restores its parameters from the preferences, or the default settings if no preferences were saved.
So there's no point checking the result of a George function using the export panel !

Tv_savemode works together with the other tv_save* functions. For instance, if you call tv_saveimage "/my/picture" after your call to tv_savemode, it will create /my/picture.gif.

Also note that although there's no error in your parameters, the GIF format has its own limitations : https://en.wikipedia.org/wiki/GIF
For instance, it can only have 256 colors, so 8 bits at most.
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: tv_savemode gif options not working

Post by Svengali »

Xavier wrote: 14 Sep 2021, 10:48 Ah, I get it : when you open the export panel it restores its parameters from the preferences, or the default settings if no preferences were saved.
So there's no point checking the result of a George function using the export panel !

Tv_savemode works together with the other tv_save* functions. For instance, if you call tv_saveimage "/my/picture" after your call to tv_savemode, it will create /my/picture.gif.

Also note that although there's no error in your parameters, the GIF format has its own limitations : https://en.wikipedia.org/wiki/GIF
For instance, it can only have 256 colors, so 8 bits at most.
Thanks Xavier,
Your explanation clarifies several things for me regarding my GIF save script.
Since GIFs are always limited to 256 colors, NONE of the colors can be transparent or alpha meaning that every pixel must be fully opaque and assigned one of the 256 colors in the GIF's final palette.

Another thing about GIFs that I remember from past research is this. The original image(s) being saved may be 24 bit or 32 bit. The variety of pixel colors in a complex, multiframe 32 bit animation will far exceed the final palette of 256 colors used in the GIF. So, the routine for creation of the output GIF (single image or multiple images) must analyze all of the existing RGBA pixel colors (which will likely number in the thousands) and generate a "best fit" palette that accommodates both the most frequently appearing RGB pixel colors, but also the necessary palette that best represent colors that appear in EACH and ALL frames. Finally, all the original color pixels in all the frames will be replaced by the nearest 8 bit, 256 colors in the resduced palette, which is then put out as the saved GIF. (An artifact of the old days when LUT palettes were the only way color was displayed.)

I just changed my GIF output script to include tv_AlphaSaveMode NOALPHA (not sure if that makes any difference but can't hurt)

And, one more piece of info. I almost always view my output GIFs using ACDSee and for a long time, had an intermittent problem where parts of the image on the LAST FRAME in the GIF, which were supposed to be black, would flash white. I think this was an anomaly generated by a percularity of the GIF making process in TVPaint. I never did find a resolution but I think this GIF strangeness is related... and changing my tv_AlphaSaveMode to NOALPHA could fix it. But I won't know for sure because the flashing was so intermittent. Time will tell.

sven

EDIT: The history and specs for GIFs "explained" in the Wikipedia article you reference are, in detail and complexity, a magnitude beyond what I can understand or apply to my own GIFs generation in TVPaint.

NInety-nine percent of the GIFs I create are exclusively black/gray/white, which seems to simplify the final GIF palette generation to "trivial", so that what values I see my original loops are exactly what I get in my GIF loops.

TVPaint GIFs which start out as Full Color animations are a whole different animal.
Last edited by Svengali on 15 Sep 2021, 15:09, edited 4 times in total.
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Hironori Takagi
Posts: 313
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: tv_savemode gif options not working

Post by Hironori Takagi »

Xavier wrote: 14 Sep 2021, 10:48 Ah, I get it : when you open the export panel it restores its parameters from the preferences, or the default settings if no preferences were saved.
So there's no point checking the result of a George function using the export panel !

Tv_savemode works together with the other tv_save* functions. For instance, if you call tv_saveimage "/my/picture" after your call to tv_savemode, it will create /my/picture.gif.

Also note that although there's no error in your parameters, the GIF format has its own limitations : https://en.wikipedia.org/wiki/GIF
For instance, it can only have 256 colors, so 8 bits at most.
Xavier,
I notice the difference between 11.0.x and 11.5.x in your remarks.
In 11.0.x using
tv_SaveMode "gif"
The file -> export panel format was also changed to GIF.
Is it possible to return to the original operation?
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
Xavier
Posts: 1855
Joined: 01 Oct 2019, 11:08

Re: tv_savemode gif options not working

Post by Xavier »

This need to be discussed with the team...

Actually it's an improvement to the Export Panel that was done with the recent releases : the export parameters are properly saved in the preferences and restored. This is all for a better user experience.

My opinion is that if you use George to configure the settings, you should also use George to save your project.
User avatar
Hironori Takagi
Posts: 313
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: tv_savemode gif options not working

Post by Hironori Takagi »

Xavier wrote: 15 Sep 2021, 10:43 This need to be discussed with the team...

Actually it's an improvement to the Export Panel that was done with the recent releases : the export parameters are properly saved in the preferences and restored. This is all for a better user experience.

My opinion is that if you use George to configure the settings, you should also use George to save your project.

The improvement that the export settings now record the previous state was a good change.
However, when creating a panel to perform export with one button, in the range of what George can do now, there are cases where we have to manually specify some of the settings, for example, gif [local, nodither, 32colors], mov [prores / mpeg4 / png] etc.
When doing this action

tv_SaveMode "xxx"
[manually setting change]
tv_ClipSaveStrucuture (or ProjectSaveSequence, SaveDisplay, etc.)

Therefore, it is necessary to change the export setting itself.
The best wish is that tv_SaveMode can specify all settings.

Thank you for your consideration.
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
NathanOtano
Posts: 1209
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: tv_savemode gif options not working

Post by NathanOtano »

Xavier wrote: 14 Sep 2021, 10:48 Ah, I get it : when you open the export panel it restores its parameters from the preferences, or the default settings if no preferences were saved.
So there's no point checking the result of a George function using the export panel !

Tv_savemode works together with the other tv_save* functions. For instance, if you call tv_saveimage "/my/picture" after your call to tv_savemode, it will create /my/picture.gif.

Also note that although there's no error in your parameters, the GIF format has its own limitations : https://en.wikipedia.org/wiki/GIF
For instance, it can only have 256 colors, so 8 bits at most.
Thanks for your help Thierry. Im not sure I understood correctly however?
My problem isn’t that my export panel or my scripts needs to be in sync (i didn’t check my settings with the export panel), my problem is that setting the savemode of a gif does not follow my tvpaint command but sticks to my export panel gif settings instead, even if the comand returns the right savemode settings I don’t get the right numbers of colors etc
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Post Reply