Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th March 2024, 21:20   #1  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
SelectiveColour v2.0 - an updated clone of Photoshop's Selective color adjustment

SelectiveColour v2.0
Direct download

I've rewritten my old SelectiveColour filter (link to previous discussion) using AVX instructions and now working exclusively in floating point RGB, so it's both faster and more accurate.

Also because I'm quite lazy, input clip width must be mod 8.

It's a clone of Photoshop's Selective color adjustment.

Apart from an input clip (which must be floating point planar RGB) it takes 19 required arguments, plus one optional argument.

The first 18 are floats in the range -1 to 1 (other values are accepted, but that behaviour is not well defined). These are in groups of three, representing the Cyan, Magenta, and Yellow percentages (normalised) present in Photoshop's Selective Color dialogue for each of the six colour sections (reds, yellows, greens, cyans, blues, magentas).

The 19th argument is a boolean to choose either relative (false) or absolute (true) mode, as per the Photoshop dialogue box.

The final optional named argument is "threads". This defaults to 1, but can set to a higher number to enable multithreading. Two threads gave me a 25% speed increase, but not much more beyond that.

Usage:

Code:
...
ConvertBits(32)
ConvertToPlanarRGB
SelectiveColour(last,\
0.5,0,0,\
0.25,0.1,0,\
1,-0.5,-0.25,\
-0.5,0.5,-0.5,\
0.1,0.2,0.3,\
-0.1,-0.2,-0.3,\
true, threads = 2)
The six triples act on the following sets of pixels (any pixel may be a member of up to 2 adjacent sets):

Reds: those pixels where R>(G and B)
Yellows: (R and G)>B
Greens: G>(R and B)
Cyans: (G and B)>R
Blues: B>(R and G)
Magentas: (R and B)>G

The first number in a triple alters the Red channel, the second the Green channel, the third the Blue channel. Because Photoshop calls these values Cyan, Magenta and Yellow, the numbers work backwards - if you want to increase the intensity of a channel, use a negative number, and vice versa.

The filter still doesn't currently implement the "Black" value in Photoshop.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 5th March 2024 at 11:45.
wonkey_monkey is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.