Jump to content

n d

Members
  • Posts

    120
  • Joined

  • Last visited

Everything posted by n d

  1. It would be feasible, code-wise, but I don't see the point. If you want to, you can run feather selection yourself right after using this.
  2. 1. Render clouds 2. magic wand anywhere on the clouds 3. new layer & shaped gradient 4. invert selection, shaped gradient easy. although, if you're concerned with aliasing, you'd better put the first & second shaped gradients on separate layers, then run object feather on radius 1 on each of them.
  3. What I mean is, when you use a plugin on a selection, the outline of the selection is always going to leave a jagged edge, the plugin cannot affect pixels outside the selection... you can see this same phenomenon on other selection plugins like bevel selection, outline selection etc. I could add a gaussian blur function to the plugin, but then, you can already do a gaussian blur after using the plugin, so it seems rather redundant to me... Anyway, here's some things you can do with this plugin + some other common plugins... looking at the images, you can probably guess which other plugins were used
  4. lol, it wasn't that hard, but you're welcome ps. for the record, I refuse to spell Colour without a U.
  5. I'm really a noob to today's coding (did some coding back at msdos times) but my understanding is that with the .net framework it doesn't really matter which language you use, they're more like different dialects of the same language... heck, some of the compilers can even translate between C# <-> Visual basic <-> Boo source code so that the program stays the same, just the language changes... Anyway, I can't help but associate any programming language with "Basic" in it's name with those really crappy, slow & inflexible Basic-languages of the 90:s (anyone remember quickbasic? or GWBasic?)... ...so anyway, I do recommend C#, it's really not a hard language to learn - took me maybe 3 days to learn enough to write a paint.net plugin... but mainly I recommend it because you can use Codelab and with Codelab you can type the code and instantly see what it does on the screen... convenient, very convenient.
  6. Download >>> colourchop3.dll Moderator Note: DLL supplied by EER 5 April 2023. This is similar to other colour cutting effects. But it creates a smoother transition from transparent <-> opaque, ie. what it does is it creates half a sine wave curve on the alpha channel according to the tolerance... well, I'd better demonstrate. Original image http://a.imageshack.us/img814/5913/chopsample1.png Colour Chop: http://a.imageshack.us/img340/2818/chopsample2.png Colour Chop with invert: http://a.imageshack.us/img830/443/chopsample3.png Source is available on request.
  7. Adding anti-alias may be problematic since the plugin works on a selection. At least, I have no idea how to do it...
  8. You could also try my new Shaped Gradient plugin (still at development: may be a bit slow but is fully functional.) It can be found here ->
  9. Thanks Weylin. This is nifty for making 3d text btw:
  10. Good luck with that... QC is awesome!
  11. Well thanks for the kind words... I appreciate it. Can I ask what kind of computer you have? Because on my 1.8ghz core2d it takes like 5-10 seconds to render a 800x800 selection... I came up with the program algorithm on my own... basically what it does is, it gets the angle between the current pixel and the center of selection... Then it moves pixel-by-pixel in that angle to the other direction (away from center) and checks on each pixel if it's selected, and when it finds a pixel that is not selected it assumes it to be edge of selection. Then it calculates the distance to center & distance to edge, and calculates the colour based on the ratio of the distances. I'm wondering if something like this might work better: before the render loop, it would scan a full circle to obtain the edge of selection for each angle, then in the render loop just get the angle vs center for each pixel and retrieve the edge distance from an array... Anyway, it would be extra nice if some of the more experienced coders could give some hints&tips on this. I'm satisfied with what the effect does, I'd just like it to do it a bit faster
  12. Just to clarify... will this optimize the size even more than what optipng already does? (I would guess yes, since optipng is lossless and this sounds like it has at least some loss...)
  13. I'm very new to C# - I only started learning it a few days ago. So here's the first plugin I managed to make - it creates a gradient in the shape of the selection. It works fine, but it's a bit slow... can someone help me optimize the code? Download plugin from this link: Shaped Gradient 1.1 Here's sample output: Here's the source: #region UICode ColorBgra Amount1 = ColorBgra.FromBgr(0,0,0); // Center colour ColorBgra Amount2 = ColorBgra.FromBgr(0,0,0); // Edge colour #endregion void Render(Surface dst, Surface src, Rectangle rect) { // Delete any of these lines you don't need Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int MaxX = ((selection.Right - selection.Left) / 2); int MaxY = ((selection.Bottom - selection.Top) / 2); PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds); int CenterX = MaxX+selection.Left; int CenterY = MaxY+selection.Top; int MaxDist; double disd = System.Math.Sqrt ( (MaxX*MaxX)+(MaxY*MaxY)); MaxDist = (int)disd; // maximum distance is MaxDist; // render loop: double dx,dy; double cDist; int eDist; int loopnum; double cAngle; double nDist; int cAmount, eAmount; ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { // get angle to center: dx = x - CenterX; dy = y - CenterY; cAngle = System.Math.Atan2(dx,dy); // get distance to center: cDist = System.Math.Sqrt((dx*dx)+(dy*dy)); // distance loop: loopnum = MaxDist - (int)cDist; eDist=loopnum; for (int a=0; a<loopnum; a++) { double xx,yy; int xa,ya; xx = System.Math.Sin(cAngle)*(double)a; yy = System.Math.Cos(cAngle)*(double)a; xa = (int)xx + x; ya = (int)yy + y; if (!selectionRegion.IsVisible(xa,ya)) {eDist=a; a=loopnum;} } nDist = (cDist/(cDist+(double)eDist))*255d; eAmount = (int)nDist; cAmount = 255-eAmount; // pixel draw code int r = ((Amount1.R * cAmount)/255) + ((Amount2.R * eAmount)/255); int g = ((Amount1.G * cAmount)/255) + ((Amount2.G * eAmount)/255); int b = ((Amount1.B * cAmount)/255) + ((Amount2.B * eAmount)/255); CurrentPixel = ColorBgra.FromBgra((byte)b,(byte)g,(byte)r,(byte)255); // CurrentPixel.R = ((Amount1.R * (byte)cAmount)/(byte)255) + ((Amount2.R * (byte)eAmount)/(byte)255); // CurrentPixel.G = ((Amount1.G * (byte)cAmount)/255) + ((Amount2.G * (byte)eAmount)/255); // CurrentPixel.B = ((Amount1.B * (byte)cAmount)/255) + ((Amount2.B * (byte)eAmount)/255); dst[x,y] = CurrentPixel; } } }
  14. There are several ways, but the best one depends on the type of the image. If you want all the white to be replaced with transparent, you can use the curves+ plugin: select advanced, set input to luminosity and output to alpha. Then invert the curve. If your image is black and white you can use the black and alpha plugin. There are also other plugins that can accomplish this. You can also simply use the magic wand to select the area you want transparent, then click delete to turn it transparent. In this case I think the magic wand may be the best method, since there is also white inside the image. After you delete the white around the image, use object feather to get rid of pixelation around the image.
  15. Here's a few things I've learned about using bevels... When you use bevel selection on transparent layers it's always good to give it an object feather with radius 1 afterwards to get rid of the pixelation from the selection outlines. This way you won't have to blur the whole bevel. Another thing I do with bevels is to make several bevels with the same selection, each with different thickness and each on its own layer. Then I can adjust the blend modes/opacities of each layer to create a sort of gradient bevel. Also there's an alternative to using bevel selection: you can just type the text in black on a transparent layer, apply a slight blur, then use height field to normal map or engrave/emboss, whichever suits your purpose better. Height to normal seems to work better on things with small detail, but you'll need to convert it to black and white. After you apply height field or emboss, set the layer on overlay, and if it's not strong enough duplicate the layer a few times until it is.
  16. Ok here's a method I devised in 5 minutes or so. 1. set colours to dark brown and light brown, both slightly desaturated. Render clouds at scale 50 and roughness 1,00 2. add noise with intensity 60, colour saturation 0, coverage 100 3. motion blur with dist 10 and slightly tilted angle 4. add a new layer and set colours to black&white, then render clouds on the new layer at scale 250 and roughness 0,50 5. set the new layer to multiply @ 120 (or overlay if you want lighter fur), merge it to the lower layer, and you have this:
  17. Ok there's lots of unnecessary steps in this... For instance you take a random image, mess with curves, shape 3d, then shrink it only to get a small brown blob of maybe 20x20 pixels? I don't see the point... you could just use the elliptic selection tool, select brown & dark brown as colours and render clouds on the selection... to get that same small blob of brown with far less work. Also for filling the screen with the blobs... just copy it a few times until you fill a square area, select & copy the square and use tile fill. Although as Ash said this can be done a lot simpler with render clouds and a few blurs.
  18. Oh I see... Ok here's my contribution. This creates a sort of stone wall texture with cracks in it. It looks like this: Here's how you do it: 1. Render clouds with the settings in the image (281, 0.43) 2. Render clouds again but this time change blend mode to glow. Repeat effect (ctrl-F) once. Result looks like this: 3. Again render clouds, but this time change the blend mode to multiply - AND RESEED! this is important, if you don't reseed it won't be the same. 4. Height to normal with 6,33, then convert to black and white. 5. Create a new layer, and render clouds with new settings (110, 0,43, normal): 6. Again height to normal & black and white, ie. Same as step 4. Result looks like this: 7. Set the top layer to overlay, with opacity of 190, then merge the layer down. You're done!
  19. Um. What's the difference between height to normal and just using Emboss/engrave? I've always made textures like these using emboss/engrave and I was wondering if there was a reason for using height to normal...
  20. 1. layer: background -> colour this with the background colour. 2. layer: text -> enter your text here, use stylize -> emboss on the text. Now put layer 2 on overlay. Grey is invisible on overlay mode, white makes the background lighter and black makes the background darker. Emboss really works best when you use it with overlay blend mode.
  21. So is there anyone who would be willing to code a plugin like this?
  22. Here's a trick I recently figured out: how to do colourblind filters on PDN. For those who don't know, a colourblind filter is a filter that simulates colourblindness; ie. it will make your image look like what it would look like to a colourblind person. This is often necessary for website design and other similar applications, to ensure that your graphics will be legible to colourblind persons. Anyway, here's how I do it - this trick simulates red/green colourblindness since it's the most common form: I take curves+ and select RGB, then deselect blue and set Red+green into half intensity, ie. set the upper-right dot down to 127 (so the scale is 0-127.) Then I take pixellab, and enter the commands (in this order!): Red add to green Green set to red And that's it, your image is colourblinded.
  23. That hardy guy sounds like a total <family-friendly forum>.
×
×
  • Create New...