Jump to content

MJW

Members
  • Posts

    2,848
  • Joined

  • Last visited

  • Days Won

    70

Everything posted by MJW

  1. It depends on how you want the photo to fade to black. The above-mentioned Vignette is simple and effective if you want it to fade in a circular pattern. For more complex patterns, you can add a layer above the photo layer, make a black-and-white pattern (using selections, fills, blurs, etc.), with the light areas where you want to have the photo show, then set that layer's Blending Mode to Multiply.
  2. I don't think that plugin does anything more than superimpose one image over another. As I interpret acoustichead's request, it's for a plugin that spacially distorts the image to fit into the selection. I'm not sure the goal is well-defined enough to implement as a plugin for anything but trivial cases, and perhaps not even for that. It appears to me that in the example given, the pattern is compressed in the X direction to fit the selection, and would look different if it were compressed in the Y direction instead. EDIT: I can see a simple algorithm for mapping a rectangular region to a convex region. For any point in the convex region, compute the rectangle's X coordinate based on the proportion of the distance between the convex region's left and right boundaries at the Y value, and the Y coordinate based on the proportion of the distance between the upper and lower boundaries at the X value. In other words, bilinear interpolation based on the convex region's current X row and Y column. This could be extended to map a convex region to another convex region by essentially first mapping the source convex region to a rectangle, using the same idea.
  3. Here's my plugin: GraphSine.zip It's under Effects>Render>Graph Sine. The Help menu is just a stub which I'll probably improve. It draws in the Primary Color on a Secondary Color background. I haven't updated CodeLab yet, so it uses two place precision on the slider (which is probably enough). Here's the source: Hidden Content: // Name: Graph Sine // Submenu: Render // Author: MJW // Title: Graph Sine // Desc: Graph a variable-frequency sine wave // Keywords: graph sine // URL: // Help: [b]Graph Sine[/b] graphs a sine wave whose frequency can vary from the beginning to the end. The size is adjusted to fill the current selection. #region UICode DoubleSliderControl Amount1 = 1; // [0.01,100] Beginning Frequency DoubleSliderControl Amount2 = 1; // [0.01,100] Ending Frequency DoubleSliderControl Amount3 = 1; // [0,4] Amplitude DoubleSliderControl Amount4 = 0; // [-1,1] Phase (in cycles relative to beginning frquency) DoubleSliderControl Amount5 = 1; //[1,10] Line Thickness. CheckboxControl Amount6 = false; //[0,1] Overwrite #endregion DoubleSliderControl prevAmount1 = -1; DoubleSliderControl prevAmount2 = -1; DoubleSliderControl prevAmount3 = -1; DoubleSliderControl prevAmount4 = -1; Point[] function = null; int xSteps; void Render(Surface dst, Surface src, Rectangle rect) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); if (function == null) { xSteps = sel.Width; function = new Point[xSteps]; prevAmount1 = Amount3 - 1.0; } // If any of the controls which affect the graph change, update the graph. if ((prevAmount1 != Amount1) || (prevAmount2 != Amount2) || (prevAmount3 != Amount3) || (prevAmount4 != Amount4)) { prevAmount1 = Amount1; prevAmount2 = Amount2; prevAmount3 = Amount3; prevAmount4 = Amount4; // t will go from 0 to 1 across the selection. double tStep = 1.0 / (double)(xSteps - 1); double xScreenScale = (double)(sel.Width - 1); double xScreenOffset = (double)sel.Left; double yLow = -1.0; double yHigh = 1.0; double yRange = yHigh - yLow; double yScreenScale = -(double)(sel.Height - 1) / yRange; double yScreenOffset = (double)sel.Top - yScreenScale * yHigh; double aScale = 2.0 * Math.PI; double aOffset = -Amount4 * aScale / Amount1; double fScale = Amount2 - Amount1; double fOffset = Amount1; double t = 0.0; for (int i = 0; i < xSteps; i++) { double f = fScale * t + fOffset; double a = aScale * t + aOffset; int screenX = (int)(xScreenScale * t + xScreenOffset + 0.5); double y = Amount3 * Math.Sin(f * a); //y = 0.1 * a * f; int screenY = (int)(yScreenScale * y + yScreenOffset + 0.5); function[i] = new Point(screenX, screenY); t += tStep; } } // Clear the ROI or copy it. if (Amount6) dst.CopySurface(src, rect.Location, rect); else dst.Clear(rect, EnvironmentParameters.SecondaryColor); // Create a pen to draw with and a graphics object to draw on. // Then draw the graph. using (Pen myPen = new Pen(EnvironmentParameters.PrimaryColor)) using (Graphics g = new RenderArgs(dst).Graphics) { myPen.Width = (float)Amount5; g.Clip = new Region(rect); // Set the smoothness mode. g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; // Now draw the function. g.DrawLines(myPen, function); } } EDIT: I will, of course, consider suggestions for improvements, though I hope I don't have to spend too much time on this plugin. EDIT2: Fixed bug that resulted from a mistake I made when renumbering the Amount variables. The problem might not be noticeable, but it could cause the graph not to update when it should, or it could cause the plugin to run slower. I'm considering redesigning the algorithm. I go to considerable effort to avoid recalculating the graph for each ROI. It may not be worth it. It would probably run fast enough without the complexity. EDIT3: I think I'll keep the algorithm as it is. "Considerable effort" is an overstatement. It's really just a matter of keeping track of whether any of the controls that affect the graph have changed since the graph was last computed.
  4. This sounds like a interesting and fairly easy plugin to write, so I'll give it a try. It won't be too fancy.
  5. I don't see where the Sine Curves plugin allows variable frequency.
  6. For the general case, follow Limon's advice. However, you should try to start with a larger image than the one of the gear. You'll get a much better result if you start with an image several times larger than the final image, and as the final step, rescale it to the desired size. It's almost impossible to get a really clean result for something the size of your gear image, especially when it has both curved and straight edges. For your specific case, forget about the gear image you have. Make a new, larger gear with Red ochre's Effects>Iterative Lines>Gears plugin. Then fill it using Tools>Paint Bucket. For a gear like yours, you could use something like: Number of teeth: 8 Tooth width: 100 Tooth height: 59 Tooth shape: Truncated triangle Shaft hole: 35 Spoke shape: None Show outer collar and inner rings: Unchecked Overall size: 100 The other controls left at the default values.
  7. Another idea which has been mentioned before, and which I think is a good one, is to have Paint.NET load plugins from subfolders of the Effects folder, provided the subfolders' names have a certain format, such as beginning with "Effects," like "EffectsBlurs." Then the plugins could be grouped by folder, and the plugins in a folder could be disabled by renaming it to something like "_EffectsBlurs" so it would no longer be searched.
  8. I'm not sure what you mean by "the logo must be cut in the circle."
  9. To add to what Red ochre said, generate some smooth Effects>Render>Clouds. Then run Effects>Artistic>Contour with the gap and contour color set to "solid color." For the other controls, the defaults will work, but you might want to experiment for the best effect, Follow Contour with Effects>Stylize>Outline, probably with a Thickness of 1, and with an Intensity between 50 and 100. If you want white lines on black, apply Adjustments>Invert Colors. You may want to generate the image at twice the final size, add some slight blur (like 2 pixel Gaussian) to smooth out the lines, then resize to 50%. There may be better approaches, but that should work.
  10. The UpDown increment also doesn't seem to work. I actually think 2 places is enough for both the Angle Chooser and the Roll control. One hundredth of a degree is pretty small. I wish the UpDown increment could be made smaller. The only way to enter more exact angles is either hit or miss with the slider or typing it in. One thing that bugs me about all the controls is how they use (or don't use), the small and large slider increment value. I would think moving the slider should only change the control value in multiples of those values, so if one is 0.05 and the other is 0.25, all the slider movements would change the value by multiples of 0.05. Instead, the sliders seem to change the values in a rather haphazard way, which makes positioning to even values more difficult.
  11. Each height-map plugin has its particular advantages and uses, but I'm biased toward Texture Shader, because I wrote it. As far as I know, it's the only height-map plugin that combines both distortion and shading (or perhaps I should say lighting). You can't just use any old noise. Using the Add Noise effect will result in a very fine grainy texture, like a rough surface. You could, for instance, generate smooth black-and-white Clouds then apply a height-map plugin. The problem you may have is the one I mentioned above. As you increase the amount of distortion, at some point the lack of precision in the height map will result in waterline-type ridges. Adding some noise to the height map, to roughen it up, will disguise the effect, but then you wont get the smooth, glossy finish you seem to be after. The problem with waterlines is mostly confined to plugins that use the "gradient" to compute the displacement. The gradient is the slope of the surface at the given point, and is computed by taking the difference between the pixel and its neighbors. Because of the height map's low precision, areas where the height changes slowly have zero magnitude gradients over an area, interrupted by fairly large magnitude gradients at the points where the height steps up to the next level. Red Ochre's Clip Displace uses the height directly to determine the displacement, so it doesn't suffer from that problem.
  12. I agree with toe_head2001. Many times for scale and shift type controls, two places isn't enough to make a singe-step change nearly imperceptible, which it needs to be for the user to achieve a particular result.
  13. That's a hard question. Because the Double Vector pretty much always represents the image range as -1 to 1, three places (or even four) makes sense. The Double Slider can represent lots of things, with lots of different ranges. If the range is 0 to 1000, it seldom makes sense to have three places of precision, and using the up-down control becomes more difficult for small adjustments, because the steps are too small. But many times when the range is 0 to 1, I wish I had more precision. I suppose the precision could depend on the range, with enough precision to ensure at least a thousand steps. What I'd really like -- though it might be difficult to implement -- is the ability to specify the precision, perhaps be adding control names like DoubleSliderControl1, DoubleSliderControl2, DoubleSliderControl3, where the digit would specify the number of places, with DoubleSliderControl having the default precision. That might present problems for the UI Designer, adding some ugliness of a bunch of extra controls, or requiring a new field for the decimal place specification. Because the smallest range of the roll controls is 0-90, allowing 9001 steps for two decimal places, I don't think it probably needs three places. EDIT: I think the up-down increments for the roll control are too large. Currently, each click increments or decrements by 1. For Double Sliders, it's 0.01. I determined that the increments can be set by: configUI.SetPropertyControlValue(PropertyNames.Roll, ControlInfoPropertyNames.UpDownIncrementX, 0.01); configUI.SetPropertyControlValue(PropertyNames.Roll, ControlInfoPropertyNames.UpDownIncrementY, 0.05); configUI.SetPropertyControlValue(PropertyNames.Roll, ControlInfoPropertyNames.UpDownIncrementZ, 0.10); That was just a test to try the three different increments. An increment of 0.01 for all three seems best to me.
  14. A height map is an image in which the color at any particular point indicates the height of the surface at that point. Typically height maps are black and white (and gray), with black representing the farthest distance from the viewer, and white representing the nearest distance. You can think of black as the ground plane, and the lightness of a pixel as indicating its height above that plane. Though height maps may be useful for what you want to do, there may be a problem. Most height maps only represent 256 height levels, so if the map represents a large distance, the changes in levels may not be smooth, but will instead be steps, which can result in the appearance of waterlines.
  15. As I see, one difficult aspect of the pearl rope will be getting all the pearl highlights to point in the same direction, toward the light source, and not depend on the location of the pearls on the rope.
  16. Actually, a shadow and a reflection. Or at least that was my intention.
  17. It appears to me that the black pearls are primarily reflective. That brings up the question of what should be reflected. It could just be some rather vaguely naturalistic pattern of light and dark, or it could be used creatively to reflect a specific environment.
  18. Where's the fun in copy-and-pasting? Here's a pearl I made using Shape3D. It isn't really what I think you (Marilynx) are after, but I like it.
  19. Perhaps you could post images of, or link to, some examples of the type of thing you're looking for.
  20. Just the first. The second is the source code, of interest only to plugin programmers.
  21. MJW

    Making a Jewel

    Zoom Blur Deluxe for 4.0.
  22. Marilynx, I hope you'll forgive me for once again suggesting the Texture Shader plugin, which was more or less designed to do this kind of thing.
×
×
  • Create New...