ArgusMagnus

Members
  • Content Count

    69
  • Joined

  • Last visited

Everything posted by ArgusMagnus

  1. ArgusMagnus

    Unblend

    Effects->Colors->Unblend Download: https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/ (Copy the file "ArgusPDN.Unblend.dll" to the "paint.net/Effects" folder) This effect is basically the reverse Operation for the normal blend Operation. From the current selection and a Background Color (Primary Color, Average Color or "Dominant Color" <-- this is experimental, take a look at the code to see what it means^^) a foreground Image is calculated so that every Pixel has to lowest possible Alpha (highest Transparency) under the condition that the result of a normal blend of the foreground and the Background Color is again the original Image. I mainly use this effect to remove the "white" background of scanned sheets or to remove background from an image (e.g. Logo) which is blurred/contains gradients from the image to the background. This effect is only revertible in the sense that blending on the Background Color accurately restores the original Image as Long as tolerance is Zero. Possible improvements in the future include: Different tolerances for Color channels (R,G,B ), Somehow Show the results of GetAverageColor and GetDominantColor to the user. I didn't really know, where to put this. Currently it's under Effects->Reverse Operations->Reverse Blend. If you have a better idea, feel free to share it ? I wrote this Plugin some years ago, but never published it. I got reminded of it when I did something similar in another Project.. and here it is.. v1.2 - Compete UI overhaul - Added HSV Tolerances - New Backgroundcolor Sources: Average color and Dominant color of image from Clipboard v1.1 - Removed Copy to and from Clipboard options (they were buggy) - Changed rendering (render progress is now reflected in image) v1.0 - Initial Release
  2. ArgusMagnus

    FFT / IFFT Effect

    Download: https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/ (Copy the file "ArgusPDN.FFTEffects.dll" to the "paint.net/Effects" folder) This Plugin contains 4 effects related to Fast Fourier Transform and Signal Processing in the Frequency Domain: 1. Transform->Fast Fourier Transform: Transforms either intensity image or one of the channels (R,G,B ) to and from the frequency domain. The transformed image contains the magnitude information in the R and G values and the phase information in the B value (which basically means: don't change the B value of any pixel too much are at all if you want to get a meaningful result when transforming back). If you want to get a meaninful result when transforming back, there are two limitations: 1. Don’t change the B component (the phase information is important), 2. Non-rectangular Selections won’t work. 2. Signal Processing->Low Pass Filter: The same as using the transform effect, removing (setting to black or transparent) all pixel outside a rectangle around the center and transforming back only this is faster, more accurate (less information is lost) and easier to control 3. Signal Processing->High Pass Filter: The same as using the transform effect, removing all pixels inside a rectangle around the center and transforming back (again, faster, more accurate, easier controlled) 5. Signal Processing->Band Pass Filter: Combination of Low and High Pass Filter. Example: FFT Example images (high pass filtered, adjusted and blended together): The plugin actually uses the FFTW library (fftw.org), I have not written the transformation code myself (mainly for performance reasons)
  3. Is there a Basic documentation/how to for writing FileType plugins? I've tried with the help of examples found online and based on the source of plugins like TinyPNG, but I cannot get PDN to Show me my plugin when I click "Save as...". This is what I have so far, any help would be appreciated. (It's a save-only plugin): public sealed class TestFileType : FileType, IFileTypeFactory { TestFileType() : base("Test", FileTypeFlags.SupportsSaving | FileTypeFlags.SavesWithProgress, new[] { ".test" }) { } protected override Document OnLoad(Stream input) { return null; } protected override void OnSave(Document input, Stream output, SaveConfigToken token, Surface surface, ProgressEventHandler callback) { // Do save operation... base.OnSave(input, output, token, surface, callback); } FileType[] IFileTypeFactory.GetFileTypeInstances() { return new[] { new TestFileType() }; } }
  4. ArgusMagnus

    Edge Detect+

    Effect->Stylize->Edge Detect+ Download: https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/ (Copy the file ArgusPDN.EdgeDetect.dll to the paint.net/Effects folder) This effect uses an edge detection algorithm. It draws edges with given colors and sets the other pixels to transparent. I haven't had any good idea for the name, so I called it Edge Detection for now, the (Argus) is simply to make it better distinguishable from the built in Edge Detect effect. If anyone has an idea for a better name, feel free to share it ? UI Explanation (See example below): Lower Threshold: All pixels with values (Structur Tensor Eigenvalues) below this threshold are fully transparent: Higher Threshold --> Less Edges detected Upper Threshold: All pixels with values above this threshold are fully opaque. The range of "good" values really depends on the image. For hard edges (extreme case: black line on white), "good" values may go up to 1, for softer edges (as typically found in photographes), "good" values will usually be below 0.2 Color/Color2/Angle/Hue Direction: Edges with a normal angle the same as the chosen Angle are drawn in the color set in Color, edges with a normal angle perpendicular to Angle are drawn in the color set in Color2, in between the color is interpolated between Color and Color2. Hue Direction determines how the Hue value is interpolated. Difference Filter: The Kernel used to get the image derivates in x and y direction. I have yet to encounter a situation where I needed to change this value. If you change this value, a lot of calculations have to be redone. Some time may pass before you see something happening. Smoothing Radius: As expected, smoothes the output. Performance: Calculating initial values (Structur Tensors) may take some time, therefore, depending on the selection size, it may take some time after the effect dialog pops up before you can see something happening. If you change the value "Difference Filter" these calculations have to be redone. Smoothing is also somewhat expensive, which you can see if you change the smoothing radius. Intermediate values (Structur Tensors, eigenvalues of smoothed Tensors) are held in memory so re-rendering the output for different Threshold/Color/Angle values is fast. The cost for that is memory usage: Roughly 24 bytes per Pixel are used (excluding the memory used for the source and destination surface).
  5. ArgusMagnus

    Edge Detect+

    Thanks for the feedback. 1. Thats actually a left-over I missed, which has no effect as of now 2. I plan on also re-releasing the convolution plugin, so sit tight
  6. You can download all my plugins from here: https://1drv.ms/f/s!AoTkGO_MFp9CoOlMDloruoTbePt2Dw (If you are worried about downloading *.dll files, download the whole folder and OneDrive will zip the files up for you) Effects->Colors->Unblend Remove a background Color from your selection to make it (semi-)transparent Effects->Transforms->Fast Fourier Transform Effects->Signal Processing->High/Low/Band Pass Filter Effects->Stylize->Edge Detect+ Recolor the edges in your selection and make the rest transparent Effects->Render->Barcode Render various barcode formats (e.g. QR-Codes) FileTypes->App Icon Set Saves an image scaled to various resolutions in a structure inside a zip file suitable to be used for app (Android/iOS) development
  7. ArgusMagnus

    FFT / IFFT Effect

    Updated, see https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/
  8. ArgusMagnus

    Unblend

    Updated, see https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/
  9. ArgusMagnus

    Edge Detect+

    Updated, see https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/
  10. ArgusMagnus

    ArgusMagnus' Plugin Pack (2018/10/19)

    I've updated my plugins to be a) v4.1.* compatible and b) completely self-contained (one dll file, no dependencies). The plugin behavior is unaltered. When updating, remove all Argus*.dll files first. Also, there is one new effect (Barcode renderer) and one new filetype (app icon set).
  11. ArgusMagnus

    Basic FileType plugin guidance

    ah.. I feel stupid.. Thanks for the quick Responses!
  12. ArgusMagnus

    The Plugin Browser v1.3.0.2 (Sept 28, 2018)

    It would certainly be worth it. The plugin in the developer section I linked to is fully functional (at least it was at the time) and does exactly that (by lauchning a separate process which requests elevated access to install). In fact, the installation process (copying files, restarting Paint.net) is fairly simple, the hard part is to correctly resolve dependencies and conflicts.
  13. ArgusMagnus

    The Plugin Browser v1.3.0.2 (Sept 28, 2018)

    Unfortunately, the feature you are requesting (and rightly so in my opinion) is forbidden to be included in a PlugIn:
  14. I fail to see why. Of course, "hack" is not really a well defined term, your definition obviously differs from mine. But given the fact that you already can't remove/refactor the EffectTokenConfigDialog class without braking a lot of plugins and you probably won't move away from windows form either, this doesn't seem to be "liable to break" to me. I don't mean to offend you and I appreciate the time you are investing into this amazing free software, but, as you said yourself, these things can take quite some time. This is understandable, but if we (plugin authors) then are forbidden to use real short-term solutions, simply because you don't seem to like them, this is very frustrating. (e.g. I'm still disappointed that my Plugin Installer Plugin was rejected. I've read posts from you from 2008 or so saying that you are planning to provide a plugin management system, which hasn't happened yet and yet, I am not allowed to provide an intermediate solution for unkown reasosn)
  15. If you still need to do something similar without relying on Form.ActiveForm maybe you could iterate over Application.OpenForms and check if one derives from the EffectConfigTokenDialog class to get the effect dialog form. This probably won't be I did something similar to check whether an effect was truly cancelled or if the IsCancelled flag was just set because the user changed values (to determine if I could discard cached data for good).
  16. There are cases however, where you can't get around external dll's (e.g. when you need to interop with native dlls). In my opinion, the real problem is, that the user needs to manually copy installation files/dlls. Ideally, we would provide our plugins with installers, which prevent the user from overwritting dlls with outdated versions (of course you still have to take care, that newer versions are backwards compatible).
  17. ArgusMagnus

    Plugin Installer

    I have developed a plugin installer. I know that this has been done before, but I wasn't happy with the existing solutions. I know that a plugin installer/management system is on Rick's ToDo list, but I wish to provide an intermediate solution, until the real one arrives. The installer can be invoked in two ways: 1. FileType: Open->Plugin Installer (*.pdnplgn, *.zip) 2. Effect: Effects->Advanced->Plugin Installer This will let you open a zip archive (optionally renamed to have a .pdnplgn extension). It will read the containing .net assemblies and show the contained filetype and effect plugins. It will also show you what already existing plugins will be overwritten. If it was started from the effects menu, it will also allow you to preview effects (double click on the effect) before installing it. After clicking "Install" the plugins launch a seperate process which then waits until paint.net is closed by the user and after that copies the files to the paint.net directory. When the installation is complete, it will give you the option to start paint.net up again. However, this won't just simply copy dll's, it will check if there are assemblies which are referenced by the selected ones and copy them as well. If existing, it will also read the PluginInstallerInstructions.xml file in the archive (see the example "ArgusPaintNet (Text).pdnplgn") which lets plugin authors specify non-.net references (like native assemblies or any other filetype) which should be copied and also files which should be removed (e.g. if you have renamed your effect assembly and want the installer to remove the old one). I have read the rules over and over again and I don't think this violates any of them (perhaps the "side effect" clause on FileType plugins, but I could easily remove that) but I'm still not sure if this will be allowed. I have read an old thread where something similar was removed/banned, but I don't know what was actually done since the code was removed. I contacted Rick and he said, that this functionality won't work out as a plugin, but would probably be okay as an external utility, and said, I should post this to the developer section and see how this goes from there. So.. I fear that what I have done till now won't be allowed, but I have still a little hope left since technically, the plugin only shows you plugins (similar to other plugins like the pinned Plugin Browser), the actual installation/file manipulation is done by an external program (you don't see this exe since it is included as resource in the plugin assembly and extracted to the temp folder when needed). Since this might never make it to the public release section, I haven't put too much effort into it yet. It worked well on my personal computers with BoltBait's Plugin Pack and my own (included as ArgusPaintNet (test).pdnplgn), but it is not well tested. You probably wouldn't have a hard time to make it crash (e.g. by feeding it a corrupt archive). I posted this here, so you can tell me if 1. what part of this idea you like and which part you don't 2. Rick (and perhaps senior members/admins) can tell me if this is allowed, and if possible, which part is not allowed (and optionally, just for my own curiosity, why it is not allowed) 3. If this gets the go ahead, you can help me test this, since something like this should be heavily tested before releasing. Download: https://onedrive.live.com/?id=429F16CCEF18E484%21351194&cid=429F16CCEF18E484&group=0 If you want to build this from the source, you will need VS 2015 (previous version probably won't compile it, since the source makes use of new C# 6.0 features). I'm looking forward to your feedback
  18. ArgusMagnus

    Plugin Installer

    Ok. I have read the quoted statement, the reason why it wasn't clear to me if this included the effect plugin is, that your whole explanation why this shouldn't be done as a plugin was based on the assumption, that it would be a filetype plugin. It may be a good idea to update the rules to include this (till the end it remains unclear to me, why this shouldn't be done as an effect plugin, a corresponding entry in the rules could help prevent such confusion in the future).
  19. ArgusMagnus

    Plugin Installer

    I don't think this is likely, other than a real effect which can probably very simply be integrated into the internal assemblies, Rick probably has his own ideas for a real plugin management system and won't just integrate an external tool, even if it is good. So.. I haven't really gotten an answer, can I keep the Effect Plugin? If yes, is anyone interested in helping me test it before I release it to the public? I might still do the external utility, but I don't have too much free time on my hands right now. Edit: I've uploaded a new version with some small fixes, it's less likely to crash now.
  20. ArgusMagnus

    C# and Goto Loop Haters

    My guess is that the speed up is pretty unsignificant. This might become more significant the larger the project, but it also becomes more important to write well organized code.
  21. ArgusMagnus

    Plugin Installer

    Yeah, I know, but nontheless those plugins I listed (including CodeLab) are located in the UI somewhere, where they don't naturally belong and are there simply due to the lack of alternatives. Maybe... I don't like it, because it means to have another little program only serving one small purpose which is not used very often having lying around somewhere. Perhaps I would still do it, but certainly not right away (I probably won't have time in the near future). But I would clearly prefer the Effects->Advanced->Plugin Installer option. I really think this would be more user-friendly. I could even rename it to PluginLab or something to make it fit better xDEdit: On second thought, with an external utility, I could get the file extension association functionallity back which died with the FileType plugin. I would still want the Effect plugin for two reasons: 1. To keep the ability to preview effects before installing and 2. to have a way to access the plugin installer from within paint.net. This mainly because I don't like shortcuts to little tools I rarely use clustering my desktop/start screen and remembering names so I can search them is also not my forté. Within the application which it is used for is the place I would want it to be.
  22. ArgusMagnus

    Plugin Installer

    You are right, the location (File->Open) doesn't really make sense. I would argue that this is also the case for tools effect plugins like CodeLab, Plugin Browser, Color Harmonies or Effect Plugins which let you upload images to imgur or similar sites and that it at least is also not too far off (it still opens/loads something). But if you don't want that, I accept that. You haven't mentioned how you feel about the Effect Plugin with the same functionality at all, would that be possible? I'll be honest, I'm not motivated to realize this as an external utility, it you don't want it as plugin in any way, I will probably just drop this. The reason is that I can't see such an utility being used by a larger user base. I would not download/install/use an utility, which is not somehow accessible through the paint.net UI and I guess others probably wouldn't either.
  23. ArgusMagnus

    Plugin Installer

    Do you mind if I ask why? (I will respect your final decision, but let me try to convince you) I could relative easily covert this to an external utility but I think this would greatly reduce the user experience and I don't know if this would be worth the trouble. Furthermore, in contrast to the plugin solution, it would require "hacks"/ugly methods (somehow get the paint.net process, read registry keys, etc.) which are more likely to fail/be broken by a future update of paint.net.
  24. ArgusMagnus

    Plugin Installer

    Hehe, as I said, not hard to crash^^ I've fixed this, because it required almost no changes. Also the assembly version is now displayed. I have a lot of ideas for improvement, e.g. highlighting conflicting assemblies (possibly with different colors: newer<->green, older<->red), detecting conflicts not only due to conflicting file names but also due to duplicate menu entries, providing an installer for the plugin, possibly with file extension association (so *.pdnplgn would automatically be opened by paint.net, this idea is actually the reason the FileType plugin version exists), but these things would require some work and thus time which I am not willing to invest before I know if I may release this on the forum.