Jump to content

MJW

Members
  • Posts

    2,848
  • Joined

  • Last visited

  • Days Won

    70

Everything posted by MJW

  1. Though it's better not to count on it, I suspect the compiler would compute the constant expression. That's a pretty simple optimization.
  2. That's really the only easy way it can work. Producing exactly 16 good color choices is a non-trivial task. Programs that produce GIFs do something like that, but they produce 256 colors, so they have more leeway. You might try Neil Cassidy's Segment Image plugin. It's old, so I don't know if it still works.
  3. I hate to say that's just how it works out, but that's just how it woks out. For any setting, you can end up with anywhere between 1 color and the product of the channel settings, depending on the image. In your gradient, the level of green is very low, so if there are large gaps between the colors -- as there are for a setting of 3, 3, 3 -- it may not be enough to show up in a separate color.
  4. You get 16 levels per color channel, but that can produce 4096 (16^3) colors. If you had a multi-color image, with various mixtures of red, green, and blue, it would probably be clear; the confusion results from having all the colors be nearly red. Consider an image with a white-to-green gradient on the top, and a black-to-red gradient on the bottom. Posterize set to 16, 16, 16, would produce 16 saturations of green on the top, and 16 values of red on the bottom.
  5. Yes, Math.Sin(x) and Math.Cos(x) can be used.
  6. Consider one of the lines: divide = (float)rect.Width / Amount1; That's wrong. "rect" is the rectangle for the ROI. You can't have values that are used in the calculations depend on the dimensions of the ROI. It may work sometimes, especially when there's no selection, but it won't work in general. Values like that can only depend on the surface dimensions or the selection dimensions, never on the ROI dimensions. The choice between the surface dimensions or the selection dimensions depends on what you're trying to do. (Instead of "selection dimensions," it would be more precise to say the dimensions of the selection's bounding rectangle.) I believe using the surface height and width will fix your problem. You might consider putting the setup in PreRender. If you want do some setup that can't be done in PreRender, you should ask yourself if you're doing it right. The only additional information you have in Render is about the ROI, and it's a rare plugin, indeed, that needs that for anything other than controlling which destination pixels to process. On a more minor point. If you're going to do things in floating point, you should compute the reciprocal of "divide" so you can replace divisions with multiplications. Multiplies are considerably faster.
  7. Congratulations to @MadJik, @Seerose, @welshblue, and @Eli! My, what a close competition! I really enjoyed the variety of techniques used. Thanks to @toe_head2001 for hosting!
  8. Congratulations to @Pixey, @barbieq25 and @Seerose for some very lovely winning entries! Pixey's first-place winner was so enchanting and creative! It brought to mind a curio my grandmother had, which consisted of a flower-shaped electrode in a neon-filled bulb. I also liked many of the other entries, including especially @welshblue's. In fact, I liked so many that I had a hard time narrowing my votes to just five.
  9. No. Once you finalize, the text is merely different colored pixels. You can put it on a separate layer so it can be more easily manipulated, but it can only be altered as pixels, not as text. Paint.Net is a raster-image editor, not a text editor.
  10. I tried both Distort This! and Quadrilateral Correction without much success. Here's a method that works pretty well, but the values I used were obtained more or less by trial and error. Run my Perspective Transformation plugin on the linked-to image with the following settings: Upper Left: -0.801, -1.057 Upper Right: 1.2689, -1.103 Lower Right: 0.798, 1.009 Lower Left: -0.751, 0.857 Scale: 1.400 XY Proportion: 0.010 X Offset: 0.000 Y Offset: -0.055 Antialias: Checked I got the values by drawing a square Shape on a transparent higher layer. I then selected the the original image layer, and moved the Perspective Transformation nodes so that the corners of the record jacket were on the corners of the square. Then I adjusted the XY Proportion to make the record circular instead of elliptical. Another method that works okay is to make a duplicate of the image layer, and zoom in with Layers>Rotate/Zoom so that the record jacket is bigger than the original record. Run Quadrilateral Correction on the enlarged record jacket to make it square. Then switch to the original image and rerun Quadrilateral Correction, adjusting the Height and Width to produce a circular record. Enlarging the jacket in necessary because Quadrilateral Correction crops to the quadrilateral, so the quadrilateral must be large enough to contain to record.
  11. @grandpaterry, please don't use generic titles for your threads. It's a forum rule:
  12. I don't think that's quite correct. Your scaling factors are (n - i) and (i - 1), and your divisor is n. But in situations like this, the sum of the scaling factors should equal the divisor, which it doesn't. I assume i runs from 0 to (n - 1), in which case you want (n - 1 - i) and i as the scaling factors and (n - 1) as the divisor.
  13. As soon as you "finish" the shape, the nodes disappear, and the shape can no longer be edited. You can use Edit>Undo (or the keyboard shortcut Ctrl-Z) to undo the finishing step, so you can resume modifying the shape. Of course, any changes made after the finishing step must also be undone. The shape is finished when you press Enter or click the Finish button in the Tool Bar, or when you do almost anything that dosen't involve moving or resizing the shape. It's easy to accidentally finish a shape by clicking in the wrong place, so using Undo is useful.
  14. Are you just zooming, not resizing? Zooming, such as moving the slider in the lower right corner, won't resize the image. It just shows a magnified view. To resize,, use Image>Resize or the shortcut key, Ctrl+R. EDIT: What toe_head2001 said.
  15. The star will be surrounded by a square of eight nodes, which are small circles. To change the size and proportions of the star, left click on one of the nodes, then move the mouse with the button held down. If you hold down the shift key on the keyboard when you create and resize the star, it will maintain its original proportions, and just change size. I suggest you read the tutorial, though it does seem to be missing information on resizing. EDIT: The tutorial does say: "The draggable control nubs transform the shape. Click and drag these to relocate them. Dragging one nub over the one diametrically opposite has the effect of flipping the shape." So the information is there, although it may be slightly hard to find.
  16. The preview feature is one of the best CodeLab improvements ever! I've long longed for the ability to alter the control values within CodeLab without editing them by hand (and remembering to change them back before saving the source code). CodeLab has improved by leaps and bounds in the last week.
  17. That makes sense. I'll try to add dispose code to my plugins that allocate surfaces.
  18. This may be a foolish question, but does disposing of surfaces free up memory just because that's just how it happens to work, rather than being how it's guaranteed to work? I've always been under the impression that disposing is designed to free system resources held by a class, and doesn't necessarily initiate any garbage collection. (By "system resources," I mean things like files, not memory.)
  19. I've never disposed of them either. I've always assumed (probably incorrectly) that when the effect is completed and the effect class instance is disposed of, any surfaces created by the effect will be garbage collected.
  20. You could even make it an extension method so you could use: CurrenPixel = PrimaryColor.Add(25);
  21. If you want to erase a specific color (or range of colors) you could try the HSV Eraser plugin.
  22. Two other plugins worth trying are my HSV Eraser and BoltBait's Hue/Saturation+. Alone, or perhaps along with Color Clearer, they may help you get the desired result. For instance, you might try: Make a duplicate layer. On the top layer, delete all but the flowers by removing all color without zero saturation, using HSV Eraser and BoltBait's Hue/Saturation+. On the lower layer, remove the black, using Color Clearer Merge the layers.
  23. What is the criteria you want for which black it removes and which black it doesn't remove?
  24. Two plugins to try: Paste From Clipboard -- similar to Fill From Clipboard, but with more options, including antialiasing. (Some of the tiling modes don't currently work as intended. I'm working on it.) Paste Warp+ -- Distorts the pasted image to fit the selection.
×
×
  • Create New...