Jump to content

PJayTycy

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by PJayTycy

  1. Ok, I have updated this plugin. It's not feature complete yet, but close enough for me.

    Then why don't you publish it in the Plugins forum? I'm sure many people who have never so much as looked at this forum would be interested in downloading this plugin. :-)

    Maybe because PJayTycy feels "It's not feature complete yet" ??

    Nah, I'll probably post it there somewhere next week if nobody reports any problems here.

  2. Ok, I have updated this plugin. It's not feature complete yet, but close enough for me.

    Thanks to Madjik for converting the previous version to use IndirectUI. The UI is better and easier to expand now, however, I would have spent a lot of time trying to figure out how IndirectUI works.

    I also add yet an other feature : multiple repeats / turn. It works good if the center is correctly chosen, if the center is not chosen completely OK, you might get visual artefacts (ie: with 3 repetitions / turn, you could get something triangle-spiral looking instead of a normal spiral)

    No example picture this time as third attachment, but a User Interface screenshot :mrgreen:

    DrosteEffect_003.zip

    droste_vs_project_003.zip

    11228_3099e131ab1ba672761c7274ab0bb4b2

  3. I'm liking this plug in.

    thanks

    why do I have to have two .dll's for it to work?

    one is the external library for Complex Numbers, one is the actual plugin

    is this still in the works?

    yes

    I'd like a reset to default button at least, and maybe just a little text showing the range of numbers say works 0-300 0=1000 what ever for each axis.

    the next version should use sliders instead of numbers

    from my end its a nice plug in but needs some work on the user friendliness factor.

    I know, but somehow I am more interested in adding features than polishing the UI for the moment.

    btw, an other image I made with the second version:

    2095706414_3462b1d281_m_d.jpg

    http://www.flickr.com/photos/21654695@N02/2095706414/

  4. AdditiveBlendOp implements the OVER operation with addition. It's as if 'rhs' is blended "on top of" lhs. If rhs is fully opaque, the result will be rhs regardless of what lhs is. I can almost guarantee you that this is what you want -- it's what Paint.NET uses for its layer composition when you choose the Additive blend mode.

    As I can not see in the source code what it does, I tested the layer composition. It is not exactly what I want.

    What it does:

    black@50% + white@50% => 2/3 white@75%

    So, the lhs is only counted for 25% (rhs_remaining_alpha*lhs_alpha).

    I want it to be counted for 50% (minimum(rhs_remaining_alpha,lhs_alpha)) and have the result be 1/2 white@100%.

    Maybe one of the other blends works like that ?

  5. Hello,

    Thanks for the help Madjik and Rick. I will certainly try to convert my plugin to use the new UI methods and include the center offset code.

    For now however, I have been working on a new feature : work with transparency on the outside circle instead of on the inside (transparency on both sides should work too).

    An example of what you can do :

    • [*:yn3bui68]I took
    this photo
    [*:yn3bui68]I expand the canvas so the center of the cup is +/- center of the picture (only necessary because I have not yet added the center offset code).
    [*:yn3bui68]I removed some of the outer parts (ie: made them transparent) using the magic wand tool in Paint.Net
    [*:yn3bui68]Applied the droste effect with "outer transparency" selected (sorry, I don't remember the exact radius settings)

    11228_adb99e9038b0fa1c47c3bfb912a29c04

    droste_vs_project_002.zip

    DrosteEffect_002.zip

  6. Also, instead of using your own AddColor() method, I recommend making use of PaintDotNet.Data.UserBlendOps.AdditiveBlendOp:

    UserBlendOp addOp = new AdditiveBlendOp();
    result = addOp.Apply(lhs, rhs); // result = lhs + rhs

    It will do all the work of ensuring the alpha channel is handled correctly (which is trickier than you may think).

    Is this AdditiveBlendOp also asymetrical ? My addColor function will give the first color full priority over the second color (ie: only add a little bit of the second color if they both have only a little bit of transparency)

    (0, 0, 0, 200) + (255, 255, 255, 200) => (55, 55, 55, 255)

    (255, 255, 255, 200) + (0, 0, 0, 200) => (200, 200, 200, 255)

    I thought the normal Paint.Net functions would give (127, 127, 127, 255) in both cases.

  7. Few tests done!

    Remarks:

    1: submenu distort

    2: (icon?)

    3: need sliders!!

    4: and yes perhaps a way to choose the center

    5: ...and the start angle?

    BTW, you should wait the next Paint.net version, so you'll be able to add/create easilly the UI and the controls...

    Thanks for testing. I think the plugin is polished enough for this forum, but not yet for the general plugin forum. :)

    1, 2 : Will try to do that, was not really a focus now. I just added a simple UI on top of it after I got the algorithm working.

    3 : sliders : I searched them in the Visual Studio toolbox, but somehow didn't find them :?:

    4 : choosing center is very easy to implement in the algorithm, so should be in the next update

    5 : by choosing start angle, I think you mean rotation ? It's on my list of "maybe interesting features, which might or might not be easy to add". That list contains : rotation direction, rotation start angle, zooming, number of repetitions in 360 degrees (currently == 1), mirror subsequent repetitions, ...

    About waiting for the next version, 2 questions :

    • [*:xzwo9amg] I'm using 3.20 beta 2 currently. Can I use the new UI features with that version already ?
      [*:xzwo9amg] The compiler gives an "obsolete" warning on this part of the code (from the plugin template) :
            public EffectPlugin()
               : base(EffectPlugin.StaticName, EffectPlugin.StaticIcon, EffectPlugin.StaticSubMenuName, true)
           { }

    Which PaintDotNet.Effects.Effect constructor should I use instead ? And how do I set the properties then ?

  8. MODERATORS NOTE:  this plugin has been superseded by a newer version:

    https://forums.getpaint.net/topic/32240-droste-v11-may-8-2019/

     

     

     

    [edit]

    If you come looking for the latest version, go to this post.

    What follows here are the original text and downloads from when I just started this plugin.

    [/edit]

    Hello, this is the first "good" version of my Escher / Droste plugin.

    First some references to other places:

    • It is based on the mathematics on this page
    • It uses an external mathematics library, mainly for its Complex Number support.
    • The idea for the plugin itself was inspired by this flickr group.
    • I used the code lab plugin to test out some things first. (but sadly could not continue using it when I started using an external library).
    • I used the plugin template, together with BoltBait's detailed steps (4th response in that thread) to create the plugin in visual studio.

     

    Currently there are not yet many parameters to tweak, except for inner radius and outer radius. One simple parameter which is still missing for example, is the ability to move the center position.

    It does work with non-circular boundaries too, if you create transparent sections in your image. See for example the image I attached here. I transformed it using inner radius = 25, outer radius = 110 to get the result.

     

    Attached are these files :

    • a zipfile with the compiled dll + external dll (put them both in Paint.NET/Effects)
    • a zipfile with the visual studio project (you might need to fix the references to the dll's if you installed Paint.NET in a non-standard directory)

     

    Have fun, and post your resulting images please :)

    DrosteEffect.zip

    droste_vs_project.zip

     

  9. Thanks for your answer.

    I tried to use MathNet Iridium as library and do some testing in Codelabs, but I cannot put "using" statements in CodeLabs.

    I could copy/paste the complex number class into my CodeLabs script for prototyping, but will I be able to use the compiled dll of an external library if I create a "real" plugin from it ? Or are there plans for CodeLabs to allow us to use external libraries ?

    Thanks,

    PJay

  10. Hello,

    for a plug-in I'm trying to write, I would like to be able to use complex numbers. I have a rudimentary version, where I changed all mathematics to work on a set of 2 doubles (either {real, imag} or {radius, theta}). I used 2 custom functions : PolarToRect() and RectToPolar(), to change between [real, imag] and [radius, theta] information.

    However, as complex numbers are so common, and some complex number libraries exist for C#, I was wondering if Paint.NET already includes one of those libraries or has some functions to work with complex numbers from itself.

    Thanks,

    PJay

×
×
  • Create New...