Jump to content

TechnoRobbo

Members
  • Posts

    1,740
  • Joined

  • Last visited

  • Days Won

    131

Everything posted by TechnoRobbo

  1. Nothing Compares to your work - Red You and me both brother. This ones pure "feel" thats why I called it a doodler.
  2. Red, The code traces the current color under the cursor in a anticlockwise fashion and deposits pixels along the edge until it creates a closed polygon, "Pen size" is used to control unwanted spillage. "Detail" - expands or limits the definition of the color being traced. That's the easy part - how to control it is pure Zen.The right combination for the intended effect is pure intuition.This is why I felt that Undo's were needed. After a \while you get a "feel" for what to do next to make the art.
  3. Thanks Seerose and pdnnoob Here's a video on how Wilkommen (and Autumn) were created http://youtu.be/fC9ivyWHpiw
  4. Amazing how a few kind words change your whole perspective.

  5. dug, Barbie, and Skull - Thank You for your kind words, it makes it all worth it.
  6. I got it done and tested faster than I thought: Version 1.2 - 16 Levels of Undo!!!!!! This is a you tube video on how i created the Mona Lina image below. I've included lots of comments If it needs more or you have any other questions feel free to ask. Best viewed ant Youtube in 1080p
  7. To ALL, First - thanks Second - Oceana and DrewDale got me thinking so I added an "undo" to the plugin. If you make a mistake click undo and the last portion drawn gets erased. so far only one level of undo. Created using transparent check-box. gradient layer as background and intermediate gaussian blur layer
  8. Oceana, Helen andBarbie - Thanks!! Drew - I used DistortThis!(perspective mode) and Colorizer HMS. Welsh - I got it....
  9. Oceana, Perhaps. That sounds like a good Idea. Skull ,Thank You
  10. I find MSDN (Microsoft Developers Network) indispensible: http://msdn.microsoft.com/en-us/library/vstudio/kx37x362.aspx
  11. Transparency = Relevance

  12. Technorobbo's DoodleMatic V1.4 A Dynamic Edge Finder Version 1.4 Optimized for Paint.Net 4.0 Version 1.3 Uses YUV Colorspace for more intuitive edge detection 1 Slider for detail selection. Adjust drawing Width Added Cursor http://forums.getpaint.net/index.php?/topic/27154-trs-doodlematic-v13-oct-9th-2013/?p=398438 Version 1.2 - 16 levels of Undo Version 1.1 Undo added Menu: Effects->Artistic Demo best viewed in 1080p at http://youtu.be/q_JgUFF0Peg Music by TechnoRobbo Here's a video on how Wilkommen (and Autumn) were created http://youtu.be/fC9ivyWHpiw music by TechnoRobbo(yes that's my falsetto) Willkommen Amsterdam used TR's Scatter to give that pastel look Autumn The Code Hidden Content: // Compiler options: /unsafe /optimize /debug- /target:library /out:"C:\Program Files\Paint.NET\Effects\TRsDoodleMatic.dll" using System; using System.Text; using System.Windows; using System.Reflection; using System.Windows.Forms; using PaintDotNet; using PaintDotNet.Effects; using PaintDotNet.IndirectUI; using PaintDotNet.PropertySystem; using System.Collections.Generic; using System.Drawing; using System.Drawing.Text; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("TRsDoodleMaticPlugin")] [assembly: AssemblyDescription("TRsDoodleMatic Plugin for Paint.NET. (Compiled by Code Lab v1.8)")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("TechnoRobbo")] [assembly: AssemblyProduct("TRsDoodleMaticPlugin")] [assembly: AssemblyCopyright("Copyright © TechnoRobbo")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.4.*")] namespace TRsDoodleMaticEffect { public class PluginSupportInfo : IPluginSupportInfo { public string Author { get { return "TechnoRobbo"; } } public string Copyright { get { return ((AssemblyCopyrightAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright; } } public string DisplayName { get { return ((AssemblyProductAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]).Product; } } public Version Version { get { return base.GetType().Assembly.GetName().Version; } } public Uri WebsiteUri { get { return new Uri("http://www.technorobbo.com"); } } } [PluginSupportInfo(typeof(PluginSupportInfo), DisplayName = "TRsDoodleMatic")] public class TRsDoodleMaticEffectPlugin : PropertyBasedEffect { public static string StaticName { get { return "TR's DoodleMatic"; } } public static Image StaticIcon { get { return null; } } public TRsDoodleMaticEffectPlugin() : base(StaticName, StaticIcon, SubmenuNames.Artistic, EffectFlags.Configurable) { instanceSeed = unchecked((int)DateTime.Now.Ticks); } public enum PropertyNames { Amount1, Amount2, Amount3, Amount4, Amount5, Amount6, Amount7, Amount8, Amount9 } [ThreadStatic] private static Random RandomNumber; private int randomSeed; private int instanceSeed; protected override PropertyCollection OnCreatePropertyCollection() { List<Property> props = new List<Property>(); props.Add(new DoubleProperty(PropertyNames.Amount1, 0.05, 0, 1)); props.Add(new Int32Property(PropertyNames.Amount2, 0, 0, 10)); props.Add(new DoubleVectorProperty(PropertyNames.Amount3, Pair.Create(0.0, 0.0), Pair.Create(-1.0, -1.0), Pair.Create(+1.0, +1.0))); props.Add(new Int32Property(PropertyNames.Amount4, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.PrimaryColor.B, EnvironmentParameters.PrimaryColor.G, EnvironmentParameters.PrimaryColor.R, 255)), 0, 0xffffff)); props.Add(new Int32Property(PropertyNames.Amount5, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.SecondaryColor.B, EnvironmentParameters.SecondaryColor.G, EnvironmentParameters.SecondaryColor.R, 255)), 0, 0xffffff)); props.Add(new Int32Property(PropertyNames.Amount6, 0, 0, 255)); props.Add(new BooleanProperty(PropertyNames.Amount7, false)); props.Add(new Int32Property(PropertyNames.Amount8, 0, 0, 255)); props.Add(new BooleanProperty(PropertyNames.Amount9, false)); return new PropertyCollection(props); } protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Amount1, ControlInfoPropertyNames.DisplayName, "Small Detail/Small Pen ---------------------------Large Detail/Full Page"); configUI.SetPropertyControlValue(PropertyNames.Amount1, ControlInfoPropertyNames.SliderLargeChange, 0.25); configUI.SetPropertyControlValue(PropertyNames.Amount1, ControlInfoPropertyNames.SliderSmallChange, 0.05); configUI.SetPropertyControlValue(PropertyNames.Amount1, ControlInfoPropertyNames.UpDownIncrement, 0.01); configUI.SetPropertyControlValue(PropertyNames.Amount2, ControlInfoPropertyNames.DisplayName, "Line Width"); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.DisplayName, "Doodle Pad (Hold CTRL to Doodle)"); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.SliderSmallChangeX, 0.05); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.SliderLargeChangeX, 0.25); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.UpDownIncrementX, 0.01); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.SliderSmallChangeY, 0.05); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.SliderLargeChangeY, 0.25); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.UpDownIncrementY, 0.01); Surface sourceSurface3 = this.EnvironmentParameters.SourceSurface; Bitmap bitmap3 = sourceSurface3.CreateAliasedBitmap(); ImageResource imageResource3 = ImageResource.FromImage(bitmap3); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.StaticImageUnderlay, imageResource3); configUI.SetPropertyControlValue(PropertyNames.Amount4, ControlInfoPropertyNames.DisplayName, "Doodle Color"); configUI.SetPropertyControlType(PropertyNames.Amount4, PropertyControlType.ColorWheel); configUI.SetPropertyControlValue(PropertyNames.Amount5, ControlInfoPropertyNames.DisplayName, "Paper Color"); configUI.SetPropertyControlType(PropertyNames.Amount5, PropertyControlType.ColorWheel); configUI.SetPropertyControlValue(PropertyNames.Amount6, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlType(PropertyNames.Amount6, PropertyControlType.IncrementButton); configUI.SetPropertyControlValue(PropertyNames.Amount6, ControlInfoPropertyNames.ButtonText, "Clear"); configUI.SetPropertyControlValue(PropertyNames.Amount7, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Amount7, ControlInfoPropertyNames.Description, "Transparent Paper"); configUI.SetPropertyControlValue(PropertyNames.Amount8, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlType(PropertyNames.Amount8, PropertyControlType.IncrementButton); configUI.SetPropertyControlValue(PropertyNames.Amount8, ControlInfoPropertyNames.ButtonText, "Undo - Erase Last"); configUI.SetPropertyControlValue(PropertyNames.Amount9, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Amount9, ControlInfoPropertyNames.Description, "Hide Cursor (Before pressing OK)"); return configUI; } private bool noskip = true; protected override void OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) { this.Amount1 = newToken.GetProperty<DoubleProperty>(PropertyNames.Amount1).Value; this.Amount2 = newToken.GetProperty<Int32Property>(PropertyNames.Amount2).Value; this.Amount3 = newToken.GetProperty<DoubleVectorProperty>(PropertyNames.Amount3).Value; this.Amount4 = ColorBgra.FromOpaqueInt32(newToken.GetProperty<Int32Property>(PropertyNames.Amount4).Value); this.Amount5 = ColorBgra.FromOpaqueInt32(newToken.GetProperty<Int32Property>(PropertyNames.Amount5).Value); this.Amount6 = (byte)newToken.GetProperty<Int32Property>(PropertyNames.Amount6).Value; randomSeed = Amount6; this.Amount7 = newToken.GetProperty<BooleanProperty>(PropertyNames.Amount7).Value; this.Amount8 = (byte)newToken.GetProperty<Int32Property>(PropertyNames.Amount8).Value; randomSeed = Amount8; this.Amount9 = newToken.GetProperty<BooleanProperty>(PropertyNames.Amount9).Value; noskip = true; base.OnSetRenderInfo(newToken, dstArgs, srcArgs); } protected override void OnCustomizeConfigUIWindowProperties(PropertyCollection props) { // Change the effect's window title props[ControlInfoPropertyNames.WindowTitle].Value = "TR's DoodleMatic - v1.4"; base.OnCustomizeConfigUIWindowProperties(props); } protected override unsafe void OnRender(Rectangle[] rois, int startIndex, int length) { if (length == 0) return; RandomNumber = GetRandomNumberGenerator(rois, startIndex); for (int i = startIndex; i < startIndex + length; ++i) { Render(DstArgs.Surface, SrcArgs.Surface, rois); } } private Random GetRandomNumberGenerator(Rectangle[] rois, int startIndex) { Rectangle roi = rois[startIndex]; return new Random(instanceSeed ^ (randomSeed << 16) ^ (roi.X << 8) ^ roi.Y); } #region User Entered Code // Submenu: Artistic // Name: TR's DoodleMatic // Title: TR's DoodleMatic - v1.4 // Author: TechnoRobbo // URL: http://www.technorobbo.com #region UICode double Amount1 = 0.05; // [0,1] Small Detail/Small Pen ---------------------------Large Detail/Full Page int Amount2 = 0; // [0,10] Line Width Pair<double, double> Amount3 = Pair.Create(0.0, 0.0); // Doodle Pad (Hold CTRL to Doodle) ColorBgra Amount4 = ColorBgra.FromBgr(0, 0, 0); // Doodle Color ColorBgra Amount5 = ColorBgra.FromBgr(0, 0, 0); // Paper Color byte Amount6 = 0; // [255] Clear bool Amount7 = false; // [0,1] Transparent Paper byte Amount8 = 0; // [255] Undo - Erase Last bool Amount9 = false; // [0,1] Hide Cursor (Before pressing OK) #endregion byte CLS = 255; byte UndoButton = 0; byte UndoCount = 0; byte UndoBase = 0; bool UndoReady = false; bool drawn = false; bool holdimage = false; Bitmap hold = new Bitmap(35, 35); Rectangle orect = new Rectangle(); void YUV(ColorBgra z, ref int[] y) { int[] x = { z.R, z.G, z.B }; y[0] = ((66 * x[0] + 129 * x[1] + 25 * x[2] + 128) >> 8) + 16; y[1] = ((-38 * x[0] - 74 * x[1] + 112 * x[2] + 128) >> 8) + 128; y[2] = ((112 * x[0] - 94 * x[1] - 18 * x[2] + 128) >> 8) + 128; } void Render(Surface dst, Surface src, Rectangle rect) { if (noskip) { noskip = false; try { Bitmap bmp = new RenderArgs(dst).Bitmap; Graphics g = new RenderArgs(dst).Graphics; Graphics z = Graphics.FromImage(hold); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; z.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; z.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; //erase cursor if (holdimage) { g.DrawImage(hold, orect, new Rectangle(0, 0, orect.Width, orect.Height), GraphicsUnit.Pixel); } holdimage = false; double detail = Amount1 * 126 + 1; double psize = Amount1 * .99 + 1; if (CLS != Amount6) { holdimage = false; CLS = Amount6; if (Amount7) { dst.Clear(ColorBgra.FromBgra(0, 0, 0, 0)); } else { dst.Clear(Amount5); } } Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int[] offx = { 0, -1, -1, -1, 0, 1, 1, 1 }; int[] offy = { -1, -1, 0, 1, 1, 1, 0, -1 }; bool init = true; System.Drawing.Point Start = new System.Drawing.Point((int)((1 + Amount3.First) / 2 * sel.Width), (int)((1 + Amount3.Second) / 2 * sel.Height)); int[] KeyColor = new int[3]; YUV(src.GetBilinearSampleClamped(Start.X, Start.Y), ref KeyColor); System.Drawing.Point NowXY = Start; int direction = 2; bool draw = Control.ModifierKeys == Keys.Control; //========UNDO=============================== string path = System.IO.Path.GetTempPath(); if (drawn != draw) {//check for draw start if (draw && !drawn) { UndoCount++; UndoCount &= 15; UndoBase++; if (UndoBase > 16) { UndoBase = 16; } Bitmap bmp1 = new RenderArgs(dst).Bitmap; bmp1.Save(path + @"TRDM" + UndoCount.ToString() + ".bmp"); bmp1.Dispose(); UndoReady = true; } drawn = draw; } //=========================// if (UndoButton != Amount8) { UndoButton = Amount8; if (UndoReady & (UndoBase > 0)) { UndoBase--; Bitmap bmp2 = new Bitmap(path + @"TRDM" + UndoCount.ToString() + ".bmp"); UndoCount--; UndoCount &= 15; Graphics g1 = new RenderArgs(dst).Graphics; g1.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g1.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; g1.DrawImage(bmp2, 0, 0); g1.Dispose(); bmp2.Dispose(); } } //========UNDO=============================== Rectangle PenSize = sel; if (Amount1 != 1) { PenSize.Width = (int)((double)sel.Width * psize); PenSize.Height = (int)((double)sel.Height * psize); PenSize.X = Start.X - PenSize.Width / 2; PenSize.Y = Start.Y - PenSize.Height / 2; } int csize = Int32Util.Clamp(sel.Width / 80, 10, 30); Rectangle crect = new Rectangle(Start.X - csize / 2, Start.Y - csize / 2, csize, csize); if (draw) { if (holdimage) { g.DrawImage(hold, orect, new Rectangle(0, 0, orect.Width, orect.Height), GraphicsUnit.Pixel); } do { int[] CP = new int[3]; YUV(src.GetBilinearSampleClamped(Start.X, Start.Y), ref CP); double dist = Math.Sqrt((CP[0] - KeyColor[0]) * (CP[0] - KeyColor[0]) + (CP[1] - KeyColor[1]) * (CP[1] - KeyColor[1]) + (CP[2] - KeyColor[2]) * (CP[2] - KeyColor[2])); bool match1 = ((int)dist > detail); if (match1 | !sel.Contains(Start)) { init = false; Start.Y++; NowXY = Start; break; } Start.Y--; } while (init); int timeout = sel.Width * 2 + sel.Height * 2; do { for (int i = -2; i < 6; i++) { int adjust = (i + direction + 8) % 8; System.Drawing.Point pt = new System.Drawing.Point(offx[adjust] + NowXY.X, offy[adjust] + NowXY.Y); if (pt == Start) { NowXY = pt; break; } ColorBgra CP = src.GetBilinearSampleClamped(pt.X, pt.Y); int[] CO = new int[3]; YUV(CP, ref CO); double dist = Math.Sqrt((CO[0] - KeyColor[0]) * (CO[0] - KeyColor[0]) + (CO[1] - KeyColor[1]) * (CO[1] - KeyColor[1]) + (CO[2] - KeyColor[2]) * (CO[2] - KeyColor[2])); bool match = ((int)dist > detail); if (sel.Contains(pt) && match) { NowXY = pt; if (PenSize.Contains(NowXY)) { if (Amount2 != 0) { using (Pen BP = new Pen(Amount4, (float)Amount2)) { g.DrawEllipse(BP, NowXY.X, NowXY.Y, 1, 1); } } else { CP = Amount4; dst[NowXY.X, NowXY.Y] = CP; } } direction = adjust; break; } } timeout--; } while ((NowXY != Start) && (timeout > 0)); } //save new cursor eraser z.DrawImage(bmp, new Rectangle(0, 0, crect.Width + 2, crect.Height + 2), new Rectangle(crect.Left, crect.Top, crect.Width + 2, crect.Height + 2), GraphicsUnit.Pixel); holdimage = true; //store erase location orect = new Rectangle(crect.Left, crect.Top, crect.Width + 2, crect.Height + 2); //hide cursor or not================================================================= if (!Amount9) { Pen cPen = new Pen(Color.Blue, 2); g.DrawEllipse(cPen, new Rectangle(crect.Left + 2, crect.Top + 2, crect.Width - 2, crect.Height - 2)); cPen = new Pen(Color.Yellow, 2); g.DrawEllipse(cPen, new Rectangle(crect.Left + 1, crect.Top + 1, crect.Width - 1, crect.Height - 1)); cPen.Dispose(); } g.Dispose(); bmp.Dispose(); z.Dispose(); } catch (Exception e) { } } else { dst[0, 0] = dst[0, 0]; } } #endregion } } TRsDoodleMatic.zip
  13. So the Bartender says to the horse, "Hey Buddy, Why the long face?"

  14. Version 1.2 adds edge clipping for larger brush size (200 pixels)
  15. I guess it's relevant now Version 1.1 Uploaded - works correctly with Alpha Cahnnel This image took 20 minutes I guess at this point it's best to explain: How It Works The plugin is a photographic realization of a digital lowpass audio filter. In Laymen's terms - its a buffer that resists change. As you move the buffer over the image it collects a certain percentage of the image from the buffer's location and blends it into the buffer.Then the program deposits the content of the buffer. Elements of the background are therefore,dragged along into other areas of the background.
  16. Just when I thought I was out...they pull me back in

  17. your absolutely right it was not intended to work with alpha. its basically turns your image into a fingerpainting canvas
  18. Where can I find documentation for the OptionBasedLibrary
  19. Everyone should be downloading this plugin! Every time I start a render it's like opening a present. Guess Who?
  20. Rotate/Zoom should do it if you start with all the characters over lapped and aligned on the lower half of seprate layers. That way you can avoid freaky distortion.
×
×
  • Create New...