Jump to content

Search the Community

Showing results for tags 'object'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Information
    • Forum Rules
    • Paint.NET Search
    • Official Paint.NET website
    • Help Files (paint.net's online 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


Last Updated

  • Start


Filter by number of...


  • Start



Website URL



Found 23 results

  1. TechnoRobbo's Edge Fader Extreme v 5.3.5 (Now called TR's EFX in the menu) I set out to write the fastest, most accurate edge fader out there. It is not a selection tool - it feathers the alpha inwards from the edges. (do not use with a selection) Check out the code! Learn how to increase the speed of your plugins. 5.3.5 Address Small Image Bug 5.1.0 Fade Curves - Plugin Browser Compatible Hidden Content: 5.07 Fixes aspect ratio on preview 5.0.6 diminishes border 5.0.5 Works on very large images 5.0.4 reduced memory usage by 4X 5.0.3 - unbelieveably fast 5.0.1 - 4 Times Faster 5.0.0 Same Algorithm - New Interface with Preview Thumbnail. 4.52 Updated for Paint.net 4.0 4.51 Finer Edges 4.4 Speed, Real Speed 4.3 Edges refined preview turned back 4.2 Enhancement - Adjusts for pre-existing alpha. 4.1 Bug Fix - Large Pictures Selections with no Alpha cause crash. - fixed. 4.0 Re-write - The Need for Speed forced me to write new code to work around the ROI. 3.0 Bug Fix - New Menu -Faster - Adapts to existing Alpha Channel - Resolution Control for Higher Rezimages 2.1 Bug Fix - Streamlined Code More 2.0 Bug Fix - Faster Code 1.4 Bug Fix - Small artifact left at Bottom of selection eliminated. 1.3 Bug Fix - Small artifact left at Top of selection eliminated. Menu: Effects -> Object ->TR's EFX Fade Curves YouTube Tutorial C2ShiningC The VS Source Code https://www.dropbox.com/s/23kwfqretm0fx31/TRsEdgFaderXtremeSrc.zip?dl=0 The Plugin EdgeFader.zip
  2. I've updated 'Bevel Object' as promised. I have also decided to rename it 'Object Bevel' to avoid confusion with Boltbait's subsequent effect of the same name. It can now be cancelled effectively so the warning screen has gone! Because I have renamed it you will have to manually delete the old BevelObject.dll from the Effects folder. The old version is currently still in my Plugin pack (V9) but I intend to update that soon. It still runs on both Pdn 3.5.11 and Pdn 4+ It is still found under Effects/Object New .dll name = ObjectBevel In my V10 pack here Red ochre v10 plugin pack (new as of 1/4/2016 with an alpha threshold slider added) Images below explain the new buttons Bevel Object: applies a range of different shaped bevels to an object, with either parallel or perspective lighting at a full range of angles. IMPORTANT - This is for 'object layers'. That is transparent layers with a small areas of opaque pixels on them. eg. text layers. If there is too much 'object' it will show a warning that it could take a long time. I added this as it is very easy to accidently try running it on a solid layer, which would otherwise take ages to cancel. (Not in most recent version). If the overall width slider is set to zero (now maximum) it will use the object's full width - which can be used for similar effects to the 'shaped gradient' plugin. This However is designed for objects rather than selections. It will run within a rectangular selection but will only base its calculations on the maximum sizes of the selection so cannot be used in the same way as the 'bevel selection' plugin. Good for adding lighting to 'clipwarped' text. Works well with 'Overblur' as this can slightly blur the object and maintain the edges. Enjoy! Here is the U.I. and some examples:- (These screenshots are based on the original version but all these effects can still be achieved.)
  3. Download from my plugin set Effects -> Object -> Outline Object... The area around the object you want to be outlined must be transparent. In other words, it should be on its own layer. edit: this is the three-thousand, three-hundred and thirty-third post in the Plugins forum. 3333rd!
  4. Rubber Stamp Effects -> Object -> Rubber Stamp Before: After: Changelog v1.0 (April 15, 2017) Initial release Download RubberStamp.zip Source Code https://github.com/toehead2001/pdn-rubber-stamp Icon from Fugue Icons.
  5. Found in Effects\Object submenu. Download
  6. TechnoRobbo's Alpha Cutter V 3.0.4 with Auto EdgeFollower Need an easier way to make a mask? Well this plugin's for you. Update Log ------------------------------------------------------------ Menu: Effects->Object YouTube Tutorial Music byTechnoRobbo Island Bogey The VS Source Code for Programmers TRsAlphaCutterSrc.zip The Plugin TRsAlphaCutter.zip
  7. After having success with the Creative Text Pro plugin, I decided to give another of my plugins the "Pro" treatment... Object Shadow Pro v1.0 My goal in writing this plugin is to make this your "go to" plugin when it comes to making shadows no matter what kind of shadow you want. It can make 3 different kinds of shadows: your typical "drop shadow", a long modern shadow, and a 3D shadow. (See the screenshots for examples.) After using the Creative Text Pro plugin, use this plugin to add shadows to the lettering. This will really make it stand out! Remember, an "object" is a group of pixels on a layer that is completely surrounded by transparent pixels (or the edge(s) of the canvas). These are useful when doing "cutouts" or with text on a new, blank layer. If this plugin doesn't look like it is doing anything, you probably forgot to put your object on a blank canvas--white is NOT blank! Based on the check boxes you have selected, some controls will become unavailable. This is because they do not apply to the selected shadow type. Download NOTE: This requires Paint.NET v4.2.11 and beyond. This is now part of my plugin pack, you can download it there: Go There! Donate Once installed, look for it in your Effects > Object > Object Shadow Pro menu. Source Code Enjoy.
  8. This plugin deletes small islands of pixels. When I use the magic wand, some pixels aren't deleted. The plugin deletes them, if they are surrounded by transparent pixels. : It has two parameters : - radius threshold : Delete island up to this size. - alpha threshold : A pixel will be considered transparent up to this value. @toe_head2001 has recompiled this plugin to make it compatible with PDN 4.0+. StrayPixelRemover.zip
  9. What is Alias? Alias is a simple plugin that appears in your Object submenu. It is designed to destroy antialiasing before running the amazing plugin, Feather. To use, simply run the effect. Adjust the strength accordingly! User Interface Alias.zip
  10. Vanishing Trails is similar to pyrochild's classic Trail plugin, but adds perspective. The plugin (Version 2.0, Sept. 12, 2020): Vanishing Trails.zip The Help menu describes the controls: The User Interface: Most of the controls are self-explanatory, but the Spacing Adjustment may require some explanation. Consider the left (red) ellipse in this example: When interpreted as an ellipse perpendicular to the viewing direction, the spacing makes sense. However, if it's interpreted as a tilted circle, the circles become crowded together as they recede into the distance. The Spacing Adjustment control allows the spacing to be modified to produce a more pleasing result, as shown in the right (blue) example. As mentioned in the Help menu, 0 is usually best for 2D objects, parallel to the canvas, while 1.0 works best for 3D objects. Here is an example based on my OOTF candlestick entry:
  11. This plugin may be more interesting than useful (and interesting may be a matter of opinion). It's in the Effects>Object menu. Plugin: EdgeExpander.zip Quoting from the Help menu: ---------- Edge Expander expands object edges to include the pixels within a given distance of the original edge pixels. The edge consists of the pixels above an opacity threshold which border pixels below the threshold. Each expanded edge pixel is set to the color of the nearest edge pixel. The transparency depends on the distance from the edge. The controls are: Use Full Distance Range: When checked, the distance range extends to the full window. The Maximum Distance control will be disabled. Maximum Distance: Specifies the pixel distance the edge will be expanded. Fade Rate: Specifies the rate at which the pixels become transparent as they approach the Maximum Distance. Setting the rate to zero disables fading. Setting the rate to one produces a linear fade. The transparency of expanded edge pixels is determined by the Fade Rate and the transparency of the nearest edge pixel, unless the Make Pixels Above Threshold Opaque option is enabled. Opacity Threshold: Specifies the minimum alpha for object pixels. Pixels whose alphas are below this value are background pixels and are either part of the expanded edge if within the Maximum Distance, or become transparent. Make Pixels Above Threshold Opaque: When checked, pixels whose alphas are above the Opacity Threshold become fully opaque. Only Expand Edges Inside Selection: When checked, edges ouside the current selection are ignored and will not expand into the selction. ---------- The user interface: Here is a simple example using an image from toe_head2001: Original image: Image with the edges expanded with full range and zero fade rate: The plugin uses the fast NearestPixel transform discussed in the Fast algorithm for finding the minimum distances to a set thread. It's a Visual Studio project consisting of the main project and two support files. Main project: EdgeExpander.zip Support files: DistanceTransformAndHelp.zip Though the plugin was mostly written as an experiment, I can think of a few possible uses for it, including softening edges for antialiasing and as a sort of more flexible Crystallize effect, which I'll explain in a follow-up comment.
  12. Plugin which allows the digital image editor "Paint.NET" to take measurements of an object in the active layer. An object is defined by all pixels inside the selection which are not transparent. Because the selection restricts the detection of an object, you may measure different objects in the active layer. Measured values are area, location, width, height, diagonal, and angles of the bounding rectangle. While the dialog of the effect is open the bounding area of the detected object will be colored in red. The drawing inside of the dialog shows a one bit mask of the detected objected (w/o respecting the aspect ratio). A one bit mask is used because it makes only sense to distinguish between transparent and non-transparent pixels. Transparent pixel means its alpha value is zero. Download Find the latest version >> 1330458607_MeasureObject.Effectv1.5.zip MOD NOTE: The above Plugin Measure Object is no longer compatible with the latest editions of PDN. But another Plugin by this author works the same way: The following example shows which area the plugin detects inside of the selected area: Copyright © 2014 by Martin Osieka, ComSquare AG, Switzerland (www.comsquare.ch) License Free for all users to use it as plugin for of the digital image editor Paint.NET. Installation Unzip "MeasureObject.Effect vX.X.zip" and copy the following files MeasureObject.dll, MeasureObject.dlc into the Effects folder of your Paint.NET installation. A typical location is "C:\Program Files\Paint.NET\Effects". OptionBasedLibrary vY.Y.dll, OptionBasedLibrary vY.Y.dlc into the folder of your Paint.NET installation (not into the Effect folder!). A typical location is "C:\Program Files\Paint.NET". After a restart of Paint.NET you will find the plugin under Menu->Effects->Object. Compatibility Paint.NET 3.5.11 and 4.0Beta Supported languages English, Deutsch You may add your own translation to the .dlc file. Release History 1.5 (26.3.2014) - Added top/left and bottom/right coordinate - Derived from MeasureSelection v1.5
  13. This plugin is simply but I couldn't find any other way to do what I needed - so I created it my self. The plugin will follow the shape from the center point, and will paint a gradient from it based on the inside distance. Download FloodFillGradient.zip Installation instructions: http://boltbait.com/pdn/InstallingEffects.php Menu: Object -> Flood Fill Gradient Using the following source image: Can easily result into As you can see, at the center of the image it's black (primary color), where the pixels that are farthest away by path are white (secondary color). I hope someone will find this useful!
  14. As requested here... http://forums.getpaint.net/index.php?/topic/31461-b Object Inner Shadow Plugin Download here for paint.net 4.0+: https://forums.getpaint.net/topic/113220-boltbaits-plugin-pack Download here for Paint.NET 3.5.11: InnerShadow3511.zip I'll edit in a nice description of this later when I'm not so tired. You all know what to do. For the curious... (This does NOT work in CodeLab, sorry): History: v1.0 - Initial Release v2.0 - Speed up rendering for all but the first two controls v3.0 - Corrected "keep only shadow" alpha calculation
  15. The DLL: Object Pruner.zip Object Pruner is in the Object submenu. ======================================== Object Pruner conditionally erases objects based on their sizes. Objects are connected regions of non-transparent pixels. The size of each object is compared to the size of the largest object. Objects that fall outside the minimum and maximum bounds are erased. The size of each object is the number of pixels in the object. With the default settings, all objects except the largest object will be erased. The controls are: Minimum Size of Objects to Keep (Relative to Largest Object): Specifies the minimum size for objects that should be kept, relative to size of the largest object. Maximum Size of Objects to Keep (Relative to Largest Object): Specifies the maximum size for objects that should be kept, relative to size of the largest object. (If this value is less than one, the largest object will be erased.) Transparent Color for Erased Objects: Specifies the transparent color that replaces the pixel color for erased objects. The choices are Transparent White, Transparent Black, or the original pixel color with the alpha value set to zero. Show Objects as Colors (Green = Keep; Red = Erase): Specifies that objects which will be kept should be shown as green, objects which will be erased should be shown as red, and originally-transparent background pixels should be shown as white. This is a debug feature that should normally be disabled before exiting. Because all pixels are shown as opaque, this option can be useful for discovering low-opacity pixels that connect what appear to be separate objects. The user Interface: ======================================== I'm not sure how useful it is. The main purpose is to handle a situation I've encountered when trying to remove a non-uniform background color with the Magic Wand. I select the background color, but there are small scattered regions of the background that don't get selected. Increasing the Magic Wand tolerance results in parts the foreground being selected. If I erase the selected background, I'm left with unerased areas. Ideally, after erasing most of the background, I could just select the foreground with a low-tolerance Magic Wand, invert the selection, and erase the background completely. However, I'm often unable to find a tolerance that completely selects the foreground without selecting the entire image. The Object Pruner is intended to help erase all the scattered regions remaining after erasing most of the background. Since I wrote it, naturally it has more options than it probably needs.
  16. This plugin creates a shadow as if from a direct light source in front of the object in question. As with the other shadow plugins, you need to be working on a layer with transparencies. The shadow is applied to all opaque pixels on the layer. Also, the bottom of the image is assumed to be the "ground" and the shadow is relative to that point. View project on GitHub Requirements Paint.NET v4.0+ Installation As usual, copy the dll to the Effects folder and restart Paint.NET. Download ShadowEffect_1_3.zip (3/30/2015) Added Diffusion Factor Added Plugin Browser compatibility ShadowEffect_1_2.zip Plugin example See GitHub page for latest example. Previous Versions -- Ryan
  17. Download from my plugin set Effects -> Object -> Trail... The area around the object or text must be transparent. In other words, it should be on its own layer. Want to learn how to use the plugin to make something like this? Click here!
  18. Average Object Color averages the colors of objects. It was somewhat inspired by the SOTW mosaic theme (even though I currently don't plan to use it for my entry). It's in the Object submenu. The plugin: Average Object Color.zip The UI is very simple: The (also simple) Help Menu describes it as follows. ------------------------------ Average Object Color recolors each object to its average color. (An object is a connected group of non-transparent pixels surrounded by transparent pixels.) The average is weighted by the opacity of the pixels. When there is a selection, only the selected pixels are included in the average. The control is: Use Gamma Adjustment: When enabled, the square root of the average of the squared color components is used. The gamma-adjusted version is generally lighter. ------------------------------ If a solid image is desired, the Edge Expander can be used to fill in the transparent regions after averaging. (Note: make sure the objects are separated by completely transparent pixels. The first time I posted the example below, the colors of the averaged version were wrong. Some of the hexagon cells were not treated as separate objects because they were bridged by nearly, but not completely, transparent pixels. I used Red ochre's Transparency>Alphathreshold to fix the problem.) Here is an example: Original image: Image with hexagonal transparent grid added. The grid was added by using MadJik's Hexagonal Grid to produce a black-and-white grid in another layer, copying it to the clipboard, and using BoltBait's Paste Alpha plugin to modify the alpha of the flower layer. Because the lines between the cells are quite thin, apparently the alpha didn't go to 0 between some of the cells, causing some groups of cells to be treated as single cells. I solved this by using Red ochre's Alphathreshold to make some almost-transparent pixels transparent. I also could have selected the lines of the hex grid with the Magic Wand, switched to the flower layer, then used Erase Selection. I usually prefer to use Paste Alpha because I think it produces nicer edges. Averaged version:
  19. Download v3.0 DLL here: BoltBait's Plugin Pack There have been many requests for a Feather feature (like this one, this one, and this one) so I decided to create it myself. Thanks goes out to Rick for writing the Gaussian Blur function and to Illnab1024 for sending it to me in Codelab format. If you don't know what feathering is, take a look at this picture: Basically, it softens the edges of objects that you are combining to make composit pictures. Please see this page for :arrow: instructions on how to use it. Enjoy. 8) ============================================= EDIT: I have recompiled this effect with the new CodeLab beta and added an icon to the effect and also added a UI that allows specifying the feather amount (from 1 to 5 with a default of 2). ============================================= EDIT: Updated again. Changed range from 1-5 to 1-10. Also, added the frequently requested freature of a true feather. The original method is called "grow" as it grows the object slightly. The new method is called "shrink" as it makes the edges of the object slightly transparent--the object shrinks slightly. I also moved the effect to the Blurs submenu. Here is the new UI: (4/15/07 update) ============================================= FIXED: Updated DLL to fix the UI bug where it gets confused if you move the sliders back and forth too much. (6/11/07 update) ============================================= FIXED: Fixed a typo. The last time I built this, I accidentally put "feather2" in the menu instead of "Feather". ============================================= NEW: I have rewritten this effect from scratch. The effect now shows up in the Effects > Object submenu. It now includes a third slider to control the strength of the effect. (1/27/2008 update) ============================================= NEW: I have rewritten this effect's UI from scratch. It now uses the IndirectUI of Paint.NET. (2/18/2008 Update) ============================================= FIXED: I have fixed the Paint.NET 3.36 bug. (8/26/2008 Update) ============================================= NEW: I have released version 3.0 Download the update here: BoltBait's Plugin Pack Source code published here: (4/4/2010 Update)
  20. A Book Folding Plug-in Menu: Effects->Object This plugin is for folding books into decorative designs. This is not an image effect. It generates an Excel Spreadsheet for Book Folding These Links may explain http://forums.getpaint.net/index.php?/topic/26946-counting-filled-cells-in-column/?p=395648 http://forums.getpaint.net/index.php?/topic/32362-plugin-request-a-variation-of-the-pixel-counter-plugin/?p=431775 pixelcounter2.zip
  21. TechnoRobbo's KeyFrame v1.2 an animation assistant for Midora's Animated images http://forums.getpaint.net/index.php?/topic/31629-animated-images/?p=424663 KeyFrame v1.1 exports frames Hidden Content: // Submenu: Object // Name: TR's Keyframe // Title: TR's Keyframe- v1.2 // Author: TechnoRobbo // URL: http://www.technorobbo.com #region UICode Pair<double, double> Amount1 = Pair.Create( 0.0 , 0.0 ); // Start Pair<double, double> Amount2 = Pair.Create( 0.0 , 0.0 ); // Via Point Pair<double, double> Amount3 = Pair.Create( 0.0 , 0.0 ); // End double Amount4 = 0; // [0,1] Time double Amount5 = 0.75; // [0.1,1.5] Path Shape bool Amount6 = false; // [0,1] Show Path int Amount7 = 10; // [1,100] Export count byte Amount8 = 0; // [255] Export Frames double Amount9 = 0; // [-2,2] Start Rotation double Amount10 = 0; // [-2,2] End Rotation double Amount11 = 1; // [0.01,2] Start Size double Amount12 = 1; // [0.01,2] End Size #endregion byte LastButton=0; String cboard; PointF[] spline(PointF p0, PointF p1, PointF p2, float tension) { PointF[] arr = {p0,p1,p2}; PointF[] PointArray = new PointF[0]; using (System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath()) { gp.AddCurve(arr, tension); gp.Flatten(null, .01f); PointArray = new PointF[gp.PointCount]; PointArray = gp.PathPoints; } return PointArray; } public void SaveImages() { System.Windows.Forms.SaveFileDialog SaveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); string fp = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); SaveFileDialog1.InitialDirectory=fp; SaveFileDialog1.Filter = "PNG file (*.png)|*.png" ; SaveFileDialog1.FilterIndex = 1 ; SaveFileDialog1.RestoreDirectory = false ; if(SaveFileDialog1.ShowDialog() == DialogResult.OK) { cboard = SaveFileDialog1.FileName; }else{ cboard = String.Empty; } } void Render(Surface dst, Surface src, Rectangle rect) { if (IsCancelRequested)return; SignalCancelRequest(); float hw = (float)src.Width / 2f; float hh = (float)src.Height / 2f; float timeline = (float)Amount4; PointF start= new PointF((float)Amount1.First * hw + hw , (float)Amount1.Second * hh + hh); System.Drawing.Point istart= new System.Drawing.Point((int)-start.X,(int)-start.Y); PointF via = new PointF((float)Amount2.First * hw + hw , (float)Amount2.Second * hh + hh); PointF dest = new PointF((float)Amount3.First * hw + hw , (float)Amount3.Second * hh + hh); float idx = 1f / (float)Amount7; float rot = (float)Amount10 * timeline + (float)Amount9 - (float)Amount9 * timeline; float scale = (float)Amount12 * timeline + (float)Amount11 - (float)Amount11 * timeline; PointF[] arr = spline(start,via,dest,(float)Amount5); PointF midC = arr[ (int)(timeline * (arr.Length - 1))]; Surface Moved = src.Clone(); Surface shift = src.Clone(); shift.Clear(ColorBgra.Transparent); shift.CopySurface(src,new System.Drawing.Point(src.Width / 2 - (int)start.X, src.Height / 2 - (int)start.Y)); Moved.Clear(ColorBgra.Transparent); dst.Clear(ColorBgra.Transparent); if (LastButton!=Amount8){ LastButton=Amount8; System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(SaveImages)); t.SetApartmentState(System.Threading.ApartmentState.STA); t.Start(); t.Join(); if (cboard != String.Empty) { int count=0; for (float i = 0; i<1; i +=idx) { PointF midB = arr[ (int)(i * (arr.Length - 1))]; rot = (float)Amount10 * i + (float)Amount9 - (float)Amount9 * i; scale = (float)Amount12 * i + (float)Amount11 - (float)Amount11 * i; Moved.Clear(ColorBgra.Transparent); using (Bitmap bmp = new RenderArgs(shift).Bitmap) { using(Graphics g = new RenderArgs(Moved).Graphics) { System.Drawing.Imaging.ColorMatrix cm = new System.Drawing.Imaging.ColorMatrix(); cm.Matrix33 = 1f;//(Amount6) ? .5f: 1f; System.Drawing.Imaging.ImageAttributes ia = new System.Drawing.Imaging.ImageAttributes(); ia.SetColorMatrix(cm, System.Drawing.Imaging.ColorMatrixFlag.Default, System.Drawing.Imaging.ColorAdjustType.Bitmap); RectangleF pa = new RectangleF(0,0,bmp.Size.Width,bmp.Size.Height); g.DrawImage(bmp, rotateimage(midB.X,midB.Y,bmp.Size, scale ,rot),pa,GraphicsUnit.Pixel,ia); ia.Dispose(); } } string dboard = cboard.Replace(".", String.Format("{0}.",count++)); using (Bitmap tmp =new RenderArgs(Moved).Bitmap )tmp.Save(dboard); } } Moved = src.Clone(); } else { if (Amount6)dst.CopySurface(src); using(Graphics g = new RenderArgs(Moved).Graphics) { using (Bitmap bmp = new RenderArgs(shift).Bitmap) { System.Drawing.Imaging.ColorMatrix cm = new System.Drawing.Imaging.ColorMatrix(); cm.Matrix33 =(Amount6) ? .5f: 1f; System.Drawing.Imaging.ImageAttributes ia = new System.Drawing.Imaging.ImageAttributes(); ia.SetColorMatrix(cm, System.Drawing.Imaging.ColorMatrixFlag.Default, System.Drawing.Imaging.ColorAdjustType.Bitmap); RectangleF pa = new RectangleF(0,0,bmp.Size.Width,bmp.Size.Height); g.DrawImage(bmp, rotateimage(midC.X,midC.Y,bmp.Size, scale ,rot),pa,GraphicsUnit.Pixel,ia); ia.Dispose(); if (Amount6)g.DrawCurve(Pens.Red,arr); } } } LastButton=Amount8; using (Graphics dg = new RenderArgs(dst).Graphics ) { using (Bitmap Dbmp = new RenderArgs(Moved).Bitmap) { dg.DrawImage(Dbmp ,0f,0f); } } Moved.Dispose(); shift.Dispose(); } private System.Drawing.PointF[] rotateimage(float x, float y, System.Drawing.Size board,float scale, float rotate) { System.Drawing.PointF[] points = new System.Drawing.PointF[3]; float rot = rotate * (float)Math.PI; float cos = (float)Math.Cos(rot); float sin = (float)Math.Sin(rot); float width = board.Width * scale; float height = board.Height * scale; float left = width / -2; float top = height / -2; float right = width / 2; float bottom = height / 2; points[0] = new System.Drawing.PointF(left * cos - top * sin + x, top * cos + left * sin + y); points[1]= new System.Drawing.PointF(right * cos - top * sin + x, top * cos + right * sin + y); points[2]= new System.Drawing.PointF(left * cos - bottom * sin + x, bottom * cos + left * sin + y); return points; } TRsKeyFrame.zip
  22. This Plugin applies a texture to any selected object with saving the brightness, so the object looks like it originally had this color. It's easy: You just have to select the object and the new texture. Newest release (17.02.2012): Apply Texture.zip Examples: Before After Click to enlarge
  23. TR's Str8Edge Tool V1.1 Smooths out jagged edges on a Cut-Out. (For those of use who's hands are not that steady) Version 1.1 Updated for Paint.net 4.0 Menu: Effects->Object Deselect before using. YouTube Example Composite of tiger done with Lasso and Str8Edge tool. No Edge Feathering!!! (Minimal Cleanup - Hand drawn whiskers) Hand Selected Tiger The Code Hidden Content: // Compiler options: /unsafe /optimize /debug- /target:library /out:"C:\Program Files\Paint.NET\Effects\TRsStr8Edge.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("TRsStr8EdgePlugin")] [assembly: AssemblyDescription("TRsStr8Edge Plugin for Paint.NET. (Compiled by Code Lab v1.8)")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("TechnoRobbo")] [assembly: AssemblyProduct("TRsStr8EdgePlugin")] [assembly: AssemblyCopyright("Copyright © TechnoRobbo")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.1.*")] namespace TRsStr8EdgeEffect { 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 = "TRsStr8Edge")] public class TRsStr8EdgeEffectPlugin : PropertyBasedEffect { public static string StaticName { get { return "TR's Str8 Edge"; } } public static Image StaticIcon { get { return null; } } public TRsStr8EdgeEffectPlugin() : base(StaticName, StaticIcon, "Object", EffectFlags.Configurable) { } public enum PropertyNames { Amount1 } protected override PropertyCollection OnCreatePropertyCollection() { List<Property> props = new List<Property>(); props.Add(new Int32Property(PropertyNames.Amount1, 1, 1, 20)); return new PropertyCollection(props); } protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Amount1, ControlInfoPropertyNames.DisplayName, "Amount"); return configUI; } bool noskip = true; protected override void OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) { this.Amount1 = newToken.GetProperty<Int32Property>(PropertyNames.Amount1).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 Str8 Edge - V 1.1"; base.OnCustomizeConfigUIWindowProperties(props); } protected override unsafe void OnRender(Rectangle[] rois, int startIndex, int length) { if (length == 0) return; for (int i = startIndex; i < startIndex + length; ++i) { Render(DstArgs.Surface, SrcArgs.Surface, rois); } } #region User Entered Code // Submenu: Object // Name: TR's Str8 Edge // Title: TR's Str8 Edge - V 1.1 // Author: TechnoRobbo // URL: http://www.technorobbo.com #region UICode int Amount1 = 1; // [1,20] Amount #endregion void Render(Surface dst, Surface src, Rectangle rect) { if (noskip) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); dst.CopySurface(src, sel.Location, sel); noskip = false; try { ColorBgra CP = new ColorBgra(); int[] offx = { -1, 0, 1, -1, 1, -1, 0, 1 }; int[] offy = { -1, -1, -1, 0, 0, 1, 1, 1 }; byte[,] agrid = new byte[sel.Width, sel.Height]; byte[,] bgrid = new byte[sel.Width, sel.Height]; //================================================= for (int oy = sel.Top; oy < sel.Bottom; oy++) { for (int ox = sel.Left; ox < sel.Right; ox++) { CP = src.GetBilinearSampleClamped(ox, oy); bgrid[ox, oy] = (byte)((CP.A == 0) ? 0 : 255); } } //--------------------------------------------------- for (int z = 0; z < Amount1; z++) { Array.Copy(bgrid, agrid, agrid.Length); for (int y = sel.Top; y < sel.Bottom; y++) { for (int x = sel.Left; x < sel.Right; x++) { if (agrid[x, y] != 0) { int Threshold = 255; int Sigma = 0; for (int i = 0; i < 8; i++) { int nx = Int32Util.Clamp(offx + x, 0, sel.Width - 1); int ny = Int32Util.Clamp(offy + y, 0, sel.Height - 1); Threshold = Math.Min(agrid[nx, ny], Threshold); Sigma += agrid[nx, ny]; } if (Threshold == 0) { CP = src.GetBilinearSample(x, y); if (Sigma >= 1275) { CP.A = 255; } else { CP.A = 0; bgrid[x, y] = 0; } dst[x, y] = CP; } } //if } //x } //y } } catch (Exception e) { } } else { ColorBgra CP = dst[0, 0]; dst[0, 0] = CP; } } #endregion } } TRsStr8Edge.zip
  • Create New...