Jump to content
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted

Hello community programmers :) ,

 

Many times I have an image that I want to multipy on a straight line. Usually I do it by pasting the image multiple times over an imaginary line but it is not perfect. Sometimes I use one of the tiling effects such as Repeat Paste from Clipboard or Fill from Clipboard and then I remove the images I do not need but the angles are very limited. If someone can make this effect it would be very nice.  I think this effect would enrich the plugins list.  

 

These are some of the Features it should have:

- A Size or Zoom feature to adjuste the size of the image

- A variable angle of the line formed by the images

- A spacing feature to adjust the spread of the images.

 

line-001-54d8fa2.png

- A feature to rotate the images

line-001-54d8f9c.png

Thank You.

 

 

  • Like 2
Posted

How about this??

 

It looks like it will do the path and spacing ?. Not the rotation or zoom ?

Posted

There is, I think, a non-trivial aspect to this. If the images are spaced closely enough, they could overlap. Perhaps spacing that close could be disallowed, but the are cases where the same image wouldn't overlap if rotated to other angles. Disallowing that spacing might be undesirable. Of course it could be handled, but it's more complicated that a normal tiling algorithm.

Posted

@MJW Overlapping may not be desired in some cases  but in other cases it can  create interesting results/patterns. I hope an algorithm can be figured out.

line-004-54d961e.png 

Posted
13 hours ago, MJW said:

There is, I think, a non-trivial aspect to this.

Nah, because it's out of scope for a tiling algorithm to fix this:

image.png.b048740994311cbd52dab82430efb766.png

Notice the spacing after rotation between the images. I've shown how an algorithm might attempt to solve this, but the problem is that there are two angles: the image rotation angle, and the angle of the line. The smart algorithm on the bottom right would only work if image rotation matches angle of the line. "After rotation, 0 degrees" is what it would look like if the line was flat, showcasing why it's an undesirable algorithm. So just leave it to the user.

 

Two options after drawing a line:

- User wants X images on the line, spaced evenly

- User wants to fit images on the line, which is this algorithm

 

It doesn't matter if it overlaps; leave that up to the user to decide on aesthetics. Just give them options to make it possible. Default to a clean fit.

 

Track previous image location and bounding box. In a for loop, apply scaling and rotation, storing new dimensions for each transformation. If the user ticks a checkbox to compute before rotation rather than after, use the scaled bounding box dimensions instead of scaled+rotated bounding box dimensions when computing offset to draw the new image. Include an arbitrary offset or percentage offset. Then update previous location and bounding box and go to next image.

 

Modifications to that algorithm for location stutter, rotation/scaling jitter or progression are simple enough.

  • Like 1
Posted (edited)

Looking between the plugins for Paint.net I noticed that TR left some code for one of his effects: TR's Paste Frame. It has nice features but it can not rotate the image. Though I do not understant anything, it could help somene creating an effect.

 

line-005tr-54db285.png

Edited by Eli
Posted

I hate to volunteer to do something, then not do it, but I'll try to write this plugin.  I've probably got most of the stuff needed in other plugins. (Please no reps before I actually release the thing! It will only make me feel more guilty if I don't get it done.)

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...