Jump to content

BoltBait

Administrator
  • Posts

    15,721
  • Joined

  • Last visited

  • Days Won

    405

Everything posted by BoltBait

  1. Your post was locked because it broke the rules. You can read the rules here: viewtopic.php?f=20&t=3446 If you want notifications of responses, you must subscribe to that post. It is not automatic. That is to prevent you from getting spammed by our server.
  2. This is a paint.net forum. Try your question in a Apophysis forum.
  3. I have written 4 different versions of feather. The first one, called Object Feather, used a blur to make the hard edges of cutouts blured slightly in order to simulate an anti-alias effect. While it was nice for its time, it does produce less than perfect results. The second, called Object Feather - True Feather, made the hard edges of cutouts slightly transparent. This was better and well liked by the users here. The third, called Selection Feather, makes the hard edges of your current selection slightly transparent. This is how most other programs feather stuff. This is by far the most accurate of my plugins. The fourth, called Object Feather 3.0, is a mixture of the first and second. The results are far superior to Object Feather and True Feather. It basically uses both techniques blended together. This last one is going to replace my Object Feather plugin. You can download it now, if you want, at http://www.spreadpaint.net exclusively until I update my plugin pack early next week. I hope this explanation helps.
  4. You're going crazy.I have nothing hidden in any of my plugins.
  5. NoNonsense, looks to me that you tried to flatten the image and Paint.NET ran out of memory when it was trying to flatten the image.
  6. CodeLab 1.5 released today. Get the update here: http://www.boltbait.com/pdn/codelab/ I was playing around with text boxes and realized that I had never added the multi-line text box to CodeLab... so I did. Here is a sample script that takes advantage of the new control: // Title: BoltBait's Render Text Sample // Author: BoltBait // Submenu: Render // Name: Text // URL: http://www.BoltBait.com/pdn #region UICode string Amount1 = ""; // [1,32767] Text FontFamily Amount2 = new FontFamily("Arial"); // Font int Amount3 = 12; // [10,72] Size byte Amount4 = 1; // [1] Smoothing|None|Anti-Alias|ClearType ColorBgra Amount5 = ColorBgra.FromBgr(0,0,0); // Color Pair<double, double> Amount6 = Pair.Create( 0.0 , 0.0 ); // Location #endregion void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); // Reset the destination canvas dst.CopySurface(src,rect.Location,rect); // Determine where the text will be written int column = (int)Math.Round(((Amount6.First + 1) / 2) * (selection.Right - selection.Left)); int row = (int)Math.Round(((Amount6.Second + 1) / 2) * (selection.Bottom - selection.Top)); // Create a brush and graphics surface to write on SolidBrush Brush1 = new SolidBrush(Amount5.ToColor()); Graphics g = new RenderArgs(dst).Graphics; // specify smoothing mode switch (Amount4) { case 0: // none g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; break; case 1: // anti-alias g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; break; case 2: // cleartype g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; break; } // Be sure to clip to our ROI g.Clip = new Region(rect); // Create a font from user selection Font SelectedFont; try { SelectedFont = new Font(Amount2.Name, Amount3); } catch { // If font creation fails, use Arial font SelectedFont = new Font("Arial", Amount3); } // Write our text to the canvas g.DrawString(Amount1, SelectedFont, Brush1, column, row); } The code above shows more than just the new multi-line text box, but also how to do font smoothing (or not). Here's what that script builds:
  7. You can do this without plugins. Using the gradient tool, click :LinearGradient: on the toolbar, then click :AlphaChannel: and draw your gradient as desired.
  8. The most likely cause is either you were trying to put text outside of a current selection or you were trying to put text on a layer that was covered by something on a higher layer. In the former case, be sure to press Esc before using the text tool.
  9. This is true. I am allowing Mike to host the update of Feather while I work on the next release of my plugin pack. If you are planning to install both, install my pack here, then install the feather plugin from Mike's site. It will overwrite the one in my plugin pack. I should be done with my pack update in about a week. Until then, if you want the latest, go to Mike's site.
  10. It means, press Ctrl-I to invert the selection. Or, you can use the "Edit > Invert selection" menu item.
  11. Yeah, I'm looking for something that can draw a picture like my avatar from a photograph. Simple, fat lines of uniform size without random stray pixels. The color fills are not necessary. They can be done later by hand. The "canny edge" effect looks close, but the lines are too thin and the image is too busy. My closest to date is Ink Sketch (or Ink Sketch followed by a Median blur). But, I'm always looking to improve the output. Tweeks: // Author: BoltBait // Name: Line Drawing // URL: [url=http://www.BoltBait.com/pdn]http://www.BoltBait.com/pdn[/url] #region UICode int Amount1 = 10; // [1,20] Tinker int Amount2 = 10; // [1,20] Radius #endregion // Rick, stop moving stuff around private byte Clamp2Byte(int iValue) { if (iValue<0) return 0; if (iValue>255) return 255; return (byte)iValue; } unsafe void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); // Setup for calling the Blur function GaussianBlurEffect blurEffect = new GaussianBlurEffect(); PropertyCollection bProps = blurEffect.CreatePropertyCollection(); PropertyBasedEffectConfigToken bParameters = new PropertyBasedEffectConfigToken(bProps); bParameters.SetPropertyValue(GaussianBlurEffect.PropertyNames.Radius, Amount2); blurEffect.SetRenderInfo(bParameters, new RenderArgs(dst), new RenderArgs(src)); // Call the Blur function blurEffect.Render(new Rectangle[1] {rect},0,1); // Now in the main render loop, the dst canvas has a blurred version of the src canvas for (int y = rect.Top; y < rect.Bottom; y++) { ColorBgra* srcPtr = src.GetPointAddressUnchecked(rect.Left, y); ColorBgra* dstPtr = dst.GetPointAddressUnchecked(rect.Left, y); for (int x = rect.Left; x < rect.Right; x++) { ColorBgra AdjustmentPixel = *dstPtr; ColorBgra SourcePixel = *srcPtr; double RDiff, GDiff, BDiff; byte adj; // Similar to UnSharp Mask here... RDiff = Math.Abs((double)SourcePixel.R - (double)AdjustmentPixel.R) * ((double)Amount1 / 100.0); GDiff = Math.Abs((double)SourcePixel.G - (double)AdjustmentPixel.G) * ((double)Amount1 / 100.0); BDiff = Math.Abs((double)SourcePixel.B - (double)AdjustmentPixel. * ((double)Amount1 / 100.0); // Add up all the differences adj = Clamp2Byte((int)(RDiff + GDiff + BDiff)); // Change the pixel to black or white depending on a threshold amount adj = ((adj > Amount1) || (RDiff > (Amount1/3)) || (GDiff > (Amount1/3)) || (BDiff > (Amount1/3)))? (byte)0 : (byte)255; AdjustmentPixel.R = AdjustmentPixel.G = AdjustmentPixel.B = adj; // I should probably use alpha in the final algorithm, but for for now, just set it to full AdjustmentPixel.A = 255; // Show it *dstPtr = AdjustmentPixel; srcPtr++; dstPtr++; } } }
  12. Interesting, but not what I'm after. Now, if you take my image above and run Effects > Noise > Median (1/50)... That's more of what I'm shooting for.
  13. My goal has always been to create an effect that creates a line drawing from a photograph. So, that's why I put the threshold code in. I'm more interested in focusing on the edges and throwing out all other information (gradients/shading). The idea for this effect just naturally occured to me when looking at the unsharp mask code that Tanel gave me for my Landscape plugin. I figured that when you Gaussian blur an image, the amount of change a pixel has between the original source canvas and the blured image would show you how likely an edge has been found. I, honestly, didn't know it had a name. As you can see from my output, I need to really think through how to compute the difference to improve the output. I have a long way to go before it produces good looking results. BTW, funny, but when I first wrote the effect, it turned out white lines on a black canvas, just like the sample image in the wikipedia article you linked.
  14. Try this plugin for indoor pictures: viewtopic.php?f=16&t=33417 Or, this one for outdoor pictures: viewtopic.php?f=16&t=32208
  15. Read this: viewtopic.php?f=16&t=2023 If you still have trouble, post on that thread.
  16. Yeah. That's probably it. @csm725: Please note... regardless of the fact that notepad allows you to enter text (including web addresses) it is not a web browser.
  17. There are many ways to do this. Can you give us an example of what you want the result to look like? Here is one method: viewtopic.php?f=35&t=26970
  18. Have you tried using Microsoft Paint? Paint.NET may not be the program for you.
  19. http://www.paint.net/ looks like it always has... :?:
  20. After extensive testing on the new algorithm (ok, 5 minutes of testing) I must say that it sucks. Worse than the others. So, I still say that my Selection > Feather is the best feather. It even works if your picture is already feathered... unlike my other plugins. My advice: use that.
  21. EER, that's ok. I know my Feather plugin has issues. In fact, I've written a new version of the plugin that I'm testing now. It works way better than the older versions... so far. I'll release soon, and this time I'll publish source code to it--it's waaay cleaner than older versions.
×
×
  • Create New...