TechnoRobbo Posted June 3, 2015 Share Posted June 3, 2015 TechnoRobbo's Croquis (Dwarf Horde Collaboration) Quick Sketch Filter 3.5 compatible v1.2 Slider and angle control by Red Ochre v1.3 RetainColor and Invert Controls by BoltBait v1.4 Pastel Effect by BoltBait Menu: Effects->Artistic CodeLab Source Code (it's a divide algorithm) Hidden Content: // Submenu: Artistic // Name: TRs Croquis // Title: TRs Croquis - v1.4 // Author: TechnoRobbo & Red Ochre & BoltBait // URL: http://www.technorobbo.com #region UICode int Amount1 = 210; // [0,225] Contrast int Amount2 = 0; // [0,255] Clip Lo int Amount3 = 222; // [129,255] Clip Hi double Amount4 = 0.5; // [0.1,10] Distance double Amount5 = 45; // [-180,180] Angle bool Amount6 = false; // [0,1] Retain Color bool Amount7 = false; // [0,1] Invert byte Amount8 = 0; // [1] Pastel Action|None|Invert|Rail #endregion private UnaryPixelOps.Invert invertOp = new UnaryPixelOps.Invert(); //private BinaryPixelOp multiplyOp = LayerBlendModeUtil.CreateCompositionOp(LayerBlendMode.Multiply); //for PDN 4 private UserBlendOp multiplyOp = new UserBlendOps.MultiplyBlendOp(); // Multiply for CodeLab 1.8 and Paint.NET 3.5x void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CP; Color rgb; double k; double l; float offX = (float)(Amount4 * Math.Cos(Amount5 * Math.PI / 180)); float offY = (float)(Amount4 * Math.Sin(Amount5 * Math.PI / 180)); for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { CP = src.GetBilinearSampleWrapped((float)x + offX,(float)y + offY); rgb = CP.ToColor(); l = rgb.GetBrightness(); CP = src[x,y]; rgb = CP.ToColor(); k = rgb.GetBrightness(); k = (k==0)? 0: l/k; k *=k; k *=255; k = (k>255)?255:k; double inverse = 255 - Amount1; k -= Amount1; k = (k<0) ? 0:k; k= k * 255 / inverse; k =(k < Amount2) ? 0: (k > Amount3) ? 255:k; dst[x,y] = ColorBgra.FromBgra((byte)k , (byte)k ,(byte)k, CP.A); if (Amount7) { dst[x,y] = invertOp.Apply(dst[x,y]); } if (Amount6) { dst[x,y] = multiplyOp.Apply(dst[x,y],src[x,y]); } if (Amount8!=0) { ColorBgra CurrentPixel = dst[x,y]; PaintDotNet.HsvColor hsv = PaintDotNet.HsvColor.FromColor(CurrentPixel.ToColor()); int H = hsv.Hue; int S = hsv.Saturation; int V = hsv.Value; byte A = CurrentPixel.A; switch (Amount8) { case 1: V = 100-V; break; case 2: V = 100; break; } CurrentPixel = ColorBgra.FromColor(new PaintDotNet.HsvColor(H,S,V).ToColor()); CurrentPixel.A = A; dst[x,y] = CurrentPixel; } } } } TRsCroquis.zip 8 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...
Red ochre Posted June 3, 2015 Share Posted June 3, 2015 Great code! useful effect! Thank you! 1 Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
TechnoRobbo Posted June 3, 2015 Author Share Posted June 3, 2015 Version 1.1 ready for Download v1.1 Slider and angle control by Red Ochre 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...
TechnoRobbo Posted June 3, 2015 Author Share Posted June 3, 2015 V1.2 Ready - Bug Fix 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...
ReMake Posted June 3, 2015 Share Posted June 3, 2015 Wonderful effect and elegant code . Thank you. Quote Link to comment Share on other sites More sharing options...
nitenurse79 Posted June 3, 2015 Share Posted June 3, 2015 Thank you Mister Techno Robbo Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted June 3, 2015 Author Share Posted June 3, 2015 Thank you ReMake and Thank you Miss Nite Nurse 79. 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...
Eli Posted June 3, 2015 Share Posted June 3, 2015 Hello TR and thank you. I just tried the filter and somehow I can not get my charcoal to draw like yours. My sketch is very pixelated even when I use the same setting of your video. I guess I need to sharpen the tip of my pencil. Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted June 3, 2015 Author Share Posted June 3, 2015 Eli reduce the distance to .5 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...
Eli Posted June 3, 2015 Share Posted June 3, 2015 (edited) I just did it but it did not change much. - - - - - - - - - - - - -- EDIT: I adjusted the levels (more black and white) of the picture before applying the filter and this is what I obtained: Edited June 3, 2015 by Eli 1 Quote Link to comment Share on other sites More sharing options...
Seerose Posted June 3, 2015 Share Posted June 3, 2015 (edited) Techno Robbo! Very nice plugin. Thank you for your effort. I have 2 version, with or without color. I hope have done right. Edited January 24, 2020 by Seerose 2 Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
Red ochre Posted June 3, 2015 Share Posted June 3, 2015 Eli - The first one looks like it is highlighting the 'compressed' areas of a jpeg perhaps? ... but always keep your pencil sharp anyway! Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
TechnoRobbo Posted June 3, 2015 Author Share Posted June 3, 2015 Yup - jpeg's have patterned compression artifacts that get highlighted by plugins that enhance edges. 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...
Eli Posted June 3, 2015 Share Posted June 3, 2015 Thanks Red and TR. Is there a method to reduce those artifacts? If so could that be included in the filter? Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted June 4, 2015 Author Share Posted June 4, 2015 Version 1.3 Ready for Download v1.3 Retain Color and Invert Controls by BoltBait (a Dwarf Horde Collaboration) So go to one of BoltBaits Post and give him a +1 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...
BoltBait Posted June 4, 2015 Share Posted June 4, 2015 So go to one of BoltBaits Post and give him a +1 Haha! Thanks! Here's something to try: After running the plugin with both check boxes checked, you should get something that looks like colored chalk on an old blackboard. Then run this CodeLab script: // Name: HSV Invert // Submenu: Color // Author: BoltBait // URL: http://www.BoltBait.com // Keywords: hsv|invert|color // Title: BoltBait's HSV Quick Invert - v1.0 // Desc: Quickly invert H, S, or V in the HSV color space. #region UICode byte Amount1 = 0; // HSV Editing|Invert V|Invert S|Invert H|Maximize S|Maximize V #endregion void Render(Surface dst, Surface src, Rectangle rect) { for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { ColorBgra CurrentPixel = src[x,y]; HsvColor hsv = HsvColor.FromColor(CurrentPixel.ToColor()); int H = hsv.Hue; int S = hsv.Saturation; int V = hsv.Value; byte A = CurrentPixel.A; switch (Amount1) { case 0: V = 100-V; break; case 1: S = 100-S; break; case 2: H += 180; if (H>360) H -= 360; break; case 3: S = 100; break; case 4: V = 100; break; } CurrentPixel = ColorBgra.FromColor(new HsvColor(H,S,V).ToColor()); CurrentPixel.A = A; dst[x,y] = CurrentPixel; } } } 2 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Eli Posted June 4, 2015 Share Posted June 4, 2015 Hello BoltBait, Will there be a dll for the script? (I do not understand code) . Quote Link to comment Share on other sites More sharing options...
ReMake Posted June 4, 2015 Share Posted June 4, 2015 ...Will there be a dll for the script? (I do not understand code) . Today is not 1'st April, but still fun . ...So go to one of BoltBaits Post and give him a +1 Quote Link to comment Share on other sites More sharing options...
BoltBait Posted June 4, 2015 Share Posted June 4, 2015 No need to understand code in order to copy-and-paste that block of code into CodeLab. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Eli Posted June 5, 2015 Share Posted June 5, 2015 (edited) Thanks BoltBait, It really made me sweat the idea of using CodeLAb but I was so curious about the outcome of the script that I decided to try it . So this is the outcome : I added a little gray on another layer. Postedit: I am sorry TR, I just realized that charcoal is... BLACK. Edited June 5, 2015 by Eli 3 Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted June 5, 2015 Author Share Posted June 5, 2015 I am sorry TR, I just realized that charcoal is... BLACK At it's base this plugin has a charcoal sketch like result. But that was the outcome not the intent. I changed the description since it's obviously a tool like any other with no real rules on how you eventually use it. 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...
Eli Posted June 5, 2015 Share Posted June 5, 2015 It is funny how things evolve. Quote Link to comment Share on other sites More sharing options...
TechnoRobbo Posted June 5, 2015 Author Share Posted June 5, 2015 Version 1.4 Incorporates part of not all BoltBait's Pastel Effect for the full effect use BoltBait's Plugin. Ready for Download 3 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...
Maximilian Posted June 8, 2015 Share Posted June 8, 2015 (edited) I've found it to be quite convenient for producing line art of basic 3D models, like below http://smiles.kolobok.us/standart/derisive.gif http://smiles.kolobok.us/artists/just_cuz/JC_you_rock.gifhttp://smiles.kolobok.us/artists/just_cuz/JC_ThankYou.gif Edited October 23, 2022 by Maximilian 4 Quote Link to comment Share on other sites More sharing options...
Seerose Posted June 14, 2015 Share Posted June 14, 2015 Maximilian! Very pretty presentation. 1 Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi 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.