-100 saturation for selected clips 1 button each

Please use this part to report bugs & errors, ask questions & "How to..."
User avatar
Animationriver
Posts: 258
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

-100 saturation for selected clips 1 button each

Post by Animationriver »

Hello. It often takes me a while to upload files. Pictures do not arrive at the same time. Usually at different times of the day. And how they come from colleagues. I break them down into clips. And in each clip, I need to make the picture black and white. But when there are 100 clips, you need to constantly press FХ STASK / color / color Adjust / Saturation / -100 Saturation.
Question.
You can give me a script. So that I can make all images in all SELECTED clips in BLACK WHITE project with one button.
Help me please.
:D
www.youtube.com/c/animationriver
MAC OS Sierra 10.12.6 64 bits , MacBook Pro (Retina, 15-inch, Mid 2014)
2.8 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.5.2 64bit
NVIDIA GeForce GT 750M 2048 Мb
Wacom Cintiq 27 QHD Touch - Wacom Intuos Pro 5 - driver version 6.3.37-2
User avatar
slowtiger
Posts: 2949
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

Re: -100 saturation for selected clips 1 button each

Post by slowtiger »

You can assign a keyboard shortcut to the Basic Scan Cleaner. And you can do the same to the "Apply" of the FX stack.
TVP 10.0.18 and 11.0 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
TVP 11.0 and 11.7 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
TVP 11.7 Mac Mini M2pro 32GB OS 13.5
User avatar
Animationriver
Posts: 258
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

Re: -100 saturation for selected clips 1 button each

Post by Animationriver »

slowtiger wrote: 18 Feb 2021, 21:22 You can assign a keyboard shortcut to the Basic Scan Cleaner. And you can do the same to the "Apply" of the FX stack.
Thank. I'll try.
www.youtube.com/c/animationriver
MAC OS Sierra 10.12.6 64 bits , MacBook Pro (Retina, 15-inch, Mid 2014)
2.8 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.5.2 64bit
NVIDIA GeForce GT 750M 2048 Мb
Wacom Cintiq 27 QHD Touch - Wacom Intuos Pro 5 - driver version 6.3.37-2
User avatar
Animationriver
Posts: 258
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

Re: -100 saturation for selected clips 1 button each

Post by Animationriver »

slowtiger wrote: 18 Feb 2021, 21:22 You can assign a keyboard shortcut to the Basic Scan Cleaner. And you can do the same to the "Apply" of the FX stack.
This recommendation works. But Not for all selected clips at once. Thank. I'm interested in 1 button, which will make many selected clips black and white in one click.
Thank you!
www.youtube.com/c/animationriver
MAC OS Sierra 10.12.6 64 bits , MacBook Pro (Retina, 15-inch, Mid 2014)
2.8 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.5.2 64bit
NVIDIA GeForce GT 750M 2048 Мb
Wacom Cintiq 27 QHD Touch - Wacom Intuos Pro 5 - driver version 6.3.37-2
User avatar
slowtiger
Posts: 2949
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

Re: -100 saturation for selected clips 1 button each

Post by slowtiger »

Have you tried if re-apply (enter) works?
TVP 10.0.18 and 11.0 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
TVP 11.0 and 11.7 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
TVP 11.7 Mac Mini M2pro 32GB OS 13.5
User avatar
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: -100 saturation for selected clips 1 button each

Post by D.T. Nethery »

Animationriver wrote: 26 Feb 2021, 02:35
slowtiger wrote: 18 Feb 2021, 21:22 You can assign a keyboard shortcut to the Basic Scan Cleaner. And you can do the same to the "Apply" of the FX stack.
This recommendation works. But not for all selected clips at once.
I'm interested in 1 button, which will make many selected clips black and white in one click.
Thank you!
slowtiger wrote: 26 Feb 2021, 10:24 Have you tried if re-apply (enter) works?
I haven't commented yet ,but have been following this topic.

I just now tried it , but clicking on Enter/Return (for re-apply) does not seem to work for re-applying an action to all Selected Clips in the Project View. Were you able to get Enter/Return to re-apply to Clips ? For me, Enter/Return only works on selected frames in the Timeline view. Maybe this should be a new Feature Request (Enter/Return re-applies to all Selected Clips)

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: -100 saturation for selected clips 1 button each

Post by Svengali »

