Jump to content

MJW

Members
  • Posts

    2,856
  • Joined

  • Last visited

  • Days Won

    70

Everything posted by MJW

  1. In looking more closely at the PluginSupportInfo properties, I'm a little confused. In one of my plugins it is: [assembly: AssemblyTitle("HsvEraser Plugin for Paint.NET")] [assembly: AssemblyDescription("Erase pixels of selected HSV value.")] [assembly: AssemblyConfiguration("hsv erase")] [assembly: AssemblyCompany("MJW")] [assembly: AssemblyProduct("HsvEraser")] [assembly: AssemblyCopyright("Copyright © MJW")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.0.*")] namespace HsvEraserEffect { public class PluginSupportInfo : IPluginSupportInfo { public string Author { get { return ((AssemblyCopyrightAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright; } } public string Copyright { get { return ((AssemblyDescriptionAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description; } } public string DisplayName { get { return ((AssemblyProductAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]).Product; } } public Version Version { get { return base.GetType().Assembly.GetName().Version; } } public Uri WebsiteUri { get { return new Uri("http://www.getpaint.net/redirect/plugins.html"); } } } I've looked at other plugins, such as BoltBait's HueSatPlus, and it seems to be the same. I find it odd that Author returns the Copyright attribute, and Copyright returns the Description attribute. I'd expect Author to return AssemblyCompany, and Copyright to return AssemblyCopyright. Also, as an added bonus comment, I assume there's no appropriate Assembly property for the URI, but it'd be nice if there were. (I don't know much about the Assembly attributes -- to say the least.)
  2. Thanks, Maximilian! You are far too kind. I think it has much more to do with stubbornness than artistry. I find it hard to give up on an idea even if I can't figure out how to do it. The thing that irritates me about missing the "Bend it / Shape it" comp is that distortions are the kind of thing I enjoy doing.
  3. The problem with Rotate / Zoom is that it can only produce a limited subset of possible perpective transformations, so it's hard to match it to a given image. I think my (still beta after all these years) Perspective Transformation may work better for this purpose. Placing the corners may be a little tricky when using text on a transparent background. One way that should work is to: Create a layer above the wall image and fill it with a color. Map the rectangle onto the wall with Perspective Transformation. Delete the color layer and move the text layer above the wall layer, making the text layer active. Rerun Perspective Transformation, not moving the corner control points, but using the scale and offset controls to place the text.
  4. I'm annoyed with myself for not submitting an entry in the "Bend it, Shape it" SOTW competition. I started one, but it was a little too complex, and I had a few too many distractions.
  5. You might want to try my Color Clearer plugin, which is similar to the Grim Reaper, but for some purposes better.
  6. Plugin threads are like vampires: they live forever. 11) Don't reply to very old threads. Also known as "reviving" or "resusitating" old/dead threads. Also called "necroposting" (eww). If there has been no discussion in a thread for, say, 3 months ... then it is dead. Do not reply to it -- pretend like it is locked. If you reply to it, then the thread will be immediately locked and your post may be deleted. Please just create a new thread if you have something to say about that subject. However, this rule does not apply to The Overflow, Tutorials, Pictorium, or Plugins sections of the forum.
  7. jilllorraine,If you can wait a few weeks, I'll try to write a plugin to help. I'm somewhat busy at the moment, and the plugin would require doing some things I believe are doable, but which I currently don't know how to do, so it won't be done right away. The plugin I have in mind would allow you to select a rectangle size from a list. The rectangle would be displayed on the image as an outline, or perhaps as a transparent rectangle surrounded by a darker region (like the View Framer). The rectangle could be positioned within the image. Once the region was selected, you'd click a "Copy to Clipboard" button, at which time the image within the rectangle would be copied into the clipboard, and the selection rectangle would disappear (to let you know the copy was completed, and so that when you exited the plugin, the original image would be unmodified). The clipboard image could then be pasted as a new image or into a layer. If other plugin writers wish to offer advice, the two special things I'd need to do are: - Within OnCreateConfigUI, read a file with a fixed name, from a fixed folder in the the Paint.NET User File folder to populate the rectangle size list. - Copy an image to the clipboard. I believe I can adapt the file-reading routines from CodeLab, and I know Hawkynt's 2D-ImageFilter Library writes the clipboard. I'm not absolutely sure there isn't a problem reading a file inside OnCreateConfigUI, though I can't see any obvious reason it wouldn't be okay.
  8. I really don't see any good justification for this feature. There's no reason to suppose the layer that becomes active is a layer the user would want to make active, I think it should be eliminated, but I'd very gladly settle for a setting that disables it. The supposed reason is to prevent users from being confused when the changes they make aren't visible. I don't think that actually makes sense (since seeing the changes, but not realizing they're being made to the wrong layer seems worse), but if it does make sense, requiring the user to take responsibility by purposely disabling the feature would seem to solve the problem. (The layer that's activated isn't always the next visible layer beneath the layer made invisible, even when there is a lower visible layer. Perhaps it's the nearest visible layer, with ties going to the lower layer. Not that it really matters; one arbitrarily chosen layer is as good as another.)
  9. That's it, toe_head2001! Natsu, I doubt there's a "perfect" way to do automatic rescaling. As the old saying goes, "What do you want, eggs in your beer?"
  10. That's what we assumed you wanted to do. Now I think I know. I also vaguely remember a plugin that implements several algorithms for that sort of thing. I'll see if I can find it when I get a chance.
  11. In the Resize menu, set Resampling to Nearest Neighbor, otherwise it will blur.
  12. Off hand I don't know how to copy portions of images to the clipboard with a plugin, but if it could be done, I think it would go a long way to solving jilllorraine's problem. The clipboard image could be pasted as a new image or into a layer.
  13. More detail would help. What are the steps you use in attempting to add a 2560 x 1440 background? I'm not even sure what you mean.
  14. That really looks like it was stamped out of metal, Eli! I particularly like the indented border.
  15. That's a very nice effect, Seerose!
  16. Perhaps there's some other way of achieving your objective that could be done with a plugin. What do you do with the regions after you've selected them?
  17. Yes. The Texture Smoother is for smoothing the height map, not the final image. I think you may want to move the position of the directional light in the Texture Shader. Making the light come from the upper-left generally works well. Or at least I like it.
  18. That is a 24-bit height map. Now run the Texture Shader on that image.
  19. 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.)
  20. 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.
  21. 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):
  22. 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.
  23. I'd upvote it, but I don't want to get banned along with you.
  24. 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.
  25. 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.
×
×
  • Create New...