Jump to content

Add selection - High CPU load


Recommended Posts

Hello,

When I select an area I have about 30% CPU load but if I add a new area (ctrl + left) Paint .net slows down and I got 100% CPU load. So for the first selection everything is fine but for the 2nd/3rd/nth Paint .net kills my processor :(. Is this an unique problem :roll: ? I had this problem in 2.62 as well.

Benchmark: Total time: 244056 milliseconds

CPU: AMD Thorton 2000+ @ 1250MHz

RAM: 512 MB

Attila

Link to comment
Share on other sites

It's just the algorithm we're using right now, it's very brute force and slow. A more efficient algorithm is very complicated (there's a reason Adobe gets the big bucks), and I'm hoping to implement it for our next release (v3.0). I already understand the new algorithm, it's just very tricky to implement correctly.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

No this new algorithm doesn't work with pixels, it works with the vertices of the polygon that you're drawing. Do a search for "Efficient Clipping of Arbitrary Polygons" and maybe you'll find it. It's actually an intuitive algorith, I was surprised, definitely easier than Vatti's algorithm, but like I said it's tricky to implement (but much less so than Vatti's).

Right now the performance of this operation in Paint.NET will be proportional to the number of pixels inside the bounding box of the selection (both the original plus what you are adding/removing). The new one will have performance proportional to the number of vertices in the selection's polygon.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...