I have a script solution that you can test. NOTE: Only TEST AND USE ON A COPY OF THE MULTICLIP PROJECT YOU WANT TO CONVERT TO B&W BECAUSE THE PROCESS IS DESTRUCTIVE!!!

copy the following script and create a button inserting the script as embedded GEORGE script.

Code: Select all

// ConvertAllClipsB&W.grg
// Svengali © 2021
// ( Feb ) 2021 - ver .0

Param none
ScriptName = "ConvertAllClipsB&W"


Text = "WARNING: Only run this script on a copy of your MultiClip project!!! |Continue|Exit"
tv_Request Text
Reply = result
IF Reply == 0
	tv_warn "Script Aborted.."
	EXIT
END

ClipRun = 1
ClipPosition = 0
Frames = 0
WHILE ClipRun
	tv_ClipeNumID -1  ClipPosition
	ClipID = result
	IF CMP(ClipID,"none") == 1
		ClipRun = 0
	Else
		tv_ClipSelect ClipID
		tv_FirstImage
		FirstImage = result
		tv_LastImage
		TotalFrames = FirstImage - result 
		tv_LayerSelect FirstImage TotalFrames
		tv_LayerID
		LayerID = result
		tv_LayerMergeAll
		tv_layerblendingmode LayerID VALUE
		ClipPosition = ClipPosition + 1 
	END
END
tv_warn "B&W conversion complete."

Give me feedback on the result: either if it works, or any error messages and problem you might have.
The way the script works is it goes to each clip, merges all the layers and changes the merged layer's blend mode to VALUE.

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
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: -100 saturation for selected clips 1 button each

Post by D.T. Nethery »

Svengali wrote: 26 Feb 2021, 16:19
Give me feedback on the result: either if it works, or any error messages and problem you might have.
The way the script works is it goes to each clip, merges all the layers and changes the merged layer's blend mode to VALUE.

sven
I tried the script. I had 18 separate clips , one color image in each clip . The desired result was to automatically convert each color image in each clip to black and white.

The script worked flawlessly ! Thank you , Svengali .

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: -100 saturation for selected clips 1 button each

Post by Svengali »

D.T. Nethery wrote: 26 Feb 2021, 16:48
I tried the script. I had 18 separate clips , one color image in each clip . The desired result was to automatically convert each color image in each clip to black and white.

