Page 1 of 2

-100 saturation for selected clips 1 button each

Posted: 18 Feb 2021, 19:44
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

Re: -100 saturation for selected clips 1 button each

Posted: 18 Feb 2021, 21:22
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.

Re: -100 saturation for selected clips 1 button each

Posted: 19 Feb 2021, 18:43
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.

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 02:35
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!

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 10:24
by slowtiger
Have you tried if re-apply (enter) works?

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 15:52
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)

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 16:19
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

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 16:48
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 .

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 17:08
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

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 17:45
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.

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 18:17
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

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 18:28
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 ... )

.

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 20:23
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 21463 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...

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 21:18
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.

Re: -100 saturation for selected clips 1 button each

Posted: 26 Feb 2021, 21:53
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.