Hi, I'm wondering whether there's a filter for avisynth which detects only grayscale colours in an image and removes all the rest of colours in it.
For example, I have some images with black and green colours. I want to detect only the black or gray colours, and remove the green.
I can do that in photoshop, but I have a large amount of images that need to be processed like that.
I've read that Layer Filter can do that, but I can't find it anywhere.
Any help would be appreciated. It doesn't matter if it's not an avisynth filter but another software.
Thanks in advance.
+ Reply to Thread
Results 1 to 12 of 12
-
-
I find the description of what you want to do confusing. You want to keep the greyscale parts of the image and do what with the colored parts? Make them greyscale? Make them black? Some other color? You only need to process the green? Or all colors?
-
-
There are probably easier ways but here's one that uses only basic tools built into AviSynth:
Code:function AbsChroma(clip src) { # sum of abs(chroma-128) posu=UtoY(src).ColorYUV(off_y=-128) negu=Invert(src).UtoY().ColorYUV(off_y=-128) posv=VtoY(src).ColorYUV(off_y=-128) negv=Invert(src).VtoY().ColorYUV(off_y=-128) Overlay(Overlay(posu,negu,mode="Add"), Overlay(posv,negv,mode="Add"),mode="Add").BicubicResize(src.width, src.height) } src=AviSource("source.avi") # get source file white=ColorYUV(src, off_y=256, cont_u=-256, cont_v=-256) # make a white video mask=AbsChroma(src).ColorYUV(off_y=-4).ColorYUV(gain_y=256000) # convert chroma to a mask Overlay(src,white,0,0,mask)
Last edited by jagabo; 16th Mar 2013 at 12:07.
-
Maybe this:
http://forum.doom9.org/showthread.php?t=151259
But I'm not sure about "Black". Video uses RGB and a few other spaces I have less familiarity with, but I don't think it uses CMYK. -
-
-
Code:
src=ImageSource("image.png").ConvertToYV24(()
http://avisynth.org/mediawiki/ImageSource
http://avisynth.org/mediawiki/Convert -
For a less exact shorter version of what jagabo sugggested, you could always just use Greyscale().
Scott -
-
...I see where that came from now. Guess I never fully understood the nature of the question. Still don't. What would this be used for?
Scott
Similar Threads
-
How to remove brown colour with Avisynth?
By VideoFanatic in forum RestorationReplies: 28Last Post: 13th Feb 2013, 00:17 -
Y levels outside tv range
By PAL sucks in forum Video ConversionReplies: 3Last Post: 15th Feb 2012, 09:09 -
How to Fix Patchy Colour with Avisynth?
By VideoFanatic in forum RestorationReplies: 59Last Post: 14th Feb 2012, 10:20 -
Colour Conversion problems with Avisynth
By wiseant in forum Video ConversionReplies: 6Last Post: 16th Mar 2011, 11:40 -
Temperature Range
By Seeker47 in forum ComputerReplies: 12Last Post: 6th May 2009, 16:15