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. |
11th December 2008, 03:53 | #1 | Link |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
ColorSwitch - a color-based pixel 'switcher'
I've finally become satisfied with my first filter which i have dubbed 'ColorSwitch'.
It has the ability to pick and choose pixels from input clips based on their color values on per pixel values. I developed it to be able to selectively filter a frame based on its color values. the basic formula of how it works is there's 3 input clips 'scan', 'base', and 'replace'. if scan's per pixel values is in any of the ranges you specify, it takes the respective pixel from replace. if not, it takes it from base. in this manner, passing last, last, last.filtered() can net you partial filtering based on the frame's colors another option to using in the manner of last, BlankClip(last, color=$000000), BlankClip(last, color=$FFFFFF) can be used for mask creation based on the colors. it supports up to 16 sets of color ranges, so you can nail down specific color conditions fairly well. it also features an additional function for writing the per pixel data to file as well, to assist with your color value choosings. natural limitations to the filter are: all clips must have the same width, height, and color space. and no interlaced support.... available for dl here |
11th December 2008, 06:44 | #3 | Link |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
the original reason was for the purpose selectively applying dftest on some of my anime encodes
generally didn't like how dftest came out on black -> near black sections so just wanted to be able to specify to apply it on sections with sufficient color. that was possible to be pulled off with creating some masks using levels() and similar color altering functions and then overlaying with it, but that wasn't as friendly as i would of liked. plus there may be some point in the future where i just want to filter on some specific color ranges that generating a mask would be too annoying normally. if you can understand that at all... |
11th December 2008, 19:32 | #4 | Link | |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
http://forum.doom9.org/showthread.ph...51#post1078651 |
|
11th December 2008, 21:04 | #6 | Link | |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
Quote:
the link in that post is dead, which is not surprising as it's nearly a year old :< |
|
11th December 2008, 21:28 | #7 | Link | |
Registered User
Join Date: Dec 2004
Location: Melbourne, AU
Posts: 1,963
|
Quote:
|
|
11th December 2008, 22:09 | #8 | Link |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
the concept for what i did is based on specific color values, not the hue/sat value ranges like maskHS
the filter i made has the capability to create masks depending on the input clips. the filter i have processes on raw, R,G,B,A, Y,U,V value ranges when they exist in the colorspace. so you can select pixels based on G value ranges or A value range s, a mixture of ranges, and combinations of ranges. ranges can also have the same min/max values, so you can nail down to a specific exact overall color (i.e. RGB24: 0x000000). it also accepts multiple (up to 16) ranges, so if you need to have several sets of distinct colors you would like to select, it can do so so assuming i had some RGB24 source, i could select colors in the ranges of R=0-10, B=20-30, G=40-50 or R=60-70, G=80-90, B=100-110 on some clip to 1A. generate a mask 1B. generate an antimask 2A. directly selectively filter on those colors 2B. directly selectively filter on ~colors (that aren't the specified ranges) what it generates as an end result is up to the user, as it works with clips, so you can do quite a bit with it. |
12th December 2008, 14:38 | #9 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
Nice for red-eye-reduction:
Get this image. And run this script: Code:
loadplugin("ColorSwitch.dll") ImageReader("red_eye_before470_470x386.jpg",0,0) converttorgb24() first=last ColorSwitch(last,last,last.greyscale(),"R:1-170,G:0-70,B:0-130") last+first
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 12th December 2008 at 14:51. |
|
|