tannerhelland / PhotoDemon

A free portable photo editor focused on pro-grade features, high performance, and maximum usability.
https://photodemon.org
Other
1.3k stars 192 forks source link

[Feature request] - Better Snap Points and Geometric analysis possible? #498

Open 0lm opened 8 months ago

0lm commented 8 months ago

Is this feature request related to a problem?

Half half I would say. The feature would make alot of work very convenient

Describe the best way to implement this.

Currently, Photo Demon's snap point system feels non-existend. Most of time, when I move objects, or want to add different images to a pre-created canvas size, I need to zoom in alot, to be even able to pull an image to the very corner of the canvas, without accidently pulling it too far away, so part of the image is out of the canvas

Is it possible to add a (better?) snap point system, where especially when you reach the canvas borders, it will hard snap immediately, needing you to pull again to overcome that hard snap? (similar to photoshop). And talking about snap points, is it possible to also add these geometric lines, which show you where the mid of the image is, or how far you are away from a certain object etc, while moving an object? So, I can, for example, snap added text boxes, or added images, in the mid of the canvas, or for example, two images, both same distance away from left and right canvas borders? Or two added images/text boxes on the same height level, or when resizing text boxes, to see, when it has the same size, by seeing these lines etc.

Im not sure how to describe it, but I hope you know how photoshop's snap system works. Then you will understand, I think. Im not sure if this is too much ask,, though. Not sure how hard/easy it is to implement a better/customizeable snap system.

EDIT: Just looked up some terms. I am referring to things like "snap to pixel", "snap to grid", or stuff like snapping to other objects on the canvas. But not sure how these distance measurment lines are called, though, when you move an object.

Thank you!

If this feature makes it into PhotoDemon, I am happy to add your name to PhotoDemon's contributor list. Please let me know what name (and optional website link) you'd like me to use.

tannerhelland commented 8 months ago

Great suggestion, @0lm. Thank you. I have added this to my short-term to-do list.

0lm commented 3 months ago

Gimp could give hints and ideas on how to approach this feature (in case there is hopefully still interest to add this feature) - because with upcoming Gimp 3.0 in the near future (already implemented in the pre-release preview versions, I think), they added a better snap point system with geometrical relations to other objects. And since Gimp is opensource, this could be a good starter point. Personally, I unfortunately have no idea how to code this. But I assume it is maybe a bit harder than it sounds like, based on how long Gimp needed to introduce this feature.

EDIT: Here a link to the feature description in Gimp: https://www.gimp.org/news/2024/02/21/gimp-2-99-18-released/#new-snapping-options

tannerhelland commented 3 months ago

Thank you for the follow-up, @0lm ! I'm sorry progress on this issue has been slow.

I am working on snapping in a separate branch and snapping is now available when moving layers. I haven't solved snapping for selections yet, and snapping for layer resizing also remains to be solved. But progress is (slowly) being made.

I hope it won't be too much longer before snap features are merged to the main branch. Thank you for continuing to track this issue.

tannerhelland commented 2 months ago

Snapping support is now available in nightly builds. Thank you for your patience!

I will leave this issue open for a few days while I continue testing the feature. I also have a few more small snap-related enhancements I would like to add.

Thank you again for suggesting this feature. I hope it helps!

0lm commented 2 months ago

Snapping support is now available in nightly builds. Thank you for your patience!

I will leave this issue open for a few days while I continue testing the feature. I also have a few more small snap-related enhancements I would like to add.

Thank you again for suggesting this feature. I hope it helps!

Just tested it, this is awesome. It makes so many things easier! And I read in #554 that you are also going to add a visualization feature (I assume it is those lines which show where the snap relates to when moving an object around?). Thank you for your efforts!

tannerhelland commented 2 months ago

Yes, exactly right! As I type this, I am committing a "smart guides" feature and uploading a new nightly build. (This is also in the View menu, and when enabled it will draw a highlight along the edge(s) being snapped. It is enabled by default.)

I'm really happy with how this feature turned out, and hopefully future feature suggestions won't take me quite so long to implement 😅 Thank you for testing the snapping!

0lm commented 2 months ago

The new Snap Smart Guide is working very well, too! Just a question out of curiosity: Is it possible to expand the Snap Feature and the Smart Guide Feature, so, multiple distances between multiple objects can be shown and snapped? Like.. if I want 10 different objects to have exact the same distance from each other. Or 4 objects, one at top, bottom, left and right, all 4 having same distance from the main image edges. Basically, relative distances to each other, when it is about multiple objects - to place objects kind of symmetrically. Thank you for your efforts and no need to be sorry, you are doing this voluntarily and for free, your Life definitely has priority.

tannerhelland commented 2 months ago

Thank you for the kind words, @0lm . They are appreciated.

I am still trying to wrap my head around the "equidistant" snap feature in GIMP and Photoshop. I haven't fully figured out how to add a similar feature in PhotoDemon.

Similarly, it's hard to know how to show distance to a specific object. How would the user select which object they want to show distance to? I could have a dropdown where the user selects a "distance from" target, but that only works for a single object at a time... IDK, there are some trade-offs I'm still trying to figure out.

What I'd like to work on next is a feature to simply display distances to the edges of the main canvas when you're moving layers, like this:

image

I think this would be a helpful first step until I figure out how other software makes their "equidistant" snapping behavior work.

0lm commented 2 months ago

You suggestion is actually a really good alternative! Being able to see distance numbers definitely will be helpful, in case "equidistant" feature is too complicated to implement.