The script worked flawlessly ! Thank you , Svengali .
I appreciate the feedback David. :D
(and a small confession: I adapted the script from an example in Mike's comprehensive GEORGE reference under tv_clipenumid. :| )

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
Animationriver
Posts: 258
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

Re: -100 saturation for selected clips 1 button each

Post by Animationriver »

Svengali wrote: 26 Feb 2021, 16:19 I have a script solution that you can test. NOTE: Only TEST AND USE ON A COPY OF THE MULTICLIP PROJECT YOU WANT TO CONVERT TO B&W BECAUSE THE PROCESS IS DESTRUCTIVE!!!

copy the following script and create a button inserting the script as embedded GEORGE script.

Code: Select all

// ConvertAllClipsB&W.grg
// Svengali © 2021
// ( Feb ) 2021 - ver .0

Param none
ScriptName = "ConvertAllClipsB&W"


Text = "WARNING: Only run this script on a copy of your MultiClip project!!! |Continue|Exit"
tv_Request Text
Reply = result
IF Reply == 0
	tv_warn "Script Aborted.."
	EXIT
END

ClipRun = 1
ClipPosition = 0
Frames = 0
WHILE ClipRun
	tv_ClipeNumID -1  ClipPosition
	ClipID = result
	IF CMP(ClipID,"none") == 1
		ClipRun = 0
	Else
		tv_ClipSelect ClipID
		tv_FirstImage
		FirstImage = result
		tv_LastImage
		TotalFrames = FirstImage - result 
		tv_LayerSelect FirstImage TotalFrames
		tv_LayerID
		LayerID = result
		tv_LayerMergeAll
		tv_layerblendingmode LayerID VALUE
		ClipPosition = ClipPosition + 1 
	END
END
tv_warn "B&W conversion complete."

Give me feedback on the result: either if it works, or any error messages and problem you might have.
The way the script works is it goes to each clip, merges all the layers and changes the merged layer's blend mode to VALUE.

sven
Your script is good. Thanks.
In my case, it is important for me:
1.extract clips
2. Press the button and get a black and white version.
Unfortunately your script changes the color depth.
Attachments
Снимок экрана 2021-02-26 в 18.43.14.jpg
Снимок экрана 2021-02-26 в 18.42.57.jpg
www.youtube.com/c/animationriver
MAC OS Sierra 10.12.6 64 bits , MacBook Pro (Retina, 15-inch, Mid 2014)
2.8 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.5.2 64bit
NVIDIA GeForce GT 750M 2048 Мb
Wacom Cintiq 27 QHD Touch - Wacom Intuos Pro 5 - driver version 6.3.37-2
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: -100 saturation for selected clips 1 button each

Post by Svengali »

Animationriver wrote: 26 Feb 2021, 17:45 Unfortunately your script changes the color depth.
No, it doesn't. It removes saturation but preserves value.

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
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: -100 saturation for selected clips 1 button each

Post by D.T. Nethery »

Animationriver wrote: 26 Feb 2021, 17:45 Unfortunately your script changes the color depth.
Color_Converted_Scan_Cleaner_retains_color_depth.jpg
B&W Conversion Script loses Contrast.jpg

Hi, AnimationRiver -

From the examples you posted , it seems like the image converted with Svengali's script loses contrast . (it appears a bit "flat") compared to the image converted using the Scan Cleaner.
Perhaps the parameters of the script could be tweaked so it does not reduce the contrast on the resulting black and white image ? Or maybe the script can be changed to apply Scan Cleaner rather than changing the merged layer's blend mode to VALUE ?


Aside from a script, I was wondering if this procedure would work for your purposes:

1.) You need to convert multiple (100 or more) color images to black and white , each image in a separate Clip. If you had all the color images to be converted in a folder , could you use a batch
renaming app to automatically give all the image files a consistent naming convention , such as COLOR_IMAGE_0001, COLOR_IMAGE_0002 , COLOR_IMAGE_0003 , COLOR_IMAGE_0004, etc. , (I use ReNamer , a batch file renaming app for macOS that allows you to rename lots of files quickly and conveniently. But if you are on Windows I think there are similar apps for Windows.)

2.) Then import all images into TVPaint. If the images have a consistent naming convention they should all import to a single layer in the Timeline.

3.) Now select all the color images on the Timeline and use your keyboard shortcut to apply Scan Cleaner B&W .

4.) Next, use a keyboard shortcut for Split Clip and advance from one image to the next , each time clicking the keyboard shortcut for Split Clip. Although this is somewhat repetitious , it should not take too long to split 100 or more images into separate Clips . Then you will have all the images converted to B & W and separated to their own clips.

Would this work for what you need to do ? (although I expect that Svengali will come through with an improved script , so let's wait and see ... )

.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: -100 saturation for selected clips 1 button each

Post by Svengali »

OK, here is another option for tuning the B&W conversion, but YOU have to do some of the work.

Load the Black And White Converter found in the color FX.
load one of your images and tune the contrast values for Red, Green and Blue to your liking.
1. Be sure the box for Black And White Converter is checked.
2. Be sure that "All Instances" is selected.
EXPORT the FX to your GEORGE folder under the name "BlackAndWhiteconverter.bin"
Black and White Converter FX2.png
Black and White Converter FX2.png (27.85 KiB) Viewed 21810 times
Now, as before, select the script below and insert it into your button as an Embedded Script.

When you run this script version it should render your images in B&W EXACTLY as adjusted by you.

Code: Select all

// ConvertAllClipsB&W.grg
// Svengali © 2021
// ( Feb ) 2021 - ver .0

Param none
ScriptName = "ConvertAllClipsB&W"


Text = "WARNING: Only run this script on a copy of your MultiClip project!!! |Continue|Exit"
tv_Request Text
Reply = result
IF Reply == 0
	tv_warn "Script Aborted.."
END



FXProcess = "BlackAndWhiteConverter.bin"			// added lines to import the Black and White Converter FX process
tv_GetPath GEORGE
GeorgePath = result
FXProcess = GeorgePath""FXProcess
tv_StackLoad FXProcess


ClipRun = 1
ClipPosition = 0
Frames = 0
WHILE ClipRun
	tv_ClipeNumID -1  ClipPosition
	ClipID = result
	IF CMP(ClipID,"none") == 1
		ClipRun = 0
	Else
		tv_ClipSelect ClipID
		tv_FirstImage
		FirstImage = result
		tv_LastImage
		TotalFrames = FirstImage - result 
		tv_LayerSelect FirstImage TotalFrames
		tv_LayerID
		LayerID = result
		tv_LayerMergeAll
		tv_StackApply ALLLAYERS				// new line to apply Black and White converter to clip			
//		tv_layerblendingmode LayerID VALUE	// removed line from first version
		ClipPosition = ClipPosition + 1
		
	END
END
tv_warn "B&W conversion complete."

sven

addendum: Note that you can apply many other FX processes on all of the CLIPS...
Save your customized FX with your own settings, carefully noting THE NAME you used with a .bin extension - save it to the GEORGE folder.
Then, in the embedded script, find the line that says FXProcess = and replace the current FX name with the name of your FX inside double quotation marks.
Now, when you click the button, all the Clips should be processed by your new FX.
For instance, you could try substituting the Scan Cleaner Black and White...
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
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: -100 saturation for selected clips 1 button each

Post by D.T. Nethery »

Svengali wrote: 26 Feb 2021, 20:23
addendum: Note that you can apply many other FX processes on all of the CLIPS...

Save your customized FX with your own settings, carefully noting THE NAME you used with a .bin extension - save it to the GEORGE folder.

Then, in the embedded script, find the line that says FXProcess = and replace the current FX name with the name of your FX inside double quotation marks.
Now, when you click the button, all the Clips should be processed by your new FX.

For instance, you could try substituting the Scan Cleaner Black and White...

This is very helpful, Sven. I did not know how to apply FX processes to CLIPS by saving the FX with .bin extension to the George folder.
Now I know , thanks to you , and I can see this will be useful in many way. I appreciate you taking the time to explain this so clearly.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
User avatar
Animationriver
Posts: 258
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

Re: -100 saturation for selected clips 1 button each

Post by Animationriver »

D.T. Nethery wrote: 26 Feb 2021, 18:28
Animationriver wrote: 26 Feb 2021, 17:45 Unfortunately your script changes the color depth.

Color_Converted_Scan_Cleaner_retains_color_depth.jpg

B&W Conversion Script loses Contrast.jpg

Hi, AnimationRiver -

From the examples you posted , it seems like the image converted with Svengali's script loses contrast . (it appears a bit "flat") compared to the image converted using the Scan Cleaner.
Perhaps the parameters of the script could be tweaked so it does not reduce the contrast on the resulting black and white image ? Or maybe the script can be changed to apply Scan Cleaner rather than changing the merged layer's blend mode to VALUE ?


Aside from a script, I was wondering if this procedure would work for your purposes:

1.) You need to convert multiple (100 or more) color images to black and white , each image in a separate Clip. If you had all the color images to be converted in a folder , could you use a batch
renaming app to automatically give all the image files a consistent naming convention , such as COLOR_IMAGE_0001, COLOR_IMAGE_0002 , COLOR_IMAGE_0003 , COLOR_IMAGE_0004, etc. , (I use ReNamer , a batch file renaming app for macOS that allows you to rename lots of files quickly and conveniently. But if you are on Windows I think there are similar apps for Windows.)

2.) Then import all images into TVPaint. If the images have a consistent naming convention they should all import to a single layer in the Timeline.

3.) Now select all the color images on the Timeline and use your keyboard shortcut to apply Scan Cleaner B&W .

4.) Next, use a keyboard shortcut for Split Clip and advance from one image to the next , each time clicking the keyboard shortcut for Split Clip. Although this is somewhat repetitious , it should not take too long to split 100 or more images into separate Clips . Then you will have all the images converted to B & W and separated to their own clips.

Would this work for what you need to do ? (although I expect that Svengali will come through with an improved script , so let's wait and see ... )

.
In my first post I wrote that color pictures are not delivered to my computer immediately. And during the day. I know that I can make 100 pictures black and white by putting them on one layer. But I have to work with the moment of learning the picture at different times.
www.youtube.com/c/animationriver
MAC OS Sierra 10.12.6 64 bits , MacBook Pro (Retina, 15-inch, Mid 2014)
2.8 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.5.2 64bit
NVIDIA GeForce GT 750M 2048 Мb
Wacom Cintiq 27 QHD Touch - Wacom Intuos Pro 5 - driver version 6.3.37-2
Post Reply