Jump to content

davidf

Members
  • Posts

    63
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by davidf

  1. One suggestion - how about using tabs for the settings ? ( ie Colours, Start Point, Number of Lines, Styles, Twist , Recentre)

    It would reduce the size of the UI considerably and make it more user friendly.

    At the moment I'm using a thing called IndirectUI which provides GUI controls specifically for PDN ... it gives you limited control over the interface, though. I don't think it includes support for tabs (anyone know different?).

    Edit: looks like midora beat me to the answer while I was writing this!

  2. As I've said before - people who create these plug-ins have my upmost respect and I thank you for doing them (I'd love to know how you do them ... is it like writing a programme for a hard drive, perhaps?).

    If you'd ever like to make your own plugin, the best place to start is the CodeLab plugin, which does lots of the work for you:

    http://forums.getpaint.net/index.php?showtopic=880

    (There are some links to tutorials in the first post in that thread).

  3. I'm really enjoying this plugin - just had fun making a meadow!

    curlylinesgrass.png

    I love it!

    It could be useful to have shading across the width of the line too? (if not too cumbersome to add).

    This could be from the primary color, as adding another color wheel would make UI even bigger.

    Just think it might add more 'depth' when using it for grass/flowers.

    Width-wise instead of length-wise shading sounds good ... it would help with "flame" images and things like that.

    The next version might not be for a little while, though.

  4. And in this one, just the sparks are curly lines plugin.

    Click for larger size (980 KB):

    th_lazerball.gif

    Very cute! Animated, too.

    That's one of the effects I had in mind when I started writing the plugin (as well as the idea of electricity flowing between two points). It was originally called Lightning / curve.

    One parameter I didn't get around to adding was "fork" (or "split") to make lightning more realistic and create fractal-looking tree things.

    • Upvote 1
  5. It would be nice if you could add the parameters you used to create the examples.

    If I could remember them all! :P I did write some down, actually. Is there a particular example you were wanting parameters for?

    Maybe there could be a "recipe book" with example images and their parameters? Not sure how much one is needed ...

    Maybe we could discuss a general way for plugins how to get and put whole sets of plugin parameters (i.e. using an XML description).

    And I'm happy that you implemented a solution for the reseed (as I just proposed in developer central). Looks like a simullar understanding of the issue.

    Being able to save and restore a set of parameters via XML sounds like a good idea.

    Two things I wasn't sure how to implement using IndirectUI:

    • Ideally, pressing Reseed should fill in the Randomization code field (with a random string).
    • It would be good to have a Reset all button that sets all of the parameters to their default values.

    Is there a safe way to set control values programmatically for a PropertyBasedEffect?

  6. Wow, looks like it can do some really cool things. But that UI is really intimidating ;)

    Hope that doesn't put people off too much!

    Normally you only need to use a small number of parameters at a time. For example, to draw a star, click Radial then set Displacement to zero, Number of lines to 10 (or whatever) and move the start end and end points. (Then change Start width and the colors).

  7. Effects > Render > Curly Lines

    This plugin draws all kinds of curly (and straight) lines ...

    Added in Version 1.1a:

    • Draws an initial line instead of just a dot.

    Added in Version 1.1:

    • The dialog is now resizeable (thanks to midora).
    • Two new color modes: "First to second color -- across width" and "Emboss", along with "Emboss angle".
    • "Swap colors" checkbox.
    • "Transparency".
    • "Start radial direction is random".

    For information on the new features, see this post:

    http://forums.getpai..._20#entry381760

    The PDF guide has been updated too, though it only describes the new controls very briefly.

    (Note: the dialog shown below is for version 1.0).

    curly%20lines.jpg

    There are a large number of parameters, so I wrote a small guide, which I recommend reading before using the plugin (it includes a quick tour of all the parameters):

    http://home.lizzy.co...gin%20guide.pdf (856 K)

    Have fun! I'd love to see people's pics.

    Download: CurlyLines1.1a.zip

    Known bugs: As mentioned in the PDF guide, this plugin has a problem handling lines with high widths and chaotic (low smoothness) lines or the "short sharp" end style.

    • Upvote 7
  8. It looks like that the plugin does not return SubmenuNames.Render in the StaticSubMenuName function instead it seems to use "Render".

    Thanks, I didn't know about that -- the .zip file in the original post has been updated to version 1.2 now (this is the only change, so no need for English speakers to re-download).

    How do you learn about these kinds of things? The template code I was using didn't have this information. I'd love it if there was a "complete guide to writing PDN plugins" ...

  9. Now greedy as I am ...... hoping you want to be able to take 6 colours (say red blue green yellow white and black) and do the same thing. Take a photo and reduce it down to 6 basic colours.

    Try this:

    Adjustments > Posterize to reduce to six colors, then Artistic > Dot with either "lighten only" or "darken only" selected, depending on the image.

    Is that the kind of thing you were thinking of? If not, could you describe it another way?

    Great job davidf !!

    Thanks for the encouragement!

  10. And a question. Would you provide a code snippet how you are mapping the colors to the gray values generated by the algorithm?

    The levels are just proportional to the distance from each point. The main algorithm for "nearest neighbor" is:

    • For each square in the grid (side length = "cell size" parameter), pick a random point (the cell centre).
    • For each pixel (x, y), find the distance D to the nearest cell centre and divide by the cell size to give a value W; if W > 1, set W to 1.
    • Linearly interpolate between the foreground and background colour using W: foreground * (1 - W) + background * W.

    The "intensity" parameter is also added to W (and the result is restricted to the range 0 to 1).

    I changed the distance function a bit to move the nuclei out of the center of the cells and got the attached images.

    Pseudo code:

    distance.x = nuclei[ i].x - pixel.x; if (distance.x > 0) distance.x = distance.x * 3;
    distance.y = nuclei[ i].y - pixel.y; if (distance.y < 0) distance.y = distance.y * 3;
    

    So this may also be an idea for an additional option: Weight distances in certain directions.

    I tried it out, and here is the result:

    Download: CellTextureWithDisplacement.zip

    The new parameters are "X displacement" and "Y displacement". If these values are not zero, the X or Y component of the distance is multiplied by 1 + abs(displacement): if the parameter is less than zero, only negative X/Y values are multiplied, otherwise only positive values are multiplied. If the paramaters are X displacement = 2 and Y displacement = -2, the result is exactly the same as your code above.

    I'm not very fond of this variation though (I think it leaves too many empty areas), so I won't make it the official download.

  11. FWIW, I've been enjoying your plugins so far. I've got my eye on you. ;)

    Thanks!

    You want to tackle something tough? How about a "seam carving" canvas plugin? :D

    I'm already on something at the moment ... it's a surprise, though :smile:

    It'll take a few more days (and then another few days to add the extra features I've thought of by then ...)

    Is there a general area where people post ideas or requests for plugins, by the way? Or is that just mixed in with the other forums?

  12. Effects > Distort > Seamless Move

    Note: it turns out this plugin is fairly redundant (see posts below), so feel free to ignore!

    This is a small plugin to help create seamless images: it lets you scroll an image around, wrapping around the left & right and top & bottom of the image.

    For an alternative, see the Seamless Texture Maker plugin (which does something similar to this with the "only cut" option, but with no scrolling): http://forums.getpai...?showtopic=4591.

    seamless_move.jpg

    The parameters are:

    Position - drag to change the center of the image.

    Fine tune X / Y - pixel perfect X and Y adjustment.

    The CodeLab code is very short:

    #region UICode
    Pair<double, double> Amount1 = Pair.Create( 0.0 , 0.0 ); // Position
    int Amount2 = 0; // [-100,100] Fine tune X
    int Amount3 = 0; // [-100,100] Fine tune Y
    #endregion
    
    void Render(Surface dst, Surface src, Rectangle rect)
    {
    int w = src.Bounds.Width;
    int h = src.Bounds.Height;
    int dx = -((int) (Amount1.First * 0.5 * w) + Amount2);
    int dy = -((int) (Amount1.Second * 0.5 * h) + Amount3);
    
    for (int y = rect.Top; y < rect.Bottom; y++)
    {
    	int ypos = (y + dy) % h;
    	if (ypos < 0) { ypos += h; }
    
    	for (int x = rect.Left; x < rect.Right; x++)
    	{
    		int xpos = (x + dx) % w;
    		if (xpos < 0) { xpos += w; }
    
    		dst[x,y] = src[xpos,ypos];
    	}
    }
    }
    

    One problem is that there is no obvious way to reset the parameters to all zero when the effect is restarted; it always remembers the parameter values last used, which is not really appropriate for this particular plugin.

    Anyone know of a way to do this (within either CodeLab or a Visual Studio project)?

    Download: SeamlessMove.zip

  13. There's no way of using IndirectUI like that. If you want a custom dialog, you can't derive from PropertyBasedEffect or use IndirectUI. You'll have to create a WinForms dialog and do all the data binding yourself, a fragile and bug prone way of doing things (which is why IndirectUI exists).

    OK, that's fine -- I can understand the reason for doing things that way. But it would be great if there was a way to extend PropertyBasedEffect one day to allow custom WinForms controls to be added to it.

    Thanks! (I really do appreciate the existence of IndirectUI after coding an effect that uses it ... it definitely makes things easier).

    Seen the Visual Studio plugin template? Find it here: http://forums.getpai...lugin-template/

    It works with a bit of tinkering. Follow BoltBait's guide in post #4 of that thread.

    I use it with the Express Edition of VS - so you don't even need to spend $$.

    Yep, I've had a go at using it already -- thanks.

  14. Effects > Render > Cell Texture

    Edit: Updated to version 1.2 (no code changes, just made sure it uses the internationalized Render menu instead of the string "Render").

    Edit: Updated to version 1.1 (added "Combined" distance type and changed "Multiply" method to "Root sum of squares", which looks a bit nicer - also handled coloring better for this method. See left image in the second row below for an example).

    This plugin was inspired by the page:

    http://www.blackpawn...ar/default.html

    The algorithm can create quite a lot of different texture types:

    cell_texture.jpg

    The parameters are:

    Foreground - the color inside the cells.

    Background - the color around the edge of the cells.

    Swap background and foreground - exactly what it says!

    Avoid border - do not place cells near the edge of the image. If this is not set, the image is tileable (i.e. it wraps around the edges).

    Cell size - the side length of the invisible squares the cells are based on (there is one "point", i.e. cell centre, at a random location inside each square - with a slight bias towards the middle).

    Intensity - adjust the distance where the foreground turns into the background.

    Random color - amount of random color to add to individual cells.

    Method - formula to use to determine the color (see the link mentioned above).

    Distance - distance metric to use. "Euclidean distance" is distance in a straight line, "Manhattan distance" is the sum of the X and Y differences, "Chebychev distance" is the maximum of the X and Y differences and "Combined" is a combination of all of these.

    I'd love to see any interesting uses people find for this ...

    (My first plugin created using Visual C#. Yay!)

    Download: CellTexturev1.2.zip

    By the way, when adjacent cells are different colors, there is no antialiasing at the moment -- I need to investigate the best way to do that.

    Known bug: for large cell sizes with "Subtract nearest two neighbors" and "avoid border" both set, there are sometimes some problems near the right or bottom edge of the image.

×
×
  • Create New...