Jump to content

MJW

Members
  • Posts

    2,845
  • Joined

  • Last visited

  • Days Won

    70

Everything posted by MJW

  1. Blend modes, almost by definition, are pixel-by-pixel operations. Each pixel is affected only by pixels in other layers with the same coordinates. Perhaps if you explain what you want to achieve, someone can suggest a way to achieve it.
  2. Another method is to use the Texture Shader. With every Texture Shader control not mentioned set to its default. Copy the image to the clipboard. Run the Texture Shader, setting: Image: Clipboard Texture Height Scale: 0 Directional Light Intensity: 1.429 This has the advantage that colors that would be made too bright (that is, a component would exceed 255) are clamped in a way the preserves the hue.
  3. Here's how I believe you can achieve it without plugins: Start with the sinlge-layer image. Duplicate the layer. Add a layer between them. Fill the layer between them, with (109, 109, 109). Set the between layer's Blend Mode to Multiply. Set the upper layer's Blend to Additive. Flatten. EDIT: This is only theoretical, since the actual image contains color components of at least 189. Too high!
  4. The colors consists of RGB values. Each of the R, G, B componets is scaled by 0.7. If they're prescaled by 1/0.7, which is about 1.43, then scaling by 0.7 will result in the original color. Of course, if any color component is greater than 178 (0.7 x 255), it won't be possible to scale by 1.43, since the color component would be outside its possible range
  5. I'm pretty sure Paint.NET has no plugins to support files with a ".mip" extension. PDN does have a plugin that will generate mip maps for DDS files, but unless I misunderstand your question, that probably won't help you.
  6. For that type of effect, I think you should try BoltBait's Paste Alpha. You can create a greyscale mask of the area you want to be transparent, then paste it in as alpha. The advantage is that Paint.NET has more tools and effects for creating greyscale masks than for altering transparency. For example, you can paint the initial mask with the Paintbrush, then soften the edge with blurs. If you set a layer above the image layer to white, and set the layer's Blend Mode to Multiply, you should be able to get a feeling for its effect on the transparency as you darken the areas that will be transparent. Or to better match the example you gave, set the initial mask to black, and use the Additive Blend mode. The transparent regions would be lightened. (Use the Paste Alpha's Invert Calculation option in that case.)
  7. Congratulations to @welshblue , @sunmaggot and all the other cyber Johnny Appleseeds. Welshblues' entry is especially elegant. Looks like a lot of different approaches were used in this contest, which I like to see. Thanks to @toe_head2001 for hosting the competition!
  8. @BoltBait, here is a suggestion for how the Paste Alpha Code might work.
  9. I prefer using Ctrl+Shift+C to copy the merged image, followed by Ctrl+Alt+V to paste the merged image into a single-layer image that can be saved (in this case, in dds format). That way, the layered image is left associated with the original filename and format. Any updated versions can be saved into the flat image using Ctrl-V to paste, followed by saving.
  10. You seem to have some personal definition of what a "true alpha mask" is. I have no idea what you mean by that phrase, and I doubt BoltBait does either. Why don't you tell us what you think a plugin that provides a "true alpha mask" should do? How would it be different from a plugin that sets alpha to the minimum of the image and clipboard alphas? What does that mean? How can they not be some specific color? A pixel is transparent if and only if its alpha is zero, and any pixel whose alpha is zero has to have something in the RGB values, which will become its color if the alpha is changed. If you're saying you don't want transparent areas to be made nontransparent, fine, but that's what using the minimum or product of the alphas would do. (You can't just leave the transparent image pixels unchanged and replace all the rest with the clipboard alphas, since that will produce ugly artifacts when almost-transparent image pixels get replaced by opaque clipboard alphas.)
  11. I'll try to come up with the exact situation, but my guess is that the only things that really matter are that opaque image pixels are forced to have the clipboard alpha, and that all pixels are made transparent if they're transparent in either the image or the clipboard. In which case either multiply or use-least would suffice.
  12. I'll be happy to provide the code. I want to see if I can do it in integer arithmetic, so it may take a day or two to refresh my memory on the ins and outs of doing that and getting the best result. There is another idea that's weird but more flexible: allow the option of applying blend modes to alpha. The alpha values could be copied into, say, the R values of pixels (whose alphas are 255), the op applied, and the result used as alpha. The Clipboard would be the upper-layer pixel, so Normal would result in substitution. Perhaps such an option isn't useful enough to justify the confusion it might cause. On the other hand, it would allow both Multiply and "least opaque" (Darken). That's actually a way Multiply could be done. Just copy the alphas into a pixel color byte, apply the Multiply op, and use the result. I don't know if that's easier than just using integer arithmetic on the alphas, which shouldn't be too difficult. EDIT: After thinking about it, I must admit I'm not sure what the best way to combine alphas is. Perhaps it is "Use least opaque alpha." I know there have been quite a few times when I wished I had an easy way of combining alphas, but off the top of my head, I can't think of exactly what I was doing, and what would have worked best.
  13. @fuerudo, I think I know your problem, which is a misunderstanding of what Paste Alpha does. Paste Alpha replaces the alphas in the image with the alphas taken from the clipboard; it doesn't combine the alphas. It doesn't care that an image alpha was originally zero. If the clipboard alpha is 255 (opaque), that's what the new alpha will be. When you pasted the alpha from the green-bar image into the red-bar layer, all the pixels along the green bar became nontransparent. The ones along the green-bar diagonal that were originally transparent showed up as white, because transparent pixels are typically white with an alpha of zero. I wish there were the option to combine the alphas (which would be done by multiplying, then rescaling to the proper range).
  14. The user can choose between using the greyscale value of the clipboard pixel or its alpha value. The desaturateOp call converts the pixel to greyscale for the greyscale choice.
  15. Voting period over already? That week sure went by quickly. Sorry, I forgot to vote this time. I couldn't decide which entry to vote for, so I decided to decide later. My pace was obviously too snail-like. Congratulations to MadJik's and Pixey for their clever, amusing, and well-executed entries.
  16. If Paste Alpha has a problem, you should need only two images to demonstrate it: the alpha image, and the image it will be pasted into. Either Paste Alpha leaves the color alone while changing the alpha to appropriate value, or it doesn't. The effect of blending the resultant layer with other layers is a Paint.NET matter, not a Paste Alpha matter. You can even specify coordinates of the alpha-pasted pixel that's wrong. It can be easily checked with the Color Picker. Either the color will be changed from before the Paste Alpha, or the alpha won't be changed to what it should be.
  17. @welshblue I have a comment on the Texture Scaler thread which may help with producing beveled rectangles, along with other such shapes. I'll try to provide an idea for the wings soon. I think the the basic idea is to make a texture map that matches the way you want the wings to bend, then use the Add mode of the Texture Merger to combine the wings with the shape to you want them bent. (Or I should say "combine the wing," since I would guess it's easier to do one wing at a time.)
  18. New version 1.2. I fixed several bugs that made the plugin less useful. I added a "Don't Scale Transparent Pixels" option. I modified feathering so that instead of specifying a height at which feathering ends, the user specifies the range of feathering within the Minimum to Maximum height range. The Don't Scale Transparent Pixels option allows the range of a height-map object to be changed without changing the height of the transparent background (which will usually be zero). Combined with Pre-Scale Heights to Entire Range and Set Transparent-Pixel Heights to Zero Before Scaling, it forces the height of transparent pixels to zero, while moving the height-map object so that the minimum height of the object pixels is zero. This can be quite useful for producing height maps by blurring shapes. The basic idea is: Draw a white shape on a black background. For example, a filled rectangle. Copy the image to the clipboard (after, perhaps, a one or two pixel blur to soften the edge). Blur the image. The type and amount of burring depend on the desired result. Use BoltBait's Paste Alpha to restore the original object shape and make the background transparent. Run Texture Scaler with the first three options enabled. Perhaps also use a bit of feathering. In many cases, it will be useful to use the Texture Smoother to smooth the resulting height map. Another way: Draw a white shape on a black background. For example, a filled rectangle. Perhaps blur a pixel or two to soften the edge. Duplicate the layer. Set the top layer's Blend Mode to Multiply. Blur the top layer. The type and amount of burring depend on the desired result. Merge the layers. Run Texture Scaler with the all options set, and a Feather Range of 0. (This erases the black areas) Rerun Texture Scaler. (This rescales the non-transparent pixels.) In many cases, it will be useful to use the Texture Smoother to smooth the resulting height map. Another approach that seems to work well is to use the first method, but do the Texture Smoothing before doing the Paste Alpha. There are plenty of possible variations, especially tricks to make the outer edge smoother. For blurs, I usually use Gaussian Blurs or Motion Blurs, such as two Motion Blurs at right angles.
  19. @welshblue, I like answering questions about the height-map plugins, so ask away! I'm not sure what you're asking for with the Render Square request. Do you want something that will render a cube with different rotations? I need to improve my plugin that renders sphere height maps, so I would certainly consider adding additional features, or perhaps creating a new plugin. I'm currently working on a new plugin that will render certain kinds of height maps. It should be quite useful, I think. I keep getting distracted by other things, but hope to finish it soon. There's one -- somewhat significant -- problem I'd like to solve first. Maybe I'll release a beta version of what I have now. Right now, there's no universal solution to producing different height maps, so producing a specific one is rather ad hoc. The proportions of a height map can be modified by copying the map to clipboard, then running Texture Merger with the Height Merge Method set the Clipboard (No Displacement). Two height maps can be combined by setting the Height Merge Method to Maximum. For example, if you have a height map of a long cylinder, like a tube, and a height map of a sphere, the sphere can be added to the end of the tube by using the Maximum Height Merge Method. It is often helpful when using this method to enable the rather obscure feature, Weight Clipboard Heights by Opacity. This allows the clipboard height to be offset (to move the clipboard object forward) without the heights in the transparent areas figuring into the maximum comparison. (Possibly this should be enabled by default.) A trick I've used if I have a height-map that's almost the shape want, but not quite, is to distort it with a tool like Grid Warp. The problem is, this mis-interpolates the heights as if they were colors, so the resultant map is rough and ugly. Often, though, it can be smoothed using the Texture Smoother plugin. That's the idea I used to produce the apple shape for my OOTF apple entry. Many of the Height maps I've used have been produced by making the profile I want, filling the outside of the profile with black and the inside with white, then blurring to round the edges. Very often, I blur a little (a pixel or two), copy the image to the clipboard, blur some more, then use BoltBait's Paste Alpha to make the region outside the object transparent. I then use Texture Smoother to smooth the height map. Different blurs produce different results. Two Motion Blurs and right angles to each other, can be useful. Another trick is to start with a height-map shape with rounded edges, then Multiply it by a sphere (or ovoid sphere) in the clipboard. That's the method used to make the heart example on the first page. The outside will fade to zero height, while the inside will be spherical. If you have a specific shape you'd like to produce, describe it on this thread, and I'll try to come up with a method to produce it. We'd both probably learn some things.
  20. That's something I do often. You need to use a plugin that allows you to move the alpha values of a layer. I use Paste Alpha from BoltBait's plugin pack. To you use Paste Alpha to transfer the alpha: - Make the layer with the alpha you want the active layer. - Press Ctrl-C to copy the layer to the clipboard (note: you do not need to do a Select All first). - Switch to the layer whose alpha you want to replace. - Run Object>Paste Alpha, making sure the alpha source is alpha, not shades of gray. (The alpha can also be copied from a different image.) (I see toe_head2001 replied while I was typing this, but I'll post it anyway.)
  21. EDIT 1: 8/3/2017 -- Redid (improved, I hope) surface color. EDIT 2: 8/3/2017 -- Slightly changed profile. EDIT 3:L 8/7/2017 -- Another profile modification, which I think is an improvement.
  22. Thanks, Ego Eram Reputo! I'd somehow missed Red ochre's very interesting Tone Gradient Magnitude plugin. I think I confused it with Tone Gradient Angle , not realizing they were different plugins.
  23. 'Tis done. The plugin is now in the Stylize submenu.
  24. I agree it should be in a submenu. I incorrectly thought the original wasn't, and was just trying to preserve that. I'll probably put in in Stylize. I hope to create a version that also supports 24-bit height maps, and put that in my Height Map submenu. I'll create a new submenu-ed version in a day or so. (As far as Advanced, I know others disagree, but I think that submenu should be reserved for "meta" plugins such as CodeLab and ScriptLab.)
×
×
  • Create New...