Jump to content
How to Install Plugins ×

TR's Distort This! - Plugin V2.7.5 (Mar 6th, 2016)


TechnoRobbo

Recommended Posts

I opened it for the first time on the latest version of paint.net, opened an image with skewed tiles, and dragged the borders to one of the tiles. I clicked "set working area". The handles reset to full. I tried grabbing the left-top handle and dragging it. While I was dragging it, all four handles seemed to have moved to the top right of the image (with some distance between each other; not all in a bunch). It crashed shortly thereafter with this error.
--------------------------------------------------------------------------------------------------------------------

File: C:\Program Files\PaintDotNet\Effects\DistortThis.dll
      Name: TRsDistortThis.EffectPlugin
      Version: 2.7.4.31014
      Author: TechnoRobbo
      Copyright: Copyright 2013 © TechnoRobbo
      Website: http://www.technorobbo.com/
      Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: must be positive
Parameter name: height:Int32=-3
   --- End of inner exception stack trace ---
   at PaintDotNet.Diagnostics.ValidationExtensions.ThrowValidationException(Validation validation) in D:\src\pdn\src\Base\Diagnostics\ValidationExtensions.cs:line 955
   at PaintDotNet.Surface..ctor(Int32 width, Int32 height, SurfaceCreationFlags surfaceCreationFlags) in D:\src\pdn\src\Core\Surface.cs:line 221
   at TRsDistortThis.EffectPlugin.myRender(Surface dst, Surface src, Rectangle rect)
   at TRsDistortThis.EffectPlugin.Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, Int32 startIndex, Int32 length)
   at PaintDotNet.Effects.BackgroundEffectRenderer.RenderWithClipMask(Effect effect, EffectConfigToken token, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, IRenderer`1 clipMaskRenderer) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 169
   at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderTile(EffectConfigToken token, Int32 tileIndex) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 149
   at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderNextTile(EffectConfigToken token) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 141
   at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 238
   --- End of inner exception stack trace ---
   at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 418
   at PaintDotNet.Effects.BackgroundEffectRenderer.Abort() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 374
   at PaintDotNet.Effects.BackgroundEffectRenderer.Start() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 320
   at PaintDotNet.Menus.EffectMenuBase.<>c__DisplayClass42_3.<RunEffectImpl>b__2() in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 953
 

Link to comment
Share on other sites

Unfortunately @TechnoRobbo no longer frequents this forum. I doubt there will be a fix for this.

Link to comment
Share on other sites

2 hours ago, AnthonyScoffler said:

I opened it for the first time on the latest version of paint.net, opened an image with skewed tiles, and dragged the borders to one of the tiles. I clicked "set working area". The handles reset to full. I tried grabbing the left-top handle and dragging it. While I was dragging it, all four handles seemed to have moved to the top right of the image (with some distance between each other; not all in a bunch). It crashed shortly thereafter with this error.

Thanks for the repo steps. I was able to get it to crash.

 

TL;DR: Here's the bug-fix release: :RightArrowBlue:  DistortThis.zip (v2.7.5)

 

Here's what was happening. If you released the button on your mouse too soon, the 'Work Area' would have a Width and Height of 0, and in turn, the effect would try to create a Surface with a size of 0. Crash!

I've added a check to ensure the 'Work Area' has a proper size. If it does not, the plugin will allow you to try again.

Code Change: https://github.com/toehead2001/pdn-tr-distort-this/commit/d4371e9fd04c9da780ff47891c0f9584dd1aa2ee

 

 

Hopefully TR will return to the forum in the near future.

  • Upvote 3

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

  • 3 weeks later...

Thank you very much of the plugin. 

 

Thus I find that idea of separate control window and the implementation of plugin functionality little difficult to use. 

For to use it properly, you need to add new layer every time when you want to insert picture object which perspective you want to edit. Of course layers are good to use sometimes too. 

 

It works on small, fixed size dialog window (separate control surface), where picture object which perspective you want to change shows smaller than its real size and you can't zoom the view, so it is more difficult and takes more time to do the perspective editing, especially if user wants to change perspectives of several picture objects. 

 

By default the control surface dialog windows has the whole picture as work area. And then because the surface control dialog is of smaller zoomed view, it is harder to select smaller work are with it. 

Would be very useful if control surface dialog could show by default or with setting the selection area of base picture directly as the work area. 

 

Is it hard coding work to add control area view zooming functionality? at least real size and double zooming, in addition to that present show whole picture canvas view. 

 

Tr's Distort this! effect seems to use quite much computer processor power, so seems that it is not so effective coded. Or the processing of pixels is so computing demanding, aguess. 

 

Generally the lack of wysiwyg usability with some of paint.net plugins is that things are done in separate dialog windows, so not in the base picture or on the layers, which would be better usability. 

 

Would be much better usability to have either tool in paint.net or plugin that could do perspective editing right this way: 

- select of paste picture object in base picture

- select perspective tool, which adds dragging handles to each 4 corner of selected picture object

- then you could use paint.net zooming too for smaller objects for to ease the accuracy of perspective editing

- just drag each corner of the picture object for to edit the perspective that you want

See attached picture. 

 

I thinks that proper perspective editing is quite basic feature of image editing, so would be great to have such basic feature (or proper plugin for that) in pain't net too. 

 

Of course more sophisticated feature in perspective editing would be ability to divide object into several division lines and to add handles, for to edit perspective even better (for examples in camera pictures of paintings or similar objects, where object in picture is not straight). 

PaintNet-perspective-tool-when.jpg

DistortThis.png

Edited by minaite
text addition
Link to comment
Share on other sites

Hi @minaite, what you're asking for (interacting directly with the canvas) is not possible to do in a paint.net plugin.

 

Perhaps one day Rick will add the ability for plugins to add custom Tools. For now, plugins are limited to custom Effects, and in turn, limited to what Effects can do.

 

As for this plugin, its usability and performance could definitely be improved. TR made the source code available, so such improvements could be made.

 

And finally, please stop posting duplicate stuff in different parts of the forum.

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

11 minutes ago, toe_head2001 said:

Hi @minaite, what you're asking for (interacting directly with the canvas) is not possible to do in a paint.net plugin.

 

Perhaps one day Rick will add the add the ability for plugins to add custom Tools. For now, plugins are limited to custom Effects, and in turn, limited to what Effects can do.

 

As for this plugin, its usability and performance could definitely be improved. TR made the source code available, so such improvements could be made.

 

And finally, please stop posting duplicate stuff in different parts of the forum.

 

Thanx of comments. 

 

I'm not coding paint.net, I try to use it. Of what you told, would be great to bring Paint.NET into this millenium to act more wysiwyg way and not so much like between separate rooms (canvas vs plugin control areas & settings). Let's hope that Rick Brewster realises that soon. 

As far as I have understood, paint.net is ment to be easy to use, with good usability, but idea of splitting canvas and control dialogs separately don't implement idea of easiness and good usability. 

 

Sorry if I break the rules in forum to suggest improvements. 

I posted comments here for that plugin. And suggestions for that better wysiwyg implementation to main discussion area so that Rick and others might notice too that something should be done for to keep paint.net in this millenium and to improve usability in it.  Isn't paint.net ment to be good tool, with good usability and essential tools, and not just a hobby? Good usability comes with good planning, good usability design and good coding implementation - many open source projects lack of good planning and design and I hope that such won't spread too much in Windows application world too (if coding community of an app is spread too much without coherent design and usability team work). 

Link to comment
Share on other sites

@minaite Embedded plugins and other things are nice, but just because plugins manage their own windows doesn't mean PDN is an outdated piece of hobby software. In my opinion, it's hardly worth a complaint at all. Since only Rick can work on Paint.NET, I'd assume that he must be the intended audience of your usability speech.

 

I would like to point out that Rick has been making steady updates that frequently include patching obscure errors related to usability and, if you didn't notice, Paint.NET is packed with features completely centered around usability. The recent update to pan the image past its bounds when zoomed in is such an example. He has acknowledged some time ago that the current plugin implementation isn't the best, so he's definitely aware.

 

You mentioned teamwork and so forth -- Rick is the only person working on his project, for which he doesn't get paid, just to benefit his users. It's fair to suggest changes, but not to bash Paint.net or draw its professionalism / credibility into question on a simple design choice.

Edited by AnthonyScoffler
  • Upvote 2
Link to comment
Share on other sites

On 4/17/2017 at 1:43 AM, minaite said:

Tr's Distort this! effect seems to use quite much computer processor power, so seems that it is not so effective coded.

Indeed. I looked at this a few minutes ago. By changing just a few lines of code, I was able to speed it up significantly.

When I tried it on a large (26.5 Megapixels) image, rendering went from 14 seconds to just 2.6 seconds. B)

Smaller images will of course be even faster.

 

For those interested in the technical details, TR was copying a Surface on every single ROIS.

https://github.com/toehead2001/pdn-tr-distort-this/commit/8928a2cac03eb41685e2619ed58b5466bd24289d

 

I'm going to see what other sorts of improvements I can make. Any requests?

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

8 hours ago, toe_head2001 said:

I'm going to see what other sorts of improvements I can make. Any requests?

 

I have a request: true perspective. As I recall, the current version does some sort of bilinear approximation.

Link to comment
Share on other sites

I worked on this again tonight.

With further optimizations, I was able to get that large image to render in under 2 seconds.

 

I also fixed a bug that had caused the thumbnail area of UI to be slightly squished vertically.

 

On 4/21/2017 at 0:32 PM, MJW said:

I have a request: true perspective. As I recall, the current version does some sort of bilinear approximation.

Weren't you working on a separate plugin to do this?

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

10 hours ago, toe_head2001 said:

Weren't you working on a separate plugin to do this?

 

A similar plugin, yes. But if Distort This is to be maintained, I think it would be better if it did the transformation correctly. It's not as if the intent of the plugin is to perform some other type of transformation. It's explicitly presented as a perspective transformation. On the other hand, perhaps it's going too far to modify someone else's plugin beyond what are essentially bug fixes.

Link to comment
Share on other sites

  • 5 months later...

@toe_head2001 which one is the one that you made faster? I currently have 2.7.4

btw sorry if this question has been answered a million times, but why doesnt the main dev allow others to work on the source code?

Link to comment
Share on other sites

4 hours ago, AnasMalas said:

btw sorry if this question has been answered a million times, but why doesnt the main dev allow others to work on the source code?

 

The code is huge and very complex. I'm not sure anyone but Rick (paint.net developer) would understand it.

 

A long way back the code was open source. This led to blatant rip-offs being published. Rick (quite rightly) decided to protect his hard work and stopped making the source available.

 

 

Link to comment
Share on other sites

That makes lots of sense. I wonder if he can try to atleast allow people to add tools instead of plugins, but knowing code and barely being able to even get a button to act nice with an auto pump code.... i dont blame him at all... code can sometimes be extremely cryptic...

Link to comment
Share on other sites

Tools no. Plugins yes. Many very clever plugin authors have created fine tools using the plugin system (pyrochild's Liquify is a wonderful example).

 

Plugins have limits to what they can do, like they get only one layer/selection to play with. Again, there are workarounds for this (using the clipboard can add another surface for example).

 

Rick does add bits and pieces from other authors. The DDS Plus plugin is one such example where Rick has indicated a desire to update the built in DDS filetype with the plugin.

Link to comment
Share on other sites

On 10/8/2017 at 5:09 PM, Ego Eram Reputo said:

 

The code is huge and very complex. I'm not sure anyone but Rick (paint.net developer) would understand it.

 

A long way back the code was open source. This led to blatant rip-offs being published. Rick (quite rightly) decided to protect his hard work and stopped making the source available.

 

 

 

That why Paint.NET stop being open sourced. Why have I not seen a case like this other than Paint.NET? Are those ripoffs a fork of Paint.NET? I can't see anything wrong with people forking open source codes provided they attempt to establish their own program. Now, forking it and claiming it's the main Paint.NET is wrong though. It's like calling GIMP-Painter the main GIMP or Ponyscape the main Inkscape.

G'MIC Filter Developer

Link to comment
Share on other sites

30 minutes ago, Reptillian said:

That why Paint.NET stop being open sourced. Why have I not seen a case like this other than Paint.NET? Are those ripoffs a fork of Paint.NET? I can't see anything wrong with people forking open source codes provided they attempt to establish their own program. Now, forking it and claiming it's the main Paint.NET is wrong though. It's like calling GIMP-Painter the main GIMP or Ponyscape the main Inkscape.

 

Paint.NET was not a community developed project it is Rick's project that he made source code available for.

On 11/9/2006 at 5:54 PM, Rick Brewster said:

Well, yeah it is an "open source" project. It is just not a community developed project, and the release structure is more like classic shrink-wrap software. "Open source" is kind of a nebulous term.

Unfortunately as @Ego Eram Reputo mentioned certain individuals would publish rip-offs ('backspaceware'), see the following posts on the Paint.NET blog.

 

https://blog.getpaint.net/2007/12/04/freeware-authors-beware-of-“backspaceware”/

https://blog.getpaint.net/2009/11/06/a-new-license-for-paintnet-v35/

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

  • toe_head2001 locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...