Jump to content

MJW

Members
  • Posts

    2,863
  • Joined

  • Last visited

  • Days Won

    70

Everything posted by MJW

  1. The smoothing should be done on the texture, not the shaded image. In your example, the Texture Smoother is treating the shaded image as a height map and smoothing it to produce a 24-bit height map (hence the odd colors). Run it on the original black-and-white image instead. I also suggest you might want to run a small blur on the original texture first. Something like a 2-pixel Gaussian blur. I think it may produce a more interesting shaded image. (As I mentioned previously, I'm not sure that height map will gain much by being smoothed.)
  2. Shochi, I'm not sure why you're not getting the blue color, but I'm pretty sure it's not the Texture Smoother. Perhaps you're trying to use the Texture Smoother to actually draw the shaded image, which is not what it's intended for. The only reason it does any shading is to let you evaluate how well the height map has been smoothed. Or perhaps you're running the new version of the Texture Shader, and you didn't change the Image source to Clipboard. In the previous version, Clipboard was the default, but in the new version I changed it to White so that the Texture Shader would give a result even if there was no clipboard image. Or maybe you're trying to smooth the already-shaded image. That's the wrong order of doing it. You need to: 1) create a black-and-white height map (often done by making a black-and white image, then applying blurs to make the sides slope); 2) run the Texture Smoother to smooth the height map (making sure to disable "Show Shading" before exiting!) ; 3) shade the smoothed height map with the Texture Shader. One thing I'll add is that for the type of height map in your image, which has a relatively flat texture, the Texture Smoother won't give you much advantage, if any. That type of texture works fine as-is with the Texture Shader. The Texture Smoother is intended for "tall" height maps, like the ones in my examples. As a general rule, smoothing the texture won't be necessary unless the Texture Shader's "Texture Height" control is quite high. Or more simply, try the texture without smoothing, and if it has no problems, don't smooth it.
  3. Height maps, as used by my Texture Shader plugin, are typically black and white images, where the height corresponds to the intensity. Because there are only 256 intensity levels, the height maps are low precision, which often results in image problems, such as wavy "waterlines." The Texture Shader actually supports 24 bit precision, where the depth is represented by the concatenated red, green, and blue channels. Unfortunately, producing the 24-bit height maps isn't easy. That's the purpose of the Texture Smoother. The Texture Smoother attempts to smooth black-and-white height maps into 24-bit height maps. The method is called "Laplacian smoothing," which amounts to repeatedly replacing each depth with a weighted average of the depths in the immediate neighborhood. The plugin joins the Texture Shader in the "Effects>Height Map" submenu. Here is the plugin: TextureSmoother.zip Here is the user interface: As the Help menu says: Texture Smoother smooths a 24-bit height map. Typically, the height map will be originally produced as a gray-scale map, with black pixels representing the lowest values and white pixels the highest. Because there are only 256 different values, the height map is low precision. Texture Smoother applies a smoothing algorithm which modifies each pixel based on nearby pixels. The result is a full-precision 24-bit height map. The controls are: Repetitions: Specifies the number of smoothing passes to perform each time the Smooth Texture button is pressed. Increasing the number of repetitions make the texture smoother, but less like the original texture. Smooth Texture: Initiates the number of smoothing passes specified by Repetitions. Because the texture is not reset when the button is pressed, the button can be repeatedly pressed until the desired smoothness is achieved. Reset Texture: Resets the texture to its initial state. Treat Transparent Pixels as Far (Resets texture if changed): Specifies that all transparent pixels are to be treated as if the 24-bit texture value is zero. If this option isn't selected, the actual pixel values are used. Changing the state of this option resets the texture to its initial state. Don't Move Far Pixels: Specifies that zero-valued pixels are to remain unchanged. This option can be used to prevent smoothing the edge where an object intersects the far plane. The option can be enabled or disabled at any time. This allows a small amount of edge smoothing by performing most, but not all, of the smoothing with the option enabled. Show Shading (Disable before exiting): Specifies that instead of showing the smoothed texture as a colored image (which is usually not too meaningful), the shaded texture should be shown. To preserve the actual texture for later use, this option must be disabled before exiting. All the controls that follow are used only to control shading, and have no effect of the smoothed texture. Show All Pixels as Opaque: The transparency of shaded pixels is normally determined by their alpha values. When this option is enabled, all pixels are shown as opaque. Texture Height Scale: Increases or decreases the texture height. Ambient Light Intensity: Increases or decreases the intensity of the Ambient Light. Ambient light affects every pixel identically, independent of the gradient. Directional Light Direction: Sets the direction of the Directional Light. The Directional Light's effect on a pixel is determined by light's direction and the texture's gradient at the pixel. (The control's outer ring currently has no function.) Directional Light Intensity: Increases or decreases the intensity of the Directional Light. The directional light contributes both diffuse and specular (reflected) light. Specularity: Determines the shininess of the surface. Increasing this value decreases the diffuse lighting and increases the specular lighting. Specular Concentration (Exponent): Determines the sharpness of the specular highlights. Higher values produce sharper highlights. The user interface is slightly unusual in that pressing the Smooth button doesn't start from the beginning image, but instead from the currently smoothed version. I do this because the amount of smoothing required to produce the desired degree of smoothing is quite unpredictable, and over-smoothing can eliminate details. This method allows the user to progressively smooth the texture to the preferred extent. One very inconvenient feature is that in order to judge the smoothing, the Show Shading option must be enabled; but if the option isn't disabled before exiting the plugin, the result will be the shaded texture, not the texture. Unfortunately, there's currently no (allowed) solution to problem, though there may be in the future. If there is, I'll happily change the plugin to use it. The Don't Move Far Pixels option is useful for preventing textures, such as the earring texture below, from spreading out. It can sometimes -- or even often -- produce some undesirable wrinkling at the edge, where the object meets the far background. It often helps to first run a few passes with the option disabled, to smooth the edge boundary. The Treat Transparent Pixels as Far is very useful when the far background is transparent. Most often transparency is represented by "transparent white," which will likely cause problems if this option isn't enabled. I'll show a couple of examples. First a texture intended to represent a gold earring. Here is the original texture: Here is the shaded texture: As is obvious, the shaded version has waterline anomalies. Here is the smoothed texture (which required, I believe, 200 smoothing cycles): Here is the shaded version: Here is a (low-roughness) Cloud image shaded with the Texture Shader: Here is the same texture after smoothing (about 25 smoothing passes):
  4. I've released a new version of Texture Shader. As I say in the lead comment: Release version 2.0.*. Now a Visual Studio project instead of CodeLab. Moved from Distort submenu into new Height Map submenu. Made various cosmetic and functional modifications to user interface, such as using the Angle Control, and changing the number of decimal places. Made White instead of Clipboard the default Image. Added Texture Height Curvature control. Removed option of offsetting relative to selection instead of window. Added option of reversing Directional Light direction. Added Help menu. Functionally it isn't that different from the previous version. It may be slightly faster, since it does the (somewhat complex) initialization once per pass instead of for each ROI. It's a bit fancier and less confusing, since I disable the controls that don't apply when using a constant color. One of the main changes is I moved it to a new Height Map submenu. It's pretty lonely there now, but I intend to give it some company soon. Anyone else who writes a plugin which uses the image as a height map is, of course, welcome to join me. I decided to make the default image White, so that it works as-is, when there's no image in the Clipboard. The Texture Height Curvature Control is often quite useful for tweaking the appearance of the texture. The previous version normally offset the image relative to the selection, but optionally offset it relative to the window. I can't remember why I did that, and it doesn't seem especially useful, so now I always offset relative to the window. I made the offset have four decimal places. so it should be quite precise. Because the outer ring of the Directional Light Direction control was unused, I made it so that if it's on the left side, the light direction is reversed. That can occasionally be useful. (I'd rather have a control with no outer ring, and use a checkbox.) I'll build a 3.5 version if I can. Please let me know if there are any problems or suggestions.
  5. I'd upvote it, but I don't want to get banned along with you.
  6. This is very useful code, which may someday save me quite a bit of work. Perhaps it could be also posted in Plugin Developer's Central.
  7. Congratulations to Doughty on the charming winning entry. Congratulations, also, to us runners-up. Thanks for your kind words, lynxster4! (Though it's actually intended to be a mayfly -- which I only mention to explain the significance the text.) Many thanks to Drew for hosting the competition and overcoming the PhotoBucket problems.
  8. You might want to read the Wikipedia Adobe Illustrator Artwork article. It lists a number of programs, such as Scribus, that might help.
  9. I admittedly don't know much about this, but I do know that Adobe Illustrator is vector based, which makes me doubt raster PNG files can converted by Paint.Net to AI files. You might look at Inkscape.
  10. Forum Rule 12: 12) Posting inappropriate images or using inappropriate words is a quick way to get yourself banned. For example, the word "gay" is not an insult. Neither is the word "retarded". Photographs of people, whether modified or unedited, should not be of a "seductive" or lecherous nature. "Erotic art" is not permitted. Remember, this is a family-friendly board. Let's keep it that way. If you want to show off that kind of art, then please get an account at Deviant Art.
  11. EDIT: Removed the original comment, because it was misleading and (at best) requires more explanation, which I don't have time to provide right now. Perhaps I'll restore it later.
  12. There are several choices, depending on exactly what you want to do. I tend to mostly use BoltBait's Hue/Saturation+, which allows the user to modify colors that fall within specified ranges of hue and saturation.
  13. Another to try is TR's Custom Random Filler. Using it will be a bit more complicated, but it may work well. You'll need to make what amounts to a sprite sheet of splotches (the more, the better, I think). Then make a selection of the region you want to fill, and run the plugin. I think you'd want to set Constrain to Selection. Suggestion on how to generate sprites. Suppose you want to generate an 8x6 sprite sheet of 100x100 pixel sprites. Create a 800x600 canvas. Draw a 100x100 pixel grid using BoltBait's Render>Grid / Checkerboard plugin. This will be a spacing guide. Add a new layer for the sprites. In each 100x100 cell in the top row, draw a splotch in an appropriate color. You could draw an ellipse in each cell with the shape tool, then use Dents to distort them. Select the top row as a 800x100 rectangular selection and copy it to the clipboard. Use BoltBait's Fill>From Clipboard to tile the entire canvas. Use the Rectangle Select tool to select each row, one at a time, and modify the color with Adjustments>Hue/Saturation. Now you have a grid of eight shapes in 6 colors. You can, of course individually modify the cells for more variety. You might originally make the grid of just ellipses, then select each column and apply Dents. Make sure they stay within the grid cells, though. There are plenty of options. The point is to avoid having to make each splotch separately, since you want a lot of shapes and colors.
  14. For the tapering the curves, you could follow ProloficDesign's method of overdrawing the ends with a white curve, if on a white background, or with a transparent curve, if on a transparent background. The second is a little trickier. You need to make the Primary Color's opacity 0, then set the curve blend-mode to Overwrite. For drawing the color patches, you might try MadJik's Splashes and and pyrochild's Splatter, probably followed by Dents. Then followed by Shape3D as Pixey suggests. (You'll probably want to turn of lighting in Shape3D.)
  15. If we're discussing photography as well as PDN, you (the original poster, that is) might try using a polarized filter. Light reflected off glossy surfaces is generally polarized, so shooting with a properly-oriented polarized filter can help remove it. Or so I'm told. My first thought (which may be completely off base) is to use a directional light angled way off center, so all the reflections are to the opposite side instead of to the center. I've seen (but not read) whole books devoted to photographing artworks. Finding and reading such a book might help.
  16. As I almost always say in such cases, could you provide a picture of the type of thing you want to correct? You'd have to be quite lucky to find something addressing exactly your problem, but if you post an example, someone might be able to suggest something. It all depends on how much information is left in the hotspot, and how much and what kind on information was there to begin with. If you have a washed-out constant color, that's one thing. If you have a face completely obscured by the hotspot -- well, good luck with that.
  17. Make sure antialiasing is enabled. It's controlled by the item in the tool bar (or whatever it's called), on the right side, just to the left of Finish. It will show a circle if enabled, a square if not.
  18. Do you work with blender? Not yet, though I'm quite curious about it, and look forward to trying it out.
  19. C# is a programming language, and CodeLab is a sort of editor/compiler that allows the C# code to be immediately executed within Paint.net. I wouldn't say C# is too similar to HTML, which is a markup language. (Given a choice, I'd much rather write C# than HTML.) If you read the beginning CodeLab tutorial, you will see some simple plugin examples showing how the pieces fit together. You really don't need to know much C# to write plugins. C# has lots of fancy features that are seldom needed for plugins. All most plugins do is go through pixels in the destination buffer (the one containing the image after it's been modified) one at a time and calculate each pixel's color. The calculations can be rather complex, but the concept is straight forward. Unfortunately, I think the plugin you're interested in for this thread is on the upper-end of plugin complexity. It probably requires fairly sophisticated knowledge of Microsoft's 2D rendering system, GDI+. As head_toe2001 mentioned, the tapering line-ends isn't something built in to the .NET framework, which makes the problem considerably more difficult.
  20. There are quite detailed tutorials by BoltBait and others. You need to have some knowledge of C# to write plugins, since that's the language Paint.net uses. Plugins are most often written using a feature of PDN called CodeLab, but can also be written using the Visual Studio development system (versions of which are free). This is explained in the tutorials.
  21. What command are you using to load the picture into the project? If you use Paste into Layer, and select Keep canvas size, PDN will show a selection that includes the whole picture, to allow you to position the image onto the canvas, but all the portions of the image that are outside the canvas will disappear as soon as you exit the mode where you are positioning the new image, for example, by deselecting or activating a different layer.
  22. Instead of clicking tilling on and off, it's more convenient to click the mouse in a different control's field (any will do). That will cause the typed number to be entered in the current field. EDIT: I just discovered pressing the Tab key will enter the value, also. It also "highlights" the control's reset arrow, but that seems to do no harm as far as I can see. I wish pressing Enter would just enter the new value, rather than causing the plugin to execute and exit. How useful is that behavior?
  23. The eraser erases like an eraser does. If you hold down the left mouse button, it will erase whatever is under the cursor -- like a Paintbrush, but erasing instead of coloring. You can set the size of the area to be erased by setting the Brush width. If you have a region selected, you can erase it by using the command Edit>Erase Selection, or by pressing the Delete key on the keyboard. ALSO: This belongs in Paint.NET Discussion and Questions.
  24. I finally had a chance to download and try this plugin, and it's very interesting and useful. (I wish the initial comment had a bit more detail on how it's used and perhaps a image of the UI.)
  25. All PDN. Plugin credits include: Red ochre's FurBlur and Aardvark, MKT's Shape3D, pyrochild's Grid Warp, Michael Vinther's Laplacian Pyramid Filter (to make the reduced image clearer), my Texture Shader and (beta-released) Texture View Skewer.
×
×
  • Create New...