Search the Community

Showing results for tags 'stylize'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Information
    • Forum Rules
    • Paint.NET Search
    • Official Paint.NET website
    • Help Files (the official paint.net documentation)
  • Paint.NET
    • Paint.NET Discussion and Questions
    • The Pictorium
    • Tutorials - Publishing ONLY!
    • Competitions
    • Plugins - Publishing ONLY!
    • Troubleshooting & Bug Reports
  • Off-Topic
    • Grand Theory of Everything
  • Paint.NET Programming / Development
    • Plugin Developer's Central
    • Preview Center
    • Translation and Localization

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


AIM


MSN


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 22 results

  1. This effect is based on the PS Emboss effect by @Cookies and is an improved version of it. You can find it in Effects -> Stylize -> Emboss+ Emboss+.zip For comparison, I used a smaller copy of the image from the original post by @Cookies: PS Emboss result with default settings: Photoshop's Emboss result with the same settings as the PS Emboss: Emboss+ result with the same settings as the PS Emboss: A few more images to compare with the following settings: Angle - 135, Height - 10, Amount - 110. Original image: PS Emboss: Photoshop's Emboss: Emboss+: In my opinion, the result of Emboss+ is closer to the Photoshop Emboss result.
  2. I was playing around with the Steganography plugin in order to improve the quality of the hidden images. I ended up adding in Floyd-Steinberg dithering to the hidden image which greatly improved the quality of the hidden image. Dithering reduces the number of colors of an image by choosing the closest color in the palette for a pixel, then taking the difference between that chosen color and the original color and spreads that difference out to the nearby pixels that haven't been processed yet. More info on dithering here: http://en.wikipedia.org/wiki/Error_diffusion Normally, paint.net breaks up your effect into multiple threads to complete the job faster. But, because of the way dithering works, the entire process needs to be done in a single thread. CodeLab could not handle making effects work this way. So, I modified CodeLab to add the option to the build screen. Then, I got to thinking, this might make a good example of the new CodeLab option for forcing the effect to run in a single thread. So, here ya go... Download here (Paint.NET 4.0+): https://forums.getpaint.net/index.php?/topic/32048-v Once installed, you can find it in your Effects > Stylize menu. Floyd-Steinberg Dithering Examples: Dithering Matrix (2 Options) Floyd-Steinberg uses the following dithering matrix:    - # 7 where #=pixel being processed, -=previously processed pixel 3 5 1 and pixel difference is distributed to neighbor pixels Note: 7+3+5+1 = 16    Custom uses the following dithering matrix:    - # 8 4 where #=pixel being processed, -=previously processed pixel 4 8 4 1 and pixel difference is distributed to neighbor pixels 0 2 1 0 by the weights shown. Note: 8+4+4+8+4+1+2+1 = 32    The Floyd-Steinberg matrix is not the only dithering matrix out there. The Jarvis, Judice, and Ninke matrix uses a total of 48. I designed the custom matrix because I wanted to only use factors of 2 in the math. By using only factors of 2, the math is simplified to bit shifts... so it runs really fast. I was actually surprised that no one had defined such a matrix. (Or, if they have, I could not find a reference to it on the Internet.) Palettes (6 Options) Several palettes are available including: Black & White 4 shades of gray 8 shades of gray 4 Colors CMYK This is surprisingly good. 16 Color Original Windows Palette 16 Color custom palette that I designed myself I designed my own 16 color palette because I felt that the 16 color Window's palette didn't do a very good job dithering people. That palette lacks any brown colors. I also didn't like the blues that were chosen. So, I adjusted the blues and removed one blue and one green color to add in some browns. Of course, there are pictures where the Windows palette will render a better picture than my custom palette. But, for most pictures, I've found that my palette does a better job.    Programmer's Section CodeLab Options CodeLab contains an option on the "save as dll" screen to force the effect to run as a single thread. Normally this is not a good idea because it slows down your effect. But, you can see here that it is necessary to process each row in order because values are being added to future pixels. This option can be added to your CodeLab script by using the following comment: // Force Single Threaded    If you want to see this "comment" in action, here is the complete example...       Complete Source Code Here is the complete CodeLab script for the dithering effect you can download above. // Title: BoltBait's Floyd-Steinberg Dithering Effect v1.0 // Author: BoltBait // Name: Floyd-Steinberg Dithering // Submenu: Stylize // Force Single Threaded // Keywords: Floyd|Steinberg|Dithering|Dither|Error|Diffusion // Desc: Dither selected pixels // URL: http://www.BoltBait.com/pdn #region UICode byte Amount1 = 0; // Palette type|Black & White|4 shades of gray|8 shades of gray|4 Colors CMYK|16 Color Original Windows Palette|16 Color Custom Palette byte Amount2 = 0; // Dithering method|Floyd-Steinberg (1/16)|Custom (1/32) #endregion byte PlusTruncate(byte a, int b) { int c = a + b; if (c < 0) return 0; if (c > 255) return 255; return (byte)c; } Color FindNearestColor(Color color, Color[] palette) { int minDistanceSquared = 255 * 255 + 255 * 255 + 255 * 255 + 1; byte bestIndex = 0; for (byte i = 0; i < palette.Length; i++) { int Rdiff = color.R - palette[i].R; int Gdiff = color.G - palette[i].G; int Bdiff = color.B - palette[i].B; int distanceSquared = Rdiff * Rdiff + Gdiff * Gdiff + Bdiff * Bdiff; if (distanceSquared < minDistanceSquared) { minDistanceSquared = distanceSquared; bestIndex = i; if (minDistanceSquared < 1) break; } } return palette[bestIndex]; } // Setup for using pixel op private UnaryPixelOps.Desaturate desaturateOp = new UnaryPixelOps.Desaturate(); // Here is the main render loop function void Render(Surface dst, Surface src, Rectangle rect) { // Call the copy function dst.CopySurface(src,rect.Location,rect); Color[] DitheringPalette = new Color[] { Color.Black, Color.White }; switch(Amount1) { case 0: // black and white DitheringPalette = new Color[] { Color.Black, Color.White }; break; case 1: // 4 shades of gray DitheringPalette = new Color[] { Color.White, Color.Silver, Color.Gray, Color.Black }; break; case 2: // 8 shades of gray DitheringPalette = new Color[] { Color.FromArgb(0,0,0), Color.FromArgb(36,36,36), Color.FromArgb(72,72,72), Color.FromArgb(108,108,108), Color.FromArgb(144,144,144), Color.FromArgb(180,180,180), Color.FromArgb(216,216,216), Color.FromArgb(255,255,255) }; break; case 3: // 4 color: CMYK DitheringPalette = new Color[] { Color.White, Color.Cyan, Color.Yellow, Color.Magenta, Color.Black }; break; case 4: // The original 16 color Windows palette DitheringPalette = new Color[] { Color.White, Color.Silver, Color.Gray, Color.Black, Color.Red, Color.Maroon, Color.Yellow, Color.Olive, Color.Lime, Color.Green, Color.Aqua, Color.Teal, Color.Blue, Color.Navy, Color.Fuchsia, Color.Purple }; break; case 5: // Custom 16 color palette DitheringPalette = new Color[] { Color.White, Color.LightGray, Color.FromArgb(77,77,77), Color.Black, // grays Color.Red, Color.Maroon, Color.Yellow, Color.Chocolate, Color.Brown, Color.LimeGreen, Color.DarkGreen, // red brown green Color.LightSkyBlue, Color.Blue, Color.FromArgb(79,79,249), Color.FromArgb(255,192,255), Color.Purple }; // blue purple break; } Color BestColor; ColorBgra BestColora; // Now in the main render loop, the dst canvas has a copy of the src canvas for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { if (Amount2==0) // Floyd-Steinberg Dithering { ColorBgra CurrentPixel = dst[x,y]; byte A = CurrentPixel.A; if (Amount1 < 3) CurrentPixel = desaturateOp.Apply(CurrentPixel); Color currentPixel = CurrentPixel.ToColor(); BestColor = FindNearestColor(currentPixel, DitheringPalette); BestColora = ColorBgra.FromColor(BestColor); BestColora.A = A; // Floyd-Steinberg Dithering int errorR = currentPixel.R - BestColor.R; int errorG = currentPixel.G - BestColor.G; int errorB = currentPixel.B - BestColor.B; // - * 7 where *=pixel being processed, -=previously processed pixel // 3 5 1 and pixel difference is distributed to neighbor pixels // Note: 7+3+5+1=16 so we divide by 16 (>>4) before adding. if (x + 1 < rect.Right) { dst[x + 1, y + 0] = ColorBgra.FromBgra( PlusTruncate(dst[x + 1, y + 0].B, (errorB * 7) >> 4), PlusTruncate(dst[x + 1, y + 0].G, (errorG * 7) >> 4), PlusTruncate(dst[x + 1, y + 0].R, (errorR * 7) >> 4), dst[x+1,y].A ); } if (y + 1 < rect.Bottom) { if (x - 1 > rect.Left) { dst[x - 1, y + 1] = ColorBgra.FromBgra( PlusTruncate(dst[x - 1, y + 1].B, (errorB * 3) >> 4), PlusTruncate(dst[x - 1, y + 1].G, (errorG * 3) >> 4), PlusTruncate(dst[x - 1, y + 1].R, (errorR * 3) >> 4), dst[x-1,y+1].A ); } dst[x - 0, y + 1] = ColorBgra.FromBgra( PlusTruncate(dst[x - 0, y + 1].B, (errorB * 5) >> 4), PlusTruncate(dst[x - 0, y + 1].G, (errorG * 5) >> 4), PlusTruncate(dst[x - 0, y + 1].R, (errorR * 5) >> 4), dst[x-0,y+1].A ); if (x + 1 < rect.Right) { dst[x + 1, y + 1] = ColorBgra.FromBgra( PlusTruncate(dst[x + 1, y + 1].B, (errorB * 1) >> 4), PlusTruncate(dst[x + 1, y + 1].G, (errorG * 1) >> 4), PlusTruncate(dst[x + 1, y + 1].R, (errorR * 1) >> 4), dst[x+1,y+1].A ); } } } else // Custom Dithering { ColorBgra CurrentPixel = dst[x,y]; byte A = CurrentPixel.A; if (Amount1 < 3) CurrentPixel = desaturateOp.Apply(CurrentPixel); Color currentPixel = CurrentPixel.ToColor(); BestColor = FindNearestColor(currentPixel, DitheringPalette); BestColora = ColorBgra.FromColor(BestColor); BestColora.A = A; // Custom 1/32 Dithering int errorR = currentPixel.R - BestColor.R; int errorG = currentPixel.G - BestColor.G; int errorB = currentPixel.B - BestColor.B; // - - # 8 4 where *=pixel being processed, -=previously processed pixel // 0 4 8 4 1 and pixel difference is distributed to neighbor pixels // 0 0 2 1 0 if (x + 1 < rect.Right) { dst[x + 1, y + 0] = ColorBgra.FromBgra( PlusTruncate(dst[x + 1, y + 0].B, errorB >> 2), PlusTruncate(dst[x + 1, y + 0].G, errorG >> 2), PlusTruncate(dst[x + 1, y + 0].R, errorR >> 2), dst[x+1,y].A ); } if (x + 2 < rect.Right) { dst[x + 2, y + 0] = ColorBgra.FromBgra( PlusTruncate(dst[x + 2, y + 0].B, errorB >> 3), PlusTruncate(dst[x + 2, y + 0].G, errorG >> 3), PlusTruncate(dst[x + 2, y + 0].R, errorR >> 3), dst[x+2,y].A ); } if (y + 1 < rect.Bottom) { if (x - 1 > rect.Left) { dst[x - 1, y + 1] = ColorBgra.FromBgra( PlusTruncate(dst[x - 1, y + 1].B, errorB >> 3), PlusTruncate(dst[x - 1, y + 1].G, errorG >> 3), PlusTruncate(dst[x - 1, y + 1].R, errorR >> 3), dst[x-1,y+1].A ); } dst[x, y + 1] = ColorBgra.FromBgra( PlusTruncate(dst[x, y + 1].B, errorB >> 2), PlusTruncate(dst[x, y + 1].G, errorG >> 2), PlusTruncate(dst[x, y + 1].R, errorR >> 2), dst[x,y+1].A ); if (x + 1 < rect.Right) { dst[x + 1, y + 1] = ColorBgra.FromBgra( PlusTruncate(dst[x + 1, y + 1].B, errorB >> 3), PlusTruncate(dst[x + 1, y + 1].G, errorG >> 3), PlusTruncate(dst[x + 1, y + 1].R, errorR >> 3), dst[x+1,y+1].A ); } if (x + 2 < rect.Right) { dst[x + 2, y + 1] = ColorBgra.FromBgra( PlusTruncate(dst[x + 2, y + 1].B, errorB >> 5), PlusTruncate(dst[x + 2, y + 1].G, errorG >> 5), PlusTruncate(dst[x + 2, y + 1].R, errorR >> 5), dst[x+2,y+1].A ); } } if (y + 2 < rect.Bottom) { dst[x, y + 2] = ColorBgra.FromBgra( PlusTruncate(dst[x, y + 2].B, errorB >> 4), PlusTruncate(dst[x, y + 2].G, errorG >> 4), PlusTruncate(dst[x, y + 2].R, errorR >> 4), dst[x,y+2].A ); if (x + 1 < rect.Right) { dst[x + 1, y + 2] = ColorBgra.FromBgra( PlusTruncate(dst[x + 1, y + 2].B, errorB >> 5), PlusTruncate(dst[x + 1, y + 2].G, errorG >> 5), PlusTruncate(dst[x + 1, y + 2].R, errorR >> 5), dst[x+1,y+2].A ); } } } dst[x,y] = BestColora; } } } Here is the palette file used for dithering: Enjoy! __________________________
  3. This effect is a result of a writing by me CodeLab - First Steps (Neon Edges) tutorial. You can find it: Effects -> Stylize -> Neon Edges NeonEdges.zip (Previously downloads: 3196) This effect is simulate the neon glow of edges into the image. It allows you to set the line thickness and the intensity of its glow. It is also possible the changing colors of the lines using the hue and saturation. With check box Eliminate the dark areas, you can convert the dark areas of the image to the transparency. This can be useful if you wish to keep this image on any background. For example, like this: Before: After, with a dark blue background:
  4. Description: This plugin allows you to reduce the number of colors in an image with the help of eleven error diffusion dithering algorithms. You are able to choose one of the four software palettes or to use automatically generated palette with specified size. You can also enable "Serpentine scanning" to alternate scanning direction between lines. Unfortunately, these algorithms do not work quickly due to single-threadedness. The advantage of this plugin is that it correctly works with any selection. Plugin: Effects > Stylize > Error diffusion dithering Examples: Github: https://github.com/PavielKraskouski/PaintDotNetPlugins/tree/master/ErrorDiffusionDithering Download: ErrorDiffusionDithering.dll
  5. I made my version of 3D Heightmap plugin. New version 1.3 has now light angle option and updated names of settings. How plugin works: Imagine that you are looking at uneven surface - heightmap (image in PDN). Lightness of each pixel represents it's height. You can choose from where is light coming and you can adjust the angle of light. Plugin generates how will heightmap look with your settings. It generates lightness of each pixel by calculating at which angle it is from next pixel and generating lightness of pixel form angle. How to use it: Light direction - Direction from which is light coming. Brightness - Angle from which is light coming. Contrast - Strength of light. Shadows - Turns on/off shadows. Replace Alpha - If you have image with transparent parts, this changes them all to one value. Replace Alpha with - Value, to which change all Alpha in image. Plugin is in Stylize submenu. Images before: Images after: Just ask if you want something (previous versions, code, ...) . Heightmap v1.3.zip
  6. Effect->Stylize->Edge Detect+ Download: https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/ (Copy the file ArgusPDN.EdgeDetect.dll to the paint.net/Effects folder) This effect uses an edge detection algorithm. It draws edges with given colors and sets the other pixels to transparent. I haven't had any good idea for the name, so I called it Edge Detection for now, the (Argus) is simply to make it better distinguishable from the built in Edge Detect effect. If anyone has an idea for a better name, feel free to share it ? UI Explanation (See example below): Lower Threshold: All pixels with values (Structur Tensor Eigenvalues) below this threshold are fully transparent: Higher Threshold --> Less Edges detected Upper Threshold: All pixels with values above this threshold are fully opaque. The range of "good" values really depends on the image. For hard edges (extreme case: black line on white), "good" values may go up to 1, for softer edges (as typically found in photographes), "good" values will usually be below 0.2 Color/Color2/Angle/Hue Direction: Edges with a normal angle the same as the chosen Angle are drawn in the color set in Color, edges with a normal angle perpendicular to Angle are drawn in the color set in Color2, in between the color is interpolated between Color and Color2. Hue Direction determines how the Hue value is interpolated. Difference Filter: The Kernel used to get the image derivates in x and y direction. I have yet to encounter a situation where I needed to change this value. If you change this value, a lot of calculations have to be redone. Some time may pass before you see something happening. Smoothing Radius: As expected, smoothes the output. Performance: Calculating initial values (Structur Tensors) may take some time, therefore, depending on the selection size, it may take some time after the effect dialog pops up before you can see something happening. If you change the value "Difference Filter" these calculations have to be redone. Smoothing is also somewhat expensive, which you can see if you change the smoothing radius. Intermediate values (Structur Tensors, eigenvalues of smoothed Tensors) are held in memory so re-rendering the output for different Threshold/Color/Angle values is fast. The cost for that is memory usage: Roughly 24 bytes per Pixel are used (excluding the memory used for the source and destination surface).
  7. Tone Gradient Angle (new July '17) Name: TGAngle (Tone Gradient Angle)* Description: Shows the relative angle of the tone gradient giving various emboss effects. Menu: Stylize Original release date: 10th July 2017 Author: Red ochre (John Robbins) .dll name: TGAngle Compatibility: Tested on Pdn3.5.11 and latest Pdn4 version. TGAngle.zip Firstly let me thank MJW! - I used the super-sampling techniques he showed me when writing 'Aardvark'. There are already similar effects available but the AAsmoothing and colouring blend choices should make this useful too. Run this on a layer with an image that has some variation in tone. The built-in 'Clouds' is good to test on. So are photographs but you will get better results if you resize the image to a reasonable size - say less than 1000 pixels (max side). Do try the metallic colouring options too!(These were designed to work with the colouring slider at halfway but do experiment). Hopefully you should see some screen shots below (image hosts permitting) that should give you some ideas. Please show me what you can create with it! *(Tone Gradient Magnitude gives good outline effects too - but I haven't finished writing that yet).
  8. 3D Heightmap Plugins v1.0 Download Made with CodeLab by BoltBait. Hey all! This is my first plug-in for Paint.NET. UPDATE: This plug-in has received a much-needed update! New features are listed below, also another plug-in is available! Diffuse Plug-in (Effects -> Stylize -> Diffuse) Description: This plug-in is very similar to Emboss in what it does. What this plug-in does, is it takes the current image as a height map, shines a light on it, and returns the intensity of reflected rays as another image. Examples: Various spheres with the diffuse plug-in applied on them. This is demonstrating the full movement capabilities that you have. Notice the center sphere. The above image was rendered 49 times under different settings. Some post processing was applied to create the alpha around each sphere. The center sphere had the light pitch at 90, right above the image. The next series had light pitch at 45. The third series had light pitch at 0, in line with the image. The last outer series had light pitch at -45, underneath the image! Each sphere in the above image was rendered from this image: It looks a lot like nonsense doesn't it? Maybe this image makes more sense: The former image is really a higher detail heightmap than the latter. To create the latter, I took the red channel of the former image and made it grayscale. Anything you can draw on Paint.Net will work. (old image) Specular Highlight Plug-In (Effects -> Stylize -> Specular) Description: This plug-in is very similar to the diffuse plug-in, but it's different in that it creates a highlight on the image, to give it a shiny effect, almost like gloss or metal. That's what a highlight looks like if on a pure black sphere. Combine this with the diffuse plug-in and you can make many 3d looking objects, even chrome-like! Features: Light source with 360 degrees of movement around and 180 degrees above and (NEW) below the image Pixel "Scaling" -- If your image comes out too short or too tall along the "Z-axis", you can scale the pixels of your image down, so that the highlights and shadows are balanced. (NEW) High quality settings allow your image to remain crisp and smooth if a correct type of heightmap is supplied. (NEW) Added specular highlight plug-in to create specular highlights on a heightmap! (NEW) The original plug-in (Was Illuminate, now Diffuse) is now much faster than before (I was rendering the whole image for each thread XD...about many times unnecessary. XD). Seamlessness! EDIT: CodeLab seems to disallow input of decimal values. This work-around changes the inputs so that it's a percent input, instead of decimal scale input. Not anymore, these plug-ins now has support for 2 decimal places with CodeLab. I hope that with these plug-ins comes a great contribution to the community.
  9. Radius Corners This is an continuation of @dan9298's abandoned 'Radius Fill Corners' plugin. Effects -> Stylize -> Radius Corners Features Creates rounded corners on your image at an adjustable radius. Automatically sets the maximum radius size allowed (based on half the size of the shortest side of the canvas); defaults to a quarter size Fill the background with transparency or a custom color Changelog v1.6 (July 8, 2018) Improved: Better performance when increasing the Margin value Changed: Moved the Anti-aliasing button directly under the Radius slider v1.5 (Sept 10, 2016) Added: There is now an option for a margin. v1.4 (Dec 1, 2015) Fixed: The dynamic values on the Radius slider (Max & Default) now recognize selections v1.3 (Feb 28, 2015) Added: Anti-aliasing! Changed: Plugin is now called Radius Corners (the Fill function is not important enough to be in the name ) Changed: Moved to the Stylize Submenu (same reason as above) Fixed: Right and bottom edges were off by 1px v1.2 (Feb 26, 2015) Changed: Replaced the old WinForms UI with a fancy IndirectUI one Changed: Replaced the Primary Color & Secondary Color options with a Color Wheel (which defaults to the primary color) Changed: Instead of having the default Radius Size at 50, it is now set to a quarter of the size of the shortest side of the canvas New: Metadata was added for the 'Plugin Browser' v1.1 by dan9298 (Nov 21, 2008) Prevent the radius from exceeding half the size of the shortest side of the canvas v1.0 by dan9298 (Nov 9, 2008) Initial release Download RadiusFillCorners.zip Source Code Source files and Git history
  10. Star Glow Plugin What's this? This is a plugin under Effect/Stylize menu. You should use it to add some shiny glow to your image. Faster than the sparkles effect, it changes the value of the pixels instead of drawing lines or circles. It just offers the possilibity to select the 8 radius to be on/off... Download the DLL Plugin StarGlow.dll Here is the DLL The MadJik's All plugins package is available ! http://forums.getpaint.net/index.php?showtopic=7186 How to install Close Paint.net Classic version of Paint.net Unzip and (re)place the DLL in your Effect folder usually: C:/Program Files/Paint.NET/Effects Microsoft Store version of Paint.net Unzip and (re)place the DLL in your Effect folder usually: /My Documents/paint.net App Files/Effects/ You have to adapt for your language My Documents The User interface This plugin is added to the menu Effects, submenu Stylize. Mini / Maxi : set the range of values for the luminosity to test. Each color found on the image between mini and maxi will be a source of a glow. Red / Green / Blue : set the color chanel to test or not. Ray/Diag Up/Down/Left/Right: check the box to draw the described ray. Black: check the box to draw the ray in black, instead white. Examples: Model / Result : Model / Result :
  11. This is a CodeLab port of @harold's NormalMapPlus plugin. It's functionally identical, except for some fixes, the slider controls having an extra decimal place (due to the way CodeLab works), and the addition of a brief Help menu. Though the code is functionally the same, it was somewhat rewritten. It's in the Stylize submenu. The fixes are: 1) The ROI boundary pixels are handled correctly. 2) The normals are computed at the correct positions, rather than being shifted one pixel left. 3) The JIT compiler optimization crash doesn't occur. (The crash is almost certainly not due to a bug in the original plugin code, and will probably be fixed in the JIT compiler soon.) Here is the DLL (Version 1.4): NormalMapPlus.zip Here is the code: EDIT 01 AUG 1017: Moved to Stylize window. Changed version to 1.4.
  12. Varicose 2 What's this? This is an original plugin made by @jchunn in year 2008. Having a need for a specific use of varicose and as the source code is available, I started some improvements to this effect. I PMed to @jchunn to ask if I could rework this code so... here we are! Original plugin could still be found here. Still interesting as it is a rare plugin in VB! https://forums.getpaint.net/topic/8179-varicose/ What does it do? Define a number of starting points on the top of the image then draw a “vein” to the bottom. Veins aren’t straight they move slightly (and randomly) to the left or the right. They could merge when they meet. They could split randomly. A vein is made of two edges (left and right) 50% transparent and a middle section 75% transparent. Left edge uses primary color, Right edge uses secondary color, middle section is a blend between primary and secondary colors. The vein is also blended with the image of the canvas with the intensity. What's new in this version? . Changed to C# (instead Visual Basic) . Added help and . Random possibility to divide the lines (not only merging). . Quality slider (anti-aliasing) ... . Frequency is the number of starting points (if the width is enough). . Reseed button, 0=new reseed at each run, any value=unique sequence of random values. . Shiny line (add a single pixel white line before the right edge) . Edges thickness ==> Effect submenu: Stylize Download it! Plugin Varicose2.dll Here is the DLL http://jcljay.free.fr/pdn/Varicose2.zip Here is the zip of Sources http://jcljay.free.fr/pdn/Varicose2SRC.zip The MadJik's All plugins package is available! http://forums.getpaint.net/index.php?showtopic=7186 How to install Close Paint.net Classic version of Paint.net Unzip and (re)place the DLL in your Effect folder usually: C:/Program Files/Paint.NET/Effects (please reverse / for correct path) Microsoft Store version of Paint.net Unzip and (re)place the DLL in your Effect folder usually: My Documents/paint.net App Files/Effects (please reverse / for correct path) You have to adapt for your language My Documents How to use it Select the primary and secondary colors you want for the veins. Then run the effect other an image or on a new empty layer. Veins are vertical going from the top to the bottom. The User interface This plugin is added to the menu Effects, submenu Stylize. Use Primary and Secondary Colors Left edge uses the primary color and right edge uses secondary color. Uncheck to use Black (left edge) and White (right edge). Frequency Number of start points. It could be less when if the width of the selection isn’t sufficient. Width Set the width of the vein. This size is shared by the two edge and the middle section. Thickness of the edges Same value for the two edges. Change the width of the edges. Chance of splitting Percentage of chance (random) to start a new vein on each line. Reseed Set the start of a serial random numbers. Zero is a new serial each time (full random). Intensity Set the level of transparency of the edges. The middle section is a half of the edge level. Add a shiny line Check to add a single pixel white line before the right edge. Quality (AA) Set the level of quality (antialiasing). It applies only where there is a vein. Other areas of the image remain unchanged. The Examples: Voilà! Enjoy! Let me see what you could do with it!
  13. Tone Gradient Magnitude (new July '17) Name: TGMagnitude (Tone Gradient Magnitude) Description: Shows the magnitude of the tone gradient giving various outline effects. Menu: Stylize Original release date: 22nd July 2017 Author: Red ochre (John Robbins) .dll name: TGMagnitude Compatibility: Tested on Pdn3.5.11 and latest paint.net4 version (4.0.17). TGMagnitude.zip The code for this is closely related to TGAngle and also makes use of MJW's ideas (Thanks again!). It creates outlines in proportion to the change in tone, giving results superficially similar to the Artistic effects 'Ink sketch' and 'Pencil sketch'. I have added the ability to lower the background opacity, hopefully making it useful as a mask to isolate objects. This also means you can place any background you wish on a layer below. I've had good results using it on photos but if you find other uses please do post. My example images should be below and I'd love to see what you can make using it.
  14. This is similar to other plugins out there (since there are about 8 million of them on this site) Curtis' Dots, for one... but that one doesn't use path gradients. Anyway it's my first plugin using GDI+ (thanks to Red ochre for pointing me in that direction) and done entirely in CodeLab, my favorite 'plugin'. ...and not much to do with dot-matrix printers, if anyone remembers them... DotMatrix.zip (Found under Stylize) User Interface: Dot Diameter: size of the dots (very low diameters can produce tapestry-like effects) Background Color: fills the background, default black. Grad Percent: gradation amount Light Direction: drag the cross to direction light will come from. Use Path Gradient: use a path brush rather than a linear brush. The following controls apply only to the path brush: Highlight Width: width of the highlight area Highlight Height: height of the highlight area Point: Sharpness of the highlight Spread: this affects the blend curve Light Distance: how far the light is from the canvas (no effect if light direction is in center)
  15. Lately i have been working on an emboss effect which goal was acting like photoshops, i think i ended up with a quite good result. This effect is basically a fragment blur limited to 2 fragments, 1 inverted fragment and 1 normal fragment and it IS based on the fragment blur code since i wouldn't be able to do the angle myself UI Before After PSEmboss.zip
  16. Otsu's method is a famous algorithm which uses brightness distribution in an image to determine the ideal threshold to turn the image black & white. Before : After: This is typically useful for automatic image processing. Eli found some interesting properties for this effect that you can check out here. Download : Otsu.zip It will be installed under Effects\Stylize. For more information on the plugin itself, please go to the development thread. Many thanks to MJW who helped me make this a viable plugin.
  17. Overview This is based on my previous edge detector, which went from top left to bottom right and checked each pixel to see if it contrasted with another pixel by some degree in the chosen channels. The pixel has a magnitude and angle, but the angle is randomized instead of being set as it was with my last edge detector. This effect now also has a quality setting to determine the number of passes it makes per-pixel. As a result, it hits all angles in a 'fuzzy' way, and may require multiple passes to get smooth edges. Purpose and Applications This is used to make outlines that reduce the data needed to analyze an image, deducing areas of interest, and enabling the use of many interesting edge-based effects. I used it to make sharp or stylized outlines as needed. You can also get the edge data alone as white-on-black, then select the edge pixels and do as you wish with it. For programmers, it's easy to add an effect. Options Sampling range: the magnitude for the vector (the other component is the angle) that determines how thick edges are. Quality: The number of passes to make. Background color: This selects how the background appears. It may be black, transparent (replacing the image), or transparent (on top of the image). The foreground is black unless the background is black, in which case the foreground is white for visibility. You can always invert the colors later. Intensity threshold: All thresholds are values that describe how 'different' pixels have to be to be detected as edges. This one deals with intensity. Red, green, blue, and alpha thresholds: These deal with the rgba channels. See above. Remarks Located in the Stylize folder. Using blurs before edge detection might improve accuracy. Download: Fuzzy Edge Detector Source Code: Github The MIT license added to the source code does not apply to past users of the source code. I just needed to set an actual license to avoid ambiguity.
  18. This is a rather silly little plugin, but it might be fun to play with. I call it the HSV Scrambler. It treats the Hue, Saturation, and Value of each pixel as a value from 0 to 1, then allows any of the components to be derived from a scaled and offset version of any of the other components. It's under Effects>Stylize>HSV Scrambler. Here is the interface: Each component has a Source, which can be Hue, Saturation, Value, or One. The Source component is Offset then scaled by the Scale factor. Each component also has a choice of Bounds Handling, which can be Wrap, Reflected Wrap, or Clamp. Wrap wraps all values to 0 to 1, Clamp clamps out-of-range values to 0 or 1, and Reflected Wrap maps values up to 1 then backwards down to 0. Reflected Wrap prevents the discontinuities at boundaries for Saturation and Value. It isn't necessary in order to make the Hue continuous. The Hue has a Secondary Color Expansion control. I thought the secondary color (yellow, cyan, and magenta) bands were sometimes too thin relative to the primary (red, green, and blue) color bands, so I added a control to optionally widen the bands. It can also be used to narrow the secondary bands, if desired. I think 0.5 often works quite well. Probably the most common choice will be Value for the Hue source, and One for the Saturation and Value sources. This pseudo colors a black and white image. Here is a quick example: After HSV Scrambler: Here is the CodeLab code: Hidden Content: // Author: MJW // Name: HSV Scrambler // Title: HSV Scrambler // Submenu: Stylize // Desc: Scramble the HSV components // Keywords: scramble HSV color #region UICode byte Amount1 = 0; // Hue Source|Hue|Saturation|Value|One byte Amount2 = 0; // Hue Bounds Handling|Wrap|Reflected Wrap|Clamp double Amount3 = 0; // [-1,1] Hue Offset double Amount4 = 1; // [-8,8] Hue Scale double Amount5 = 0; // [-1,1] Secondary Color Expansion byte Amount6 = 0; // Saturation Source|Saturation|Value|Hue|One byte Amount7 = 0; // Saturation Bounds Handling|Reflected Wrap|Clamp|Wrap double Amount8 = 0; // [-1,1] Saturation Offset double Amount9 = 1; // [-8,8] Saturation Scale byte Amount10 = 0; // Value Source|Value|Hue|Saturation|One byte Amount11 = 0; // Value Bounds Handling|Reflected Wrap|Clamp|Wrap double Amount12 = 0; // [-1,1] Value Offset double Amount13 = 1; // [-8,8] Value Scale #endregion delegate double getDouble(); delegate double transformDouble(double d); private transformDouble [] selectBoundsH, selectBoundsSV; // Here is the main render loop function void Render(Surface dst, Surface src, Rectangle rect) { double offsetH, offsetS, offsetV; double scaleH, scaleS, scaleV; double secondaryExpansion; getDouble getH, getS, getV; transformDouble boundH, boundS, boundV; double srcH = 0.0, srcS = 0.0, srcV = 0.0; // Bounds handling routines. if (selectBoundsH == null) { selectBoundsH = new transformDouble [] {Wrap, ReflectedWrap, Clamp}; selectBoundsSV = new transformDouble [] {ReflectedWrap, Clamp, Wrap}; } boundH = selectBoundsH[Amount2]; boundS = selectBoundsSV[Amount7]; boundV = selectBoundsSV[Amount11]; // Offsets and scaling factors. offsetH = Amount3; scaleH = Amount4; offsetS = Amount8; scaleS = Amount9; offsetV = Amount12; scaleV = Amount13; // Amount to expand the secondary colors (yellow, cyan, and magenta). secondaryExpansion = (Amount5 < 0) ? 0.5 * Amount5 : Amount5; unsafe { // Source of the component. double one = 1.0; double *pH = (Amount1 < 2) ? ((Amount1 == 0) ? &srcH : &srcS) : ((Amount1 == 2) ? &srcV : &one); double *pS = (Amount6 < 2) ? ((Amount6 == 0) ? &srcS : &srcV) : ((Amount6 == 2) ? &srcH : &one); double *pV = (Amount10 < 2) ? ((Amount10 == 0) ? &srcV : &srcH) : ((Amount10 == 2) ? &srcS : &one); // Rendering loop. 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]; byte a = CurrentPixel.A; RGBtoHSV(CurrentPixel, out srcH, out srcS, out srcV); double h = boundH(offsetH + scaleH * *pH); if (secondaryExpansion != 0.0) h = AdjustHue(h, secondaryExpansion); double s = boundS(offsetS + scaleS * *pS); double v = boundV(offsetV + scaleV * *pV); dst[x, y] = HSVtoRGBA(h, s, v, a); } } } } double Clamp(double d) { return (d < 0.0) ? 0.0 : ((d > 1.0) ? 1.0 : d); } double Wrap(double d) { return d - Math.Floor(d); } double ReflectedWrap(double d) { d = Math.Abs(d) % 2.0; return (d > 1.0) ? 2.0 - d : d; } const double oneThird = 1.0 / 3.0; double AdjustHue(double h, double secondaryExpansion) { double tripledH = 3.0 * HueConstrain(h); double frac = tripledH - Math.Floor(tripledH); double twiceFrac = 2.0 * frac; tripledH += secondaryExpansion * twiceFrac * (frac - 1.0) * (twiceFrac - 1.0); return oneThird * tripledH; } public ColorBgra HSVtoRGBA(double H, double S, double V, double A) { return HSVtoRGBA(H, S, V, (byte)(255 * A + 0.5)); } public ColorBgra HSVtoRGBA(double H, double S, double V, byte A) { byte r, g, b; HSVtoRGB(H, S, V, out r, out g, out ; return ColorBgra.FromBgra(b, g, r, (byte)A); } public void HSVtoRGB(double H, double S, double V, out byte bR, out byte bG, out byte bB) { // Parameters must satisfy the following ranges: // 0.0 <= H < 1.0 // 0.0 <= S <= 1.0 // 0.0 <= V <= 1.0 // Handle special case of gray (so no Hue) first if ((S == 0.0) || (V == 0.0)) { byte x = (byte)(int)(V * 255.0); bR = x; bG = x; bB = x; return; } H = HueConstrain(H); double R = V, G = V, B = V; double Hi = Math.Floor(6.0 * H); double f = 6.0 * H - Hi; double p = V * (1.0 - S); double q = V * (1.0 - f * S); double t = V * (1.0 - (1.0 - f) * S); if (Hi == 0.0) { R = V; G = t; B = p; } else if (Hi == 1.0) { R = q; G = V; B = p; } else if (Hi == 2.0) { R = p; G = V; B = t; } else if (Hi == 3.0) { R = p; G = q; B = V; } else if (Hi == 4.0) { R = t; G = p; B = V; } else // if (Hi == 5.0) { R = V; G = p; B = q; } int iR = (int)(R * 255.0 + 0.5); int iG = (int)(G * 255.0 + 0.5); int iB = (int)(B * 255.0 + 0.5); bR = (byte)iR; bG = (byte)iG; bB = (byte)iB; } public void RGBtoHSV(ColorBgra color, out double H, out double S, out double V) { RGBtoHSV(color.R, color.G, color.B, out H, out S, out V); } public void RGBtoHSV(int R, int G, int B, out double outH, out double outS, out double outV) { const double H_UNDEFINED = 0.0; // Arbitrarily set undefined hue to 0 const double recip6 = 1.0 / 6.0; // R, G, and B must range from 0 to 255 // Ouput value ranges: // outH - 0.0 to 1.0 // outS - 0.0 to 1.0 // outV - 0.0 to 1.0 double dR = (double)R / 255.0; double dG = (double)G / 255.0; double dB = (double)B / 255.0; double dmaxRGB = Max3(dR, dG, dB); double dminRGB = Min3(dR, dG, dB); double delta = dmaxRGB - dminRGB; // Set value outV = dmaxRGB; // Handle special case of V = 0 (black) if (dmaxRGB == 0) { outH = H_UNDEFINED; outS = 0.0; return; } // Handle specai case of S = 0 (gray) outS = delta / dmaxRGB; if (dmaxRGB == dminRGB) { outH = H_UNDEFINED; return; } // Finally, compute hue if (dR == dmaxRGB) { outH = (dG - dB) / delta; } else if (dG == dmaxRGB) { outH = 2.0 + (dB - dR) / delta; } else //if (dB == dmaxRGB) { outH = 4.0 + (dR - dG) / delta; } outH *= recip6; outH = HueConstrain(outH); } public double Max3(double x, double y, double z) { return (x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z); } public double Min3(double x, double y, double z) { return (x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z); } public double HueConstrain(double MyHue) { // Makes sure that 0.0 <= MyAngle < 1.0 // Wraps around the value if its outside this range while (MyHue >= 1.0) { MyHue -= 1.0; } while (MyHue < 0.0) { MyHue += 1.0; } return MyHue; } Here is the icon: Here is the plugin: HsvScrambler.zip EDIT: Version 1.1. Add control to optionally widen the secondary Hue color bands. Change scale ranges from 10 to 8. Modify method of fetching source components (using "unsafe" pointers suggested by midora). Use different selection method for sources, and slightly revise method for selecting bounding delegates. Move bounding selection control next to component selection. It makes less sense logically, but I believe it makes the interface clearer.
  19. This is a plugin I wrote to test a method for computing the color gradient, but which might be useful for non-testing reasons. I call it (the rather unwieldy) "Display Color Change Direction" because "color gradient" has another common meaning for plugins, and I didn't want to be confusing. The maximum direction of the color change is shown by the hue. It's in the Effects>Stylize menu. The interface is: The Color Scale controls control the color brightness. To allow for a wide range, I have coarse and fine controls. Color Range expands or compresses the range of colors. Because the colors no longer form a continuous circle, some anomalies may a occur when adjacent colors with almost the same color-change direction are colored with colors at the opposite ends of the color range. This problem can be reduced by using Reflected Color Range. Color Shift shifts the hue around the color circle. Color Phase changes which color is associated with which color-change direction. When the full range of colors is used, it duplicates the function of the Color Shift control. When used with a restricted range, the Color Shift selects which colors are used, and the Color Phase selects how the current range of colors are associated with the color change directions. Reverse Color Order reverses the order around the color circle. Full Circle assigns a direction to the color change. Normally, since the color changes as rapidly in the opposite direction, the direction of maximum color change is between 0° and 180°. When this option is set, a direction is assigned to the color, based on the change in intensity of the back-and-white image. I made True the default, both because I think the images generally look better, and because it makes the encoded color change direction correspond to the PDN color wheel. Reflected Color Range reflects the current color range so instead of the going from the beginning color to the ending color, it goes from the beginning color to the ending color at mid-range, then in the opposite order, back to the beginning color. (E.g., Red->Yellow->Green->Yellow->Red.) This makes the color range continuous around the circle of color-directions, avoiding color anomalies when using restricted color ranges. Transparent Background colors makes the background transparent instead of black. As I've mentioned, the purpose was to test the algorithm, but it can be used to produce some interesting effects. For example, the background for this sig was produced using only Clouds and this plugin: The plugin can also be used for edge detection. For example, by running the plugin, then converting to black-and-white and inverting the colors. Here is the CodeLab code: Hidden Content: // Author: MJW // Name: Display Color Change Direction // Title: Display Color Change Direction // Submenu: Stylize // Desc: Show the direction of the maximum color change as a color. // Keywords: color change direction #region UICode double Amount1 = 10; //[0, 25]Color Scale (Coarse) double Amount2 = 0; //[-1, 1]Color Scale (Fine) double Amount3 = 1.0; //[0, 2]Color Range double Amount4 = 0.0; //[0, 1]Color Shift double Amount5 = 0.0; //[0, 1]Color Phase bool Amount6 = false; //Reverse Color Order bool Amount7 = true; //Full Circle bool Amount8 = false; //Reflected Color Range bool Amount9 = false; //Transparent Background #endregion Surface Src, Dst; int maxX, maxY; double colorScale; bool maxScale; double colorShift; double colorPhase; double colorRange; double colorOrder, colorOrderAdj; bool fullCircle; bool reflectColors; bool transparentBackground; const int middleWeight = 2; const double angleScale = 1.0 / Math.PI; void Render(Surface dst, Surface src, Rectangle rect) { colorScale = 0.002 * (Amount1 + Amount2); if (colorScale < 0) colorScale = 0; maxScale = (colorScale >= 25.0); // If scale is max., display all colors at full range. colorScale *= 4.0 / (2.0 + (double)middleWeight); colorShift = Amount4; colorPhase = Amount5; colorRange = Amount3; if (Amount6) // Sign of scaling chosen to match color menu wheel. { colorOrder = -angleScale; colorOrderAdj = 1.0; } else { colorOrder = angleScale; colorOrderAdj = 0.0; } fullCircle = Amount7; reflectColors = Amount8; transparentBackground = Amount9; Src = src; Dst = dst; Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int left = rect.Left; int right = rect.Right; int top = rect.Top; int bottom = rect.Bottom; maxX = src.Width - 1; maxY = src.Height - 1; for (int y = top; y < bottom; y++) for (int x = left; x < right; x++) dst[x, y] = FindGradientColor(x, y); } protected ColorBgra FindGradientColor(int x, int y) { ColorBgra MM, UM, UR, MR, LR, LM, LL, ML, UL; ColorBgra gradColor = ColorBgra.Black; int lX, rX, uY, lY; lX = (x == 0) ? x : x - 1; rX = (x == maxX) ? x : x + 1; uY = (y == 0) ? y : y - 1; lY = (y == maxY) ? y : y + 1; MM = Src.GetPointUnchecked(x, y); UM = Src.GetPointUnchecked(x, uY); UR = Src.GetPointUnchecked(rX, uY); MR = Src.GetPointUnchecked(rX, y); LR = Src.GetPointUnchecked(rX, lY); LM = Src.GetPointUnchecked(x, lY); LL = Src.GetPointUnchecked(lX, lY); ML = Src.GetPointUnchecked(lX, y); UL = Src.GetPointUnchecked(lX, uY); int xR = (UL.R - UR.R) + middleWeight * (ML.R - MR.R) + (LL.R - LR.R); int xG = (UL.G - UR.G) + middleWeight * (ML.G - MR.G) + (LL.G - LR.G); int xB = (UL.B - UR. + middleWeight * (ML.B - MR. + (LL.B - LR.; int yR = (UL.R - LL.R) + middleWeight * (UM.R - LM.R) + (UR.R - LR.R); int yG = (UL.G - LL.G) + middleWeight * (UM.G - LM.G) + (UR.G - LR.G); int yB = (UL.B - LL. + middleWeight * (UM.B - LM. + (UR.B - LR.; int xDelta, yDelta, mag2; // The straight-forward implementation. // The change in each color component can either be consdered positive or negative. // Since changing all the signs won't change the magnitude of the change, red is // fixed and blue and green can have either sign. // Compute all four versions and choose the on that gives the largest magnitude. int xDeltaA, yDeltaA, xDeltaB, yDeltaB, xDeltaC, yDeltaC; int mag2A, mag2B, mag2C; xDelta = xR + xG + xB; yDelta = yR + yG + yB; xDeltaA = xR + xG - xB; yDeltaA = yR + yG - yB; xDeltaB = xR - xG + xB; yDeltaB = yR - yG + yB; xDeltaC = xR - xG - xB; yDeltaC = yR - yG - yB; mag2 = xDelta * xDelta + yDelta * yDelta; mag2A = xDeltaA * xDeltaA + yDeltaA * yDeltaA; mag2B = xDeltaB * xDeltaB + yDeltaB * yDeltaB; mag2C = xDeltaC * xDeltaC + yDeltaC * yDeltaC; // Use the one with the largest magnitude. if (mag2A > mag2) { xDelta = xDeltaA; yDelta = yDeltaA; mag2 = mag2A; } if (mag2C > mag2B) { xDeltaB = xDeltaC; yDeltaB = yDeltaC; mag2B = mag2C; } if (mag2B > mag2) { xDelta = xDeltaB; yDelta = yDeltaB; mag2 = mag2B; } if (mag2 == 0) { return transparentBackground ? ColorBgra.Transparent : ColorBgra.Black; } else { // Adjust sign of deltas so yDelta >= 0. This will produce an ATan between 0 and PI. if (yDelta < 0) { xDelta = -xDelta; yDelta = -yDelta; } double magnitude = Math.Sqrt((double)mag2); double xComponent = xDelta / magnitude; double yComponent = yDelta / magnitude; double value = maxScale ? 1.0 : Math.Min(1.0, colorScale * magnitude); // 0 <= hue <= 1.0 double hue = colorOrder * Math.Atan2(yComponent, xComponent) + colorOrderAdj; // If full circle, use the intensity to determine the direction. if (fullCircle) { hue *= 0.5; double intensity = xComponent * (xR + xG + xB) + yComponent * (yR + yG + yB); if (intensity > 0.0) hue += 0.5; } // Adjust the phase before restricting the range. hue += colorPhase; if (hue >= 1.0) hue -= 1.0; // Reflected colors match at the endpoints for better restricted range colors. if (reflectColors) { hue *= 2.0; if (hue > 1.0) hue = 2.0 - hue; } hue = colorRange * hue + colorShift; gradColor = transparentBackground ? HSVtoRGBA(hue, 1.0, 1.0, value) : HSVtoRGB(hue, 1.0, value); return gradColor; } } public ColorBgra HSVtoRGBA(double H, double S, double V, double A) { byte r, g, b; HSVtoRGB(H, S, V, out r, out g, out ; return ColorBgra.FromBgra(b, g, r, (byte)(255 * A + 0.5)); } public ColorBgra HSVtoRGB(double H, double S, double V) { byte r, g, b; HSVtoRGB(H, S, V, out r, out g, out ; return ColorBgra.FromBgr(b, g, r); } public void HSVtoRGB(double H, double S, double V, out byte bR, out byte bG, out byte bB) { // Parameters must satisfy the following ranges: // 0.0 <= H < 1.0 // 0.0 <= S <= 1.0 // 0.0 <= V <= 1.0 // Handle special case of gray (so no Hue) first if ((S == 0.0) || (V == 0.0)) { byte x = (byte)(int)(V * 255.0); bR = x; bG = x; bB = x; return; } H = HueConstrain(H); double R = V, G = V, B = V; double Hi = Math.Floor(6.0 * H); double f = 6.0 * H - Hi; double p = V * (1.0 - S); double q = V * (1.0 - f * S); double t = V * (1.0 - (1.0 - f) * S); if (Hi == 0.0) { R = V; G = t; B = p; } else if (Hi == 1.0) { R = q; G = V; B = p; } else if (Hi == 2.0) { R = p; G = V; B = t; } else if (Hi == 3.0) { R = p; G = q; B = V; } else if (Hi == 4.0) { R = t; G = p; B = V; } else // if (Hi == 5.0) { R = V; G = p; B = q; } int iR = (int)(R * 255.0 + 0.5); int iG = (int)(G * 255.0 + 0.5); int iB = (int)(B * 255.0 + 0.5); bR = (byte)iR; bG = (byte)iG; bB = (byte)iB; } public double HueConstrain(double MyHue) { // Makes sure that 0.0 <= MyAngle < 1.0 // Wraps around the value if its outside this range while (MyHue >= 1.0) { MyHue -= 1.0; } while (MyHue < 0.0) { MyHue += 1.0; } return MyHue; } Here's the (not especially attractive!) icon: Here is the plugin: DisplayColorChangeDirection.zip EDIT: Fixed spelling of "Coarse" (H/T, Djisves). Changed version to 1.1. EDIT: Restored icon, which I forgot in the previous version (sorry about that). Changed version to 1.2. EDIT: Added Color Range control. Changed version to 1.3. EDIT: Added Color Phase control. Changed version to 1.4. EDIT: Removed mostly unnecessary Middle Weight and Original Image controls. Replaced (at Eli's suggestion) White Background with Transparent Background. Added Reflected Color Range for improved colors when using restricted ranges. Changed version to 2.0.
  20. TechnoRobbo'sTiled Pixels V1.2 Pixels become Shapes! Menu: Effects->Stylize simple controls - no instructions needed Vertigo Vegas Baby The Code Really long so Click to see it Hidden Content: // Submenu: Stylize // Name: TR's Tiled Pixels // Title: TR's Tiled Pixels - v1.1 // Author: TechnoRobbo // URL: http://www.technorobbo #region UICode int Amount1 = 16; // [10,100] Size byte Amount2 = 0; // Shapes|Triangles|Envelopes|Diamonds|Stars|Hearts|Clubs(Clovers)|Spades #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); //---------------------------------- Graphics g = new RenderArgs(dst).Graphics; g.Clip =new Region(rect); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; //BackGround------------------------------- System.Drawing.SolidBrush BBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black); g.FillRectangle(BBrush , new Rectangle(sel.Top, sel.Left,sel.Width,sel.Height)); BBrush.Dispose(); g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; //=========================================================================================== System.Drawing.SolidBrush CBrush =new System.Drawing.SolidBrush(ColorBgra.Black); System.Drawing.Pen CPen = new System.Drawing.Pen(CBrush ,1); System.Drawing.Point[] pt = new System.Drawing.Point[0]; ColorBgra CP; int inc = Amount1; int shape = Amount2; //Test Variable //inc=50; //shape=6; //End Test for (int y = sel.Top; y < sel.Bottom; y +=inc) { for (int x = sel.Left; x < sel.Right; x +=inc) { for (int altx=0; altx <2;altx++){ CP = src.GetBilinearSampleClamped(x + inc/2 * altx,y); CBrush = new System.Drawing.SolidBrush(CP); switch (altx + shape * 2) { case 0://triangle pt = new System.Drawing.Point[3]; pt[0] = new System.Drawing.Point(x,y); pt[1]= new System.Drawing.Point(x ,y+inc); pt[2]= new System.Drawing.Point(x +inc, y + inc); break; case 1://triangle pt = new System.Drawing.Point[3]; pt[0] = new System.Drawing.Point(x,y); pt[1]= new System.Drawing.Point(x + inc,y ); pt[2]= new System.Drawing.Point(x +inc ,y+inc ); break; case 2://envelope pt = new System.Drawing.Point[3]; pt[0] = new System.Drawing.Point(x,y); pt[1]= new System.Drawing.Point(x + inc/2 ,y+inc); pt[2]= new System.Drawing.Point(x +inc, y); break; case 3://envelope pt = new System.Drawing.Point[5]; pt[0] = new System.Drawing.Point(x,y + inc); pt[1]= new System.Drawing.Point(x ,y ); pt[2]= new System.Drawing.Point(x + inc/2 ,y + inc); pt[3]= new System.Drawing.Point(x + inc ,y ); pt[4]= new System.Drawing.Point(x + inc ,y + inc); break; case 4://diamond pt = new System.Drawing.Point[4]; pt[0] = new System.Drawing.Point(x,y); pt[1]= new System.Drawing.Point(x+inc ,y); pt[2]= new System.Drawing.Point(x +inc, y + inc); pt[3]= new System.Drawing.Point(x , y + inc); break; case 5://diamond pt = new System.Drawing.Point[4]; pt[0] = new System.Drawing.Point(x + inc/2,y); pt[1]= new System.Drawing.Point(x + inc,y + inc/2); pt[2]= new System.Drawing.Point(x +inc/2 ,y+inc ); pt[3]= new System.Drawing.Point(x ,y+inc/2); break; case 6://star pt = new System.Drawing.Point[4]; pt[0] = new System.Drawing.Point(x,y); pt[1]= new System.Drawing.Point(x+inc ,y); pt[2]= new System.Drawing.Point(x +inc, y + inc); pt[3]= new System.Drawing.Point(x , y + inc); break; case 7://star pt = new System.Drawing.Point[5]; pt[0] = new System.Drawing.Point(x + inc/2,y); pt[1]= new System.Drawing.Point(x + inc,y + inc); pt[2]= new System.Drawing.Point(x ,y+inc/3 ); pt[3]= new System.Drawing.Point(x +inc,y+inc/3); pt[4]= new System.Drawing.Point(x,y+inc); break; case 8://heart pt = new System.Drawing.Point[4]; pt[0] = new System.Drawing.Point(x,y); pt[1]= new System.Drawing.Point(x+inc ,y); pt[2]= new System.Drawing.Point(x +inc, y + inc); pt[3]= new System.Drawing.Point(x , y + inc); break; case 9://heart pt = new System.Drawing.Point[10]; pt[0] = new System.Drawing.Point(x + inc * 2/10,y + inc/10); pt[1]= new System.Drawing.Point(x+inc*4/10 ,y+ inc/10); pt[2]= new System.Drawing.Point(x + inc/2, y + inc*2/10); pt[3]= new System.Drawing.Point(x + inc*6/10 , y + inc/10); pt[4]= new System.Drawing.Point(x + inc*8/10 , y + inc/10); pt[5] = new System.Drawing.Point(x + inc * 9/10,y + inc * 2/10); pt[6]= new System.Drawing.Point(x + inc * 9/10,y + inc * 4/10); pt[7]= new System.Drawing.Point(x + inc/2, y + inc*9/10); pt[8]= new System.Drawing.Point(x + inc/10 , y + inc*4/10); pt[9]= new System.Drawing.Point(x + inc/10 , y + inc*2/10); break; case 10://Clubs pt = new System.Drawing.Point[4]; pt[0] = new System.Drawing.Point(x,y); pt[1]= new System.Drawing.Point(x+inc ,y); pt[2]= new System.Drawing.Point(x +inc, y + inc); pt[3]= new System.Drawing.Point(x , y + inc); break; case 11://Clubs pt = new System.Drawing.Point[26]; pt[0] = new System.Drawing.Point(x +inc*3/10,y+inc); pt[1]= new System.Drawing.Point(x+inc*4/10 ,y +inc*9/10); pt[2]= new System.Drawing.Point(x +inc*5/10, y + inc*6/10); pt[3]= new System.Drawing.Point(x+inc*3/10 , y + inc*8/10); pt[4]= new System.Drawing.Point(x+inc*2/10 , y + inc*8/10); pt[5]= new System.Drawing.Point(x+inc/10 , y + inc*7/10); pt[6]= new System.Drawing.Point(x+inc/10 , y + inc/2); pt[7]= new System.Drawing.Point(x+inc*2/10 , y + inc*4/10); pt[8]= new System.Drawing.Point(x+inc*3/10 , y + inc*4/10); pt[9]= new System.Drawing.Point(x+inc*5/10 , y + inc*6/10); pt[10]= new System.Drawing.Point(x+inc*3/10 , y + inc*3/10); pt[11]= new System.Drawing.Point(x+inc*3/10 , y + inc*2/10); pt[12]= new System.Drawing.Point(x+inc*4/10 , y + inc/10); pt[13]= new System.Drawing.Point(x+inc*6/10 , y + inc/10); pt[14]= new System.Drawing.Point(x+inc*7/10 , y + inc*2/10); pt[15]= new System.Drawing.Point(x+inc*7/10 , y + inc*3/10); pt[16]= new System.Drawing.Point(x+inc*5/10 , y + inc*6/10); pt[17]= new System.Drawing.Point(x+inc*7/10 , y + inc*4/10); pt[18]= new System.Drawing.Point(x+inc*8/10 , y + inc*4/10); pt[19]= new System.Drawing.Point(x+inc*9/10 , y + inc*5/10); pt[20]= new System.Drawing.Point(x+inc*9/10 , y + inc*7/10); pt[21]= new System.Drawing.Point(x+inc*8/10 , y + inc*8/10); pt[22]= new System.Drawing.Point(x+inc*7/10 , y + inc*8/10); pt[23]= new System.Drawing.Point(x+inc*5/10 , y + inc*6/10); pt[24]= new System.Drawing.Point(x+inc*6/10 , y + inc*9/10); pt[25]= new System.Drawing.Point(x+inc*7/10 , y + inc); break; case 12://Spades pt = new System.Drawing.Point[4]; pt[0] = new System.Drawing.Point(x,y); pt[1]= new System.Drawing.Point(x+inc ,y); pt[2]= new System.Drawing.Point(x +inc, y + inc); pt[3]= new System.Drawing.Point(x , y + inc); break; case 13://Spades pt = new System.Drawing.Point[15]; pt[0] = new System.Drawing.Point(x +inc*3/10,y+inc); pt[1]= new System.Drawing.Point(x+inc*4/10 ,y +inc*9/10); pt[2]= new System.Drawing.Point(x +inc*5/10, y + inc*6/10); pt[3]= new System.Drawing.Point(x+inc*4/10 , y + inc*8/10); pt[4]= new System.Drawing.Point(x+inc*2/10 , y + inc*8/10); pt[5]= new System.Drawing.Point(x+inc/10 , y + inc*7/10); pt[6]= new System.Drawing.Point(x+inc/10 , y + inc/2); pt[7]= new System.Drawing.Point(x+inc/2 , y ); pt[8]= new System.Drawing.Point(x+inc*9/10 , y + inc/2); pt[9]= new System.Drawing.Point(x+inc*9/10 , y + inc*7/10); pt[10]= new System.Drawing.Point(x+inc*8/10 , y + inc*8/10); pt[11]= new System.Drawing.Point(x+inc*6/10 , y + inc*8/10); pt[12]= new System.Drawing.Point(x+inc*5/10 , y + inc*6/10); pt[13]= new System.Drawing.Point(x+inc*6/10 , y + inc*9/10); pt[14]= new System.Drawing.Point(x+inc*7/10 , y + inc); break; }//sw if ( pt.Length!=0){ g.FillPolygon(CBrush,pt);} }//altx }//x }//y CBrush.Dispose(); g.Dispose(); } TRsTiledPixels.zip
  21. Overliner Effect Plugin Model / Result : What's this? Overliner is a plugin that scans the image to find breaks in the colors bertween pixels and if the break is from dark to light then the pixel is replaced with the light color otherwise the dark color. This explanation is not clear? Look at the examples and test it... Download it! Plugin Overliner.dll Here is the DLL Created with CodeLab... The MadJik's All plugins package is available ! http://forums.getpaint.net/index.php?showtopic=7186 How to install Close Paint.net Classic version of Paint.net Unzip and (re)place the DLL in your Effect folder usually: C:/Program Files/Paint.NET/Effects Microsoft Store version of Paint.net Unzip and (re)place the DLL in your Effect folder usually: /My Documents/paint.net App Files/Effects/ You have to adapt for your language My Documents The User interface This plugin is added to the menu Effects, submenu Stylize. Difference level: ...this is the test argument to say when the break is detected between colors. With the checkboxes Red/Green/Blue, you choose to include or not a color chanel in the test. Keep image: ...If checked only the breaks are reproduced over the original image. If unchecked, the rest of the image is filled with the third color (Background color). Switch colors: ...If checked the light and dark colors are switched together. Check Up/Right/Down/Left: ...The tests of breaks are made in four directions Up/Right/Down/Left for each pixels. Uncheck if you want to disable a direction. Dark/Light/Background Colors: ...You could change the three colors used in this effect. Red/Green/Blue: ...As explained previously, with the checkboxes Red/Green/Blue, you choose to include or not a color chanel in the test. Effect Mix: ...This is a slider to mix the final image with the orignal image to make the effect more or less subtile. The Examples: ( some original models from http://www.photo-libre.fr ) (model) (model)
  22. Majority Color Effect Plugin What's this? This plugin is added to the menu Effects, submenu Stylize. In fact it was originally 99% made with CodeLab...(1% for external text editor, and for the icon). This is based on the (french) cellular automat using the majority rule. See the link for more... http://interstices.info/display.jsp?id=c_27035 The automate is based on boolean (0 or 1) cells. I had to adapt it for colors (0-255). The principle is each cell will take the value of its neighbours that have the majority. For each cell, I compute the average of the cell + its neighbours. If the cell color is greater than the average then it takes the value of the greatest value found. Else it take the value of the lowest value found. So there are 3 modes: Keep original colors: use min/max values found separately for R,G & B. Reduce to primal colors: use 0/255 separately for R,G & B. Reduce to black and white: use min/max values found and take the average of RGB to have a grey color. Download it! Plugin Majority.dll Here is the DLL The MadJik's All plugins package is available ! http://forums.getpaint.net/index.php?showtopic=7186 How to install Close Paint.net Classic version of Paint.net Unzip and (re)place the DLL in your Effect folder usually: C:/Program Files/Paint.NET/Effects Microsoft Store version of Paint.net Unzip and (re)place the DLL in your Effect folder usually: /My Documents/paint.net App Files/Effects/ You have to adapt for your language My Documents The User interface ...Choose the color mode: see previous explanations. ...Radius of tolerance: how many row/column to compute from the single pixel. Big values could take a long time to render. ...Color tolerance level: color level to define the default average between low or high colors. ...Include transparent pixels:Check to apply the effect on alpha channel as well. Some examples: 1. Original model from http://www.photo-libre.fr http://photoslibre.free.fr/photoslibres/gens/people/10.jpg ...and abstract Nebulous (from Codelab) 2. mode=0, radius=4, tolerance=127 (applied on the model) 3. mode=1, radius=4, tolerance=127 (applied on the model) 4. mode=2, radius=4, tolerance=127 (applied on the model) 5. mode=1, radius=1, tolerance=127 (applied on the model) + (run again) mode=2, radius=1, tolerance=127