Jump to content

MJW

Members
  • Posts

    2,845
  • Joined

  • Last visited

  • Days Won

    70

Everything posted by MJW

  1. That sounds like a good name for it. I changed my version to use "PointInt16," but I can't seem to update my original comment to change it there.
  2. For some reason, I can no longer edit the initial comment. Selecting Edit brings up an empty edit box, and none of the buttons -- even Cancel -- work. Maybe the forum has decided five edits is plenty. In any case: EDIT 6: Renamed Point16 to PointS and SpanDist2 to SpanDistSq. I just decided I didn't like the original names.
  3. Someone asked about a similar problem some time ago, and I made a plugin to draw such a rectangle. You can read my comment where I posted the plugin to understand what it does. It might be useful. One of these days I'm going to make a more finished version.
  4. I don't understand what you want. The canvas size is the size of the layers, so naturally if you change the canvas size, the layers will be cropped. I'm not sure what you expect to happen, EDIT: I think I now realize what you want. You want the visible image size to change, but the layers to be unchanged, so you can still move them around within the image boundaries. Unfortunately, that's not the way it works, and I very much doubt it ever will be.
  5. You might try: Erase the blemish with the Eraser, usually with low Hardness. Duplicate the layer. Select the entire lower layer (Select All). Use the Move Selected Pixels Tool to move the lower layer around a little till you find a region that fills in the erased area. If necessary, adjust the Brightness/Contrast or Hue/Saturation of the lower layer for a better match. Flatten the image. You might erase multiple blemish before duplicating. In many cases, one positioning of the lower layer will remove most of them. Any that aren't, can be removed by repeating the process. It may be better to duplicate the layer first, make the lower invisible (so you can see your erasure), then erase the blemish. That way, there will be no chance the edge of the erased region will prevent the lower layer from being moved into the best position Instead of selecting the lower layer and using the Move Selected Pixels Tool, you could use Layers>Rotate/Zoom. This method is more complex than using Cloning and such, but I think it often looks better.
  6. I've updated the distance transform code, using integer, instead of floating point, arithmetic. I made various other changes, as described in the EDIT 4 comment.
  7. To get the banding, I suggest generating smooth clouds then using the old Adjustment>Curves trick of making a sine-like response curve, as is done to make reflecting metal. To make the linear banding, it might be useful to select a tall, thin rectangular area and stretch it horizontally with Move Selected Pixels, the way wood-grain textures are produced. Marilynx, I like those pictures you made, but I think there needs to be more contrast in the color of the bands. Also, you might run Effects>Objects>AA's Assistant to smooth the edges. They would probably look more like jewels if the specular highlights were brighter. The highlight should be white, not green, but perhaps the greenish look is due to their not being bright enough.
  8. All the steps are standard PDN stuff (Effects>Blurs>Gaussian Blur, Adjustments>Curves, etc.) except the displacement, which can be done with Red ochre's Effects>Distort>ClipDisplace. (As far as I can see, there's really no reason to save the blurred image then bring it back in as the video does. Just put it in another layer.)
  9. If you mean blocky instead of blurry, select Nearest Neighbor as the Resampling option. If you want to do more than just make a blown-up version of the original image, you'll need something fancier than just the built-in resize.
  10. I rewrote some of code using ideas from Meijster's paper. His method of transforming the columns is less general, but more efficient. I'm not sure the generality was of much use. I'd like to do everything "in place" without the input array. Meijster does that, but I couldn't get his version to work, and I don't yet understand the algorithm well enough to know which elements I can safely write without overwriting something that will be used later. Meijster's version uses ints instead of floats (which might be desirable). That was, I think, part of the problem with making it work as is. I also parallelized it somewhat. The rows are now processed in the Render calls. One thing that's interesting about the algorithm is that I'm pretty sure it could be modified to record for each pixel the coordinates of nearest pixel in the set, That might be useful for something or other.
  11. That's quite flashy looking, Eli! I especially like the magenta glow. (Credit for the Edge Shader goes to Red ochre, of course. I hope by appending the MJW to the end of the name on the posted version, it doesn't appear I'm trying steal credit for it. I just didn't want it to overwrite other versions.)
  12. There are several on the linked-to thread. The result is the same, the method is improved. Here is another example:
  13. Some time ago, Red ochre and I discussed ideas for make his Edge Shader plugin run faster. While looking for a paper on a different subject, I stumbled upon a fascinating (and surprising) paper by Pedro F. Felzenszwalb and Daniel P. Huttenlocher on finding the minimum Euclidean distances to a set of points in O(n) time. I converted the C++ code provided by one of the authors into C# and used it in a new version on the Edge Shader. Here is the plugin: EdgeShaderMJW.zip Here is the plugin code. Here is the distance transform code: EDIT: I found that the same idea was published earlier by A. Meijster, et al. in a paper called "A General Algorithm for Computing Distance Transforms in Linear Time." EDIT 2: Because the algorithm processes the columns and then the rows independently, the process could be parallelized to some extent in PDN by performing the column processing in OnSetRenderInfo and the row processing in Render. It shouldn't be too difficult, but for right now, I'll leave that as an exercise for the reader. EDIT 3: I improved (I believe) the code by combining elements from Meijster's version with the original. I made the routines static. I also processed the rows in the Render code for parallelization. EDIT4: Put the distance-transform class in a separate file. Rewrote much of the code, using integer arithmetic. Added comments to explain how it works. Added routines to find the nearest points' coordinates rather than the distances. These routines are probably slightly slower than the distance version, but more general, since the distance can be easily calculated from the nearest pixel's coordinates. Added routines to transform a range of columns to aid in parallelization of the column as well as the row transformations (I don't know how practical that would be within PDN, but it could be used in other situations.) EDIT 5: Replaced the plugin zip file with the current version. It does the same thing as the previous version; it just uses the new routines.
  14. Perhaps this topic could be renamed something like "Mandolin Quinn's Portfolio." "My Portfolio" isn't too informative. It isn't my portfolio.
  15. Another suggestion is to use Bevel Object from BoltBait's plugin pack. Use the Magic Wand to select the region. Copy the selection and paste it into a new layer. Deselect. (Necessary if you want the darkness to extend all the way to the edge.) Run Effects>Object>Bevel Object with the Highlight and Shadow colors both set to black. Flatten the image. EDIT: If you use this approach, and one region's color is a darkened version of an adjacent region's color, start with darker region. Otherwise, you may have difficulty selecting the dark region once the light region's edge is darkened. That may sound confusing, but if you try it in the opposite order, the problem will be apparent. EDIT 2: Because it could be done without the cut, paste, and flatten, using Effects>Selection> Bevel Selection would be easier. Unfortunately, the result is not as good. The darkening doesn't extend fully to the edge. That's the same problem I mentioned in the deselection step.
  16. Generate the noise with random colors, then use Curtis's Selective Palette plugin. (There was some discussion recently about problems with Curtis's plugins under PDN 4.0.5. I just tried the Selective Palette plugin, and it seems to work fine. It's quite cool.) EDIT: One thing I don't like about the Curtis plugins it that they seem slow down PDN startup very noticeably. Without them, PDN begins almost immediately on my system; with them, it takes a number of seconds to start up, and pauses a number of seconds when I first access the Effects menu. Quite strange, and bothersome enough that I copied the Curtis files into a subdirectory, and will only put them in the Effects directory if I need them.
  17. That's basically true. The height map only determines the shape; the coloring is either a constant color or from an image in the clipboard. Originally I intended the coloring to always be from the clipboard, but then I added the constant-color options as a convenience. So if you want to use a constant color, and it isn't white, you've got to make it the Primary or Secondary color before running the Texture Shader. There's one significant exception. If you want something to look like colored metal -- gold being the most useful choice -- you can set the Image color to white, then set the hue of the Directional and Ambient lights to the metal's color. For gold, that something around 100% red, 75% green, 0% blue; for instance (255, 196, 0). The reason this works for metal is that, as I've mentioned before, the highlight on colored metal is the color of the metal, not white. I use this method all the time -- perhaps a little too often -- because I like the way it looks. To make the metal look shiny, set the Specularity to a high value. For more advanced results, the clipboard image is used to apply a non-constant color to the shaded surface. I'll try to add some tutorials to the Texture Shader thread soon.
  18. Thank you, Si Borg. I'm eager to see what you do with it, considering how amazing your images have been up to now. I think maybe I'll add a few mini-tutorials like the one above to the Texture Shader thread. Since I knew what I was trying to achieve when I wrote the effect, I tend to forget how confusing all those various controls can be.
  19. Most plugins modify the current layer, and nothing more. I know there are some animation plugins that deal with multiple frames, but I know nothing about that sort of thing. Perhaps someone who does can tell you if what you want to do is possible, and if it is, how to do it.
  20. The first step, which I'll be happy to explain in more detail if you wish, is to make a height maps that looks like this: All it is is blurred white letters on a black background, with a bit of motion-blurred noise added. In a height map like this, white represents the raised areas, while black represents the low areas. The whiter it is, the higher it is. Texture Shader applies an image and shading to the height map. However, in this case there is no image, so it's simpler. (Note: sometimes I refer to the height map as the "texture.") Copy the height map (the MJW image) into PDN. Run the Texture Shader. Set Image (the topmost control) to Primary Color. Since black is PDN's default Primary Color, this will make the color of the image black. Because there's no clipboard image to worry about, none of the other image-control settings matter. You can ignore them. The Texture Height Scale, which increases or decreases the height of the texture, will work with the default setting, so it doesn't need to be changed.. Go to the Directional Light Direction control near the bottom of the user interface. (You may have to use the scroll bar at the right side, since there are so darn many controls). It has a little ball control you can move around with the mouse. Move it upward and to the left until the control slider values read about 0.00, -130.00, 29.00. You can also use the sliders to adjust to these values, or even type in the numbers. The position of the ball control is the direction the light comes from. The lighting will be kind of dim. Increase it with the Directional Light Intensity control (which is just below the direction control) to about 4.50. Check the Antialias checkbok almost at the bottom of the user interface window. You should now have an image that looks like the one you linked to.
  21. I just tried it with my plugin, and undo seems to work, at least for the case I tried. A 2011 comment by Rick Brewster suggests it was acceptable, if perhaps not ideal, at that time,
  22. I believed it was okay to do all the rendering in OnSetRenderInfo; however, when I wrote a plugin that does that, it worked fine with rectangular selections, but when I tried a circular selection, it wrote outside the selected area. Red ochre asked about the same problem in a earlier thread, and was advised to use a per-pixel selectionRegion.IsVisible test. I don't mind testing IsVisible (though I've read in the past that it's slow), but I want to make sure writing to the dst surface in OnSetRenderInfo is allowed, and not just something that happens to work as long as IsVisible is tested.
  23. If you just want to use an image from the current layer and another from the clipboard, it's quite easy, and can be done in CodeLab. If you want to import an image from a file, you probably don't want to use CodeLab. Since the Alpha Mask code is available, you can adapt that. If you know C++, C# should be easy to learn. Unless you're using the more sophisticated features of C#, the code to write a plugin should be almost the same. All the basic C-style operations and control structures work, with some minor differences, such as the required breaks in switch statements. I'm not clear on what you intend to produce. Is it a single image or a bunch of frames? I can't provide any information on producing multiple frames, as I know nothing about the problem, and it doesn't interest me enough to find out.
  24. Marilynx, Texture Shader looks more complicated than I think it is, because it does two separate (but related) functions, so it requires controls for both. The top controls determine how the image in the clipboard is mapped onto the height-map. The bottom controls control how the height-map is shaded. They let you set the position of the light, along with its color and brightness. They also let you set how shiny the surface is with the specularity controls. I think most of what the controls do is fairly intuitive -- particularly with the lighting. Limon, I've been very impressed with your images. I hope you experiment with Texture Shader, to see what you can do with it. EDIT: I removed a suggestion on how to apply the clipboard image to the height-map, because I don't think it would work well with the type of height-map needed for the horn (the height map is too high, which makes the low 8-bit precision a problem.)
  25. Any method that removes the color before edge detection is tossing out useful information.
×
×
  • Create New...