PDA

View Full Version : Filters for Colorfilter plugin


Fluxid
July 30th, 2007, 09:14 PM
Hi!
I love this plugin, for me it's the most useful plugin in whole Compiz :) But it's completely useless without any filters (fragment programs, pixel shaders), so i wrote some (based on filters i found here: git://anongit.opencompositing.org/users ... lorfilters (git://anongit.opencompositing.org/users/smspillaz/colorfilters) )

I made 22 filters, where about ten are typical filters like "blue only".
Here is the list:
desaturate (average R, G and B channels)[/*:m:dfa75]
hue (shows color spectrum of colors, and black if color is neutral)[/*:m:dfa75]
high/low contrast (i thing higher contrast is more usable)[/*:m:dfa75]
show chrominance/luminance (using YPbPr definition and formula, really good for checking JPEG images quality)[/*:m:dfa75]
full opacity (sets alpha to 1.0, for me it's useless, but it could be good for debuging apps using compositing)[/*:m:dfa75]
show alpha mask (it copies alpha to RGB and sets alpha to 1.0, also could be helpful in debuging)[/*:m:dfa75]
neutrals to alpha (neutral colors, like white, gray, black, are completely transparent, and high-saturation colors are opaque. Propably useless)[/*:m:dfa75]
neutrals to black (all netrals becomes black, including white, and high-saturations stay untouched. Similar to chrominance, but it's not using colorometric definition)[/*:m:dfa75]
neutrals to white (like above)[/*:m:dfa75]
red/green/blue only (other channels set to 0.0)[/*:m:dfa75]
red/green/blue to null (sets to 0.0)[/*:m:dfa75]
red/green/blue to gray (copies to other channels)[/*:m:dfa75]

I'm completely new to OpenGL fragment programs, so there could be some bugs/mistakes. Some filters does not work well with decoration filtering turned on.

Filters files are here (my FTP is down :/ ):
[attachment=0:dfa75]fluxid_filters_20070730.tgz[/attachment:dfa75]
Includes testing image ;)
(grayscale gradient on the left isn't ideal, it shows colorful noise in hue filter)
(i didn't upload previews, it's too many images, and one tgz is too big for this forum...)

Hope you all like it :)

Sorry for any language mistakes

I used those references in programming, it could be helpful for others:
http://www.ultraedit.com/files/wf/OpenGL.txt
http://oss.sgi.com/projects/ogl-sample/ ... rogram.txt (http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt)
http://petewarden.com/notes/archives/20 ... gra_2.html (http://petewarden.com/notes/archives/2005/05/fragment_progra_2.html)

And for making some filters, like chrominance/luminance filter i used those:
http://en.wikipedia.org/wiki/YCbCr
http://www.poynton.com/ColorFAQ.html

Fluxid
July 31st, 2007, 10:24 PM
PS:For nautrals-to-alpha you have to decrease window opacity by minimum 1%.
Also, I'm not sure is it working on nVidia and Intel, let me know if you test it

Tell me what do you think, it's my first contribution ever, and i'm a bit excited :D

SmSpillaz
August 2nd, 2007, 01:10 AM
Hi!
I love this plugin, for me it's the most useful plugin in whole Compiz :) But it's completely useless without any filters (fragment programs, pixel shaders), so i wrote some (based on filters i found here: git://anongit.opencompositing.org/users ... lorfilters (git://anongit.opencompositing.org/users/smspillaz/colorfilters) )

I made 22 filters, where about ten are typical filters like "blue only".
Here is the list:
desaturate (average R, G and B channels)[/*:m:3d743]
hue (shows color spectrum of colors, and black if color is neutral)[/*:m:3d743]
high/low contrast (i thing higher contrast is more usable)[/*:m:3d743]
show chrominance/luminance (using YPbPr definition and formula, really good for checking JPEG images quality)[/*:m:3d743]
full opacity (sets alpha to 1.0, for me it's useless, but it could be good for debuging apps using compositing)[/*:m:3d743]
show alpha mask (it copies alpha to RGB and sets alpha to 1.0, also could be helpful in debuging)[/*:m:3d743]
neutrals to alpha (neutral colors, like white, gray, black, are completely transparent, and high-saturation colors are opaque. Propably useless)[/*:m:3d743]
neutrals to black (all netrals becomes black, including white, and high-saturations stay untouched. Similar to chrominance, but it's not using colorometric definition)[/*:m:3d743]
neutrals to white (like above)[/*:m:3d743]
red/green/blue only (other channels set to 0.0)[/*:m:3d743]
red/green/blue to null (sets to 0.0)[/*:m:3d743]
red/green/blue to gray (copies to other channels)[/*:m:3d743]

I'm completely new to OpenGL fragment programs, so there could be some bugs/mistakes. Some filters does not work well with decoration filtering turned on.

Filters files are here (my FTP is down :/ ):
[attachment=0:3d743]fluxid_filters_20070730.tgz[/attachment:3d743]
Includes testing image ;)
(grayscale gradient on the left isn't ideal, it shows colorful noise in hue filter)
(i didn't upload previews, it's too many images, and one tgz is too big for this forum...)

Hope you all like it :)

Sorry for any language mistakes

I used those references in programming, it could be helpful for others:
http://www.ultraedit.com/files/wf/OpenGL.txt
http://oss.sgi.com/projects/ogl-sample/ ... rogram.txt (http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt)
http://petewarden.com/notes/archives/20 ... gra_2.html (http://petewarden.com/notes/archives/2005/05/fragment_progra_2.html)

And for making some filters, like chrominance/luminance filter i used those:
http://en.wikipedia.org/wiki/YCbCr
http://www.poynton.com/ColorFAQ.html

I'd love to host these on my git account on git://git.opencompositing.org/users/sms ... lorfilters (git://git.opencompositing.org/users/smspillaz/colorfilters)

I will make a new directory with your name on it. I will also put a DISCLAIMER in there saying that you made them and I take no credit.

(I'd also like to mention you on the blog :D, permission to do so? :D)

Fluxid
August 2nd, 2007, 01:51 AM
Go on, I'm happy to hear that :D

shame
August 2nd, 2007, 03:29 AM
Is there a standard installation directory for colorfilters? I noticed there were a couple in the colorfilter git source but I can't work out where they are installed.
I'm thinking of adding these to an artwork package in my repo.

Fluxid
August 2nd, 2007, 09:28 AM
TThey are installed where you want, i think... It does not have any scripts or makefiles...
It should be copied to /usr/compiz/something, i think...
Of course, tou can include it in reops :)

SmSpillaz
August 2nd, 2007, 10:39 AM
TThey are installed where you want, i think... It does not have any scripts or makefiles...
It should be copied to /usr/compiz/something, i think...
Of course, tou can include it in reops :)

Yes, thats right. You only need to specify the exact path to the file in the plugin's options

shame
August 2nd, 2007, 01:30 PM
Ok, these colorfilters will be added to a new package in my repo at the next update, along with the ones by SmSpillaz if that's ok with everyone?
They will be installed to /usr/share/compiz/colorfilters with a subdirectory for Fluxid's colorfilers. Along with the SmSpillaz and Fluxid added to the copyright file.
If either of you have any objections let me know and I will omit them.

Not sure what to call the package though since I don't think these would be classed as artwork exactly. Maybe compiz-fusion-community-extras, compiz-fusion-oc-extras, compiz-fusion-supplemental or something?

stjepan
August 3rd, 2007, 01:08 PM
What's so useful in this plugin?

Fluxid
August 6th, 2007, 05:24 PM
What's so useful in this plugin?

For example, checking JPEG/Video files compression quality (JPEG copmpresses luma and chroma separately instead of RGB components. Most video files are in YCrCb/YUV colorspace too, usually with chroma subsampling like 4:2:2 or 4:2:0)
It's just one example.

BTW, tell me, what is useful in: Fire, Atlantis, Motion Blur etc.?
;)
I sometimes do some graphics or video encodings, so it's just my opinion ;)

footballyears
September 26th, 2007, 11:06 AM
I'd love to host these on my git account on git://git.opencompositing.org/users/sms ... lorfilters (git://git.opencompositing.org/users/smspillaz/colorfilters)

I will make a new directory with your name on it. I will also put a DISCLAIMER in there saying that you made them and I take no credit.

(I'd also like to mention you on the blog :D, permission to do so? :D)

suede are great

Champions League (http://www.championsleagueyears.com/)
League Cup (http://www.leaguecupyears.com/)
England Football (http://www.englandfootballyears.com/)
Liverpool Football (http://www.liverpoolfootballyears.com/)
Everton FC (http://www.evertonyears.com/)
Israel Football (http://www.israelfootballyears.com/)
Wales Football (http://www.Walesfootballyears.com/)
Detox (http://www.detoxiy.com/)
Stop Smoking (http://www.stopsmokingdetox.com/)
Thyroid Medication (http://www.thyroidproduct.com/)
Acne (http://www.acnepreventionnow.com/)
Prostate Treatment (http://www.treatmentprostate.com/)
Wales Football (http://www.walesfootballyears.com/)