Jump to content

lightknight

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by lightknight

  1. (joke) Yes, I finally got PDN to crash! (/joke). But on a more serious note, it's possibly my crappy plugin code that's causing this...actually, it's most definitely my code (only happens when I run my plugin via Preview Effect...while it seems to work when I just run it in Debug mode). But the crash reporter says to submit it, so I am. Here's the relevant text (I uploaded the complete log as well): This text file was created because paint.net crashed. Please e-mail this to <email removed> so we can diagnose and fix the problem. Application version: paint.net 4.3.12 (Stable 4.312.8267.29064) Time of crash: 9/19/2022 12:26:16 AM Application uptime: 00:01:12.5027804 Application state: Running Working set: 805,796 KiB Handles and threads: 1637 handles, 149 threads, 199 gdi, 276 user Install type: Classic Application directory: C:\Program Files\paint.net Current directory: C:\Program Files\paint.net Install directory: C:\Program Files\paint.net OS Version: Windows 11 Pro for Workstations 10.0.22000.0 x64 .NET version: .NET 6.0.8 x64 Processor: "AMD Ryzen Threadripper 3990X 64-Core Processor" @ ~2918MHz (32C/64T, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2) Physical memory: 262005 MB Video card: NVIDIA GeForce RTX 3090 (v:10DE, d:2204, r:161), Microsoft Basic Render Driver (v:1414, d:8C, r:0) Hardware acceleration: True (default: True) Remote session: no Pointers: none UI animations: True UI DPI: 192 dpi (2.00x scale) UI theme: VisualStyleCategory=Aero, EffectiveTheme=Aero, DWM=yes, AeroColorScheme=Dark, ThemeFileName=Aero.msstyles Updates: True, 9/19/2022 (journal: ShouldCheckForUpdate, CheckedForUpdate) Locale: pdnr.c: en-US, hklm: en-US, hkcu: en-US, cc: en-US, cuic: en-US Flags: Exception details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'defaultValue < minValue') at PaintDotNet.PropertySystem.ScalarProperty`1..ctor(Object name, T defaultValue, T minValue, T maxValue, Boolean readOnly, ValueValidationFailureResult vvfResult) in D:\src\pdn\src_4_3_x\Base\PropertySystem\ScalarProperty`1.cs:line 128 at PreviewEffectEffect.PreviewEffectEffectPlugin.OnCreatePropertyCollection() at PaintDotNet.Effects.PropertyBasedEffect.PaintDotNet.Effects.IPropertyBasedEffectHost.OnCreatePropertyCollection() in D:\src\pdn\src_4_3_x\Effects\PropertyBasedEffect.cs:line 40 at PaintDotNet.Effects.PropertyBasedEffect.CreatePropertyCollection() in D:\src\pdn\src_4_3_x\Effects\PropertyBasedEffect.cs:line 35 at PaintDotNet.Effects.PropertyBasedEffectHandler`1.RelayCreateConfigDialog() in D:\src\pdn\src_4_3_x\Effects\PropertyBasedEffectHandler.cs:line 33 at PaintDotNet.Effects.PropertyBasedEffect.CreateConfigDialog() in D:\src\pdn\src_4_3_x\Effects\PropertyBasedEffect.cs:line 48 at PaintDotNet.Effects.CodeLabConfigDialog.RunEffectWithDialog() at PaintDotNet.Effects.CodeLabConfigDialog.RunCommand() at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam) Once again, I will remind you that this only happens when I choose Preview Effect in Codelab. The plugin seems to be working otherwise though (I base my assumption on the fact that it seems to generate Debug output just fine). And this crash is reproducible (this the third time I got PDN to crash doing the same thing). pdncrash.3.log
  2. I do not know if this is the best subforum to post this question to, but here it goes: So, I've added the ability to modify brightness and contrast to my plug-in (which I will be releasing soon), only, I do not understand the contrast adjustment code. I've googled around, and despite reading several tutorials, I still do not grasp it. I've checked the official Paint.Net book, and while it briefly discusses contrast, it doesn't go into details or provide a formula. The code I am using is from this Stackoverflow answer: https://stackoverflow.com/questions/3115076/adjust-the-contrast-of-an-image-in-c-sharp-efficiently What is going on here? Why is 100f being added to the contrast Value, and why is it then being divided by 100f? Why is this Value then being multiplied by itself? Value = (100.0f + Value) / 100.0f; Value *= Value; And what is the significance of the 0.5f in the code below? What variable is 0.5f filling in for? Red = (((Red - 0.5f) * Value) + 0.5f) * 255.0f; Green = (((Green - 0.5f) * Value) + 0.5f) * 255.0f; Blue = (((Blue - 0.5f) * Value) + 0.5f) * 255.0f; Could someone explain it to me like I'm 5? I apologize if this question seems stupid, but I am trying to understand. Thank you
  3. Shouldn't it be something like?: r = ClampRGBChannel((color.R - (ColorWheelControl_BlendColor.R * opacity))/(1.00 - opacity)); g = ClampRGBChannel((color.G - (ColorWheelControl_BlendColor.G * opacity))/(1.00 - opacity)); b = ClampRGBChannel((color.B - (ColorWheelControl_BlendColor.B * opacity))/(1.00 - opacity));
  4. I'm working on a plugin to reverse the effects of merging two layers (one being an image, the bottom layer, and the other, the upper layer, being a solid color of some kind). Normal blending uses an equation like this: CompositeColor = UpperLayerColor * UpperLayerAlpha + LowerLayerColor * (255 - UpperLayerAlpha) -------------------------------------------------------------------------------------- 255 I've attempted to refactor it, and got this: LowerLayerColor = 255 * CompositeColor - (UpperLayerColor * UpperLayerAlpha) ---------------------------------------------------------------- (255 - UpperLayerAlpha) Does that look correct to you? On the handful of images I've tried this reverse opacity plugin on, the colors seemed too white.
  5. Ah, when I say selection there, I mean the selection inside the selection. See, I change the Alpha value of the pixels I wish to modify to 100, via another plugin prior to running it through this one. My plugin detects those pixels, provided they are found within the selected area (this selection here being the normal Paint.Net one), gathers them up in a list...and I modify them according to the various settings. Hence the need to shade my selection blue, so I can see which pixels are selected during the preview. Final Render disables that shading. Or you can just skip modifying those pixels' Alpha values, and have the plugin apply its changes through the regular Paint.Net selection. It's a hack, because we can't add to / modify the selection tools that Paint.Net comes with. 🙂
  6. Oh. Well, suppose you had an image of your grandparents, but someone botched the image by attempting to make things look older by blending a transparent white layer on top of the original image (a fade effect); or if you had an image of a beautiful afternoon sunset, but someone applied a transparent black layer on top of the original image (to make it seem darker). My plugin, if you dial in the proper settings, and play with the Opacity Calculation (until it looks right per your tastes), will attempt to calculate the original colors, and render them. But it's never that simple. There are artifacts from scanning images that are introduced by the scanning process itself...etc. Hence the extra settings.
  7. Well...what exactly do you think can't be wired up? I've got a lot of it working in hard-coded bits and pieces...and the rest, I like to think is doable. But I am new to this. So, if you can tell me what I shouldn't waste my time on, I'll greatly consider it. 😉
  8. Just a preview of the interface for the plugin I am working on. Is there anything else I should add in before (re-)wiring it up? Image 1
  9. Is there a way to determine whether a plugin is being previewed, or rendering the final output to the Paint.Net canvas? I found this post: And I am wondering if it still applies.
  10. Indeed. There are some things which trouble me about HSV: Colors approaching white all feature low saturation. But what is the equation that is used to desaturate a color when approaching white? To reverse this, I would need to add saturation to a color. And how should hue be calculated, if it's based off of a 360 degree circle? If I have a hue at 0 and 180 degrees, which halfway point (90 degrees or 270 degrees) is correct? Should I use RGB blending for hints here?
  11. Sorry to bother you again, but I was wondering if you could point me in the direction of some resources for / fill me in on HSV blending. Paint.Net seems to support HsvColors, albeit as a second class citizen, and I've found that reversing opacity through HSV (as an option) gives interesting, possibly better results, if the original image had been made in an application whose primary color space was HSV. Additionally, should I support CMYK reverse opacity as well?
  12. @toe_head2001: Let me try a few more things, and if I can't resolve it, I'll send you a link to the code. I'll warn you in advance that this is not an example of my best code writing, just trying to get it functional. :-)
  13. Curiously, it's empty (and remains so, no matter how many times I crash my plugin). Is there another way to extract the crash data?
  14. Would anyone happen to know the location of the crash / error logs for Codelab / plugins you are testing? My plugin, when certain options are selected, takes Codelab / Paint.Net down like a champ...and I'd like to fix that.
  15. I am working on a Reverse Opacity plugin. I've bought the book on Paint.Net (still reading it), and I am posting just to verify -> Paint.Net does all of its blending in RGB mode, right?
  16. Greetings, How can I increase or decrease the RGB or HSV values of a group of pixels in a selected area by the same amount? For instance, I need to increase one region's brightness by 17 on the HSV scale to make it match another region; however, neither the Brightness / Contrast tool, nor the Hue / Saturation tool seem to increase or decrease these values by any calculation that I can thus far figure out (I apologize in advance if the answer is simple; I've been at this for over 16 hours). Much of my work has thus been trial and error to find the right amount to increase or decrease these values using the provided tools. Is there a formula or plugin I can use? Thank You.
×
×
  • Create New...