TechnoRobbo Posted July 31, 2013 Share Posted July 31, 2013 (edited) TechnoRobbo's Coquin Graduated Filter A simulation of the legendary Cokin Graduated Photographic Filter Back in the 70's a photographer named Jean Coquin invented a new style of filter called Cokin http://en.wikipedia.org/wiki/Cokin One of the most used filters in the Cokin is the graduated color filter. http://www.cokin-filters.com/creative-system/ This simulation allows you to slide the filter up and down and rotate it just like the real fiter. It does not add color to the picture it subtracts the complimentary colors simulating what a real photographic filter would do. Menu: Effects -> Color No instructions - just play around. The Code Hidden Content: // Submenu: Color // Name: TR's Coquin Filter // Title: TR's Coquin Filter - v1.0 // Author: TechnoRobbo // URL: http://www.technorobbo #region UICode double Amount1 = 0; // [-1,1] Offset ColorBgra Amount2 = ColorBgra.FromBgr(0,0,0); // Tint double Amount3 = -90; // [-180,180] Rotation #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Delete any of these lines you don't need Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((sel.Right - sel.Left) / 2)+sel.Left; int CenterY = ((sel.Bottom - sel.Top) / 2)+sel.Top; double rad = Amount3 * Math.PI/180; float shortside = (sel.Height > sel.Width) ? sel.Width : sel.Height; shortside +=(float)Amount1 * shortside; ColorBgra CP; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { //======================================== PointF position = new PointF(x-CenterX,y-CenterY); position.X =(float)Math.Cos(rad) * position.X -(float)Math.Sin(rad) * position.Y + CenterX; //=========================================================== float grad = 1-( position.X / shortside); grad = Math.Max(grad,0); grad = Math.Min(grad,1); CP = src[x,y]; int R = (int)((Amount2.B + Amount2.G)/2 * grad) ; int G =(int)((Amount2.B + Amount2.R)/2 * grad) ; int B =(int)((Amount2.R + Amount2.G)/2 * grad) ; CP.R = Int32Util.ClampToByte((int)( CP.R - R )); CP.G = Int32Util.ClampToByte((int)( CP.G - G )); CP.B = Int32Util.ClampToByte((int)( CP.B - B )); dst[x,y] = CP; } } } TRsCoquin.zip Edited December 28, 2015 by TechnoRobbo Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
DrewDale Posted August 1, 2013 Share Posted August 1, 2013 Another top class plugin, very useful. Quote Link to comment Share on other sites More sharing options...
dug Posted August 1, 2013 Share Posted August 1, 2013 Excellent, I have a collection of Cokin Filters for my old film camera.Now I can do it digitally.Nice one,cool plug-in. Thank you for sharing. Quote MY GALLERYD.A.TheRawAtom Link to comment Share on other sites More sharing options...
skullbonz Posted August 2, 2013 Share Posted August 2, 2013 I like how this plugin works, the rotation adjustment is a cool extra that sets this apart from other similar plugins. I started with a picture of blue sky, white clouds and bright sun, made this with several other plugins and then applied the Coquin Graduated Filter to the layers before merging them together. I love your plugins TR but I can't make pictures fast enough to keep up with you,lol, and I'm loving it. Quote http://forums.getpaint.net/index.php?/topic/21233-skullbonz-art-gallery Link to comment Share on other sites More sharing options...
TechnoRobbo Posted August 2, 2013 Author Share Posted August 2, 2013 (edited) Very nice - It looks real. One interesting factoid. Coquin does not add color to the picture it subtracts the complimentary colors simulating what a real photographic filter would does. (That sounded good. I'll add it to the description in the OP) Edited August 2, 2013 by TechnoRobbo Quote Go out there and be amazing. Have Fun, TRSome Pretty Pictures Some Cool Plugins Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.