I’ve spent around an hour trying to perform a very basic task that should’ve taken only 5 minutes, gave up later.
I was trying to crop an image to exact dimensions of a rectangle on a layer. The image was flattened, so it’s only a rectangle and some free space around it on a raster layer.
I can select the rasterized rectangle, edit it with the transform tool, even select the empty pixels around it with magic wand & invert the selection.
What I need to do is to later crop away everything except the rectangle, so the final image will be the exact dimensions of the raster rectangle I’m working with.
But currently that seems to be impossible, because:
Objects selected with Transform Tool don’t snap to canvas borders
Crop tool doesn’t snap to object borders
There is no way to see the dimensions of an object selected with Transform Tool
There is no way to see the dimensions of a rectangular selection
Therefore, there is no way to properly set the exact crop sizes & crop positions so everything is pixel-perfect
Cropping “manually” still requires to drag 4 edges of the crop tool area, which doesn’t snap to any objects
A good solution could be to add an option to “crop to selection”:
Get width, height & coordinates of the current selection
Crop to those parameters
ClipStudio has “crop to selection” feature. That could serve as a reference. Seems to be not that hard to implement, IMO. I just don’t have the necessary C++ programming skills to build & commit a pull request.
Tech context:
OS: Linux
Distribution: uBlue Bazzite 40 (based on Fedora Silverblue 40)
As a ‘workaround’, you can do Image → Trim to Selection but that will remove all resulting off-canvas content from all layers.
That consequence may or may not matter to you.
That’s not that big of a deal in this particular case, but could be an unwanted effect in other projects.
This is pretty convenient, but for some reason it doesn’t work for raster layer object I’m working with. Even though it is being properly detected by Transform Tool. Maybe it works only with vector shapes? Because I tried selecting the object both before and after activating Crop Tool to no effect & no difference.
Ok, I guess I was doing it the wrong way. This is was quite counter-intuitive for me.
What you have to do is this:
Activate “Contiguous Selection Tool” (magic wand icon in selection tools)
Select empty space (transparency or solid color) around the object
Invert selection with Ctrl+Shift+I, now your object is selected
Switch to “Crop Tool” (keyboard shortcut C)
Crop area should automatically fit the selection dimensions, now you can apply cropping
Somehow I accidentally triggered this once with “Transform Tool” selection as well, but could not reproduce later on. Maybe there is a way to make “Transform Tool” selection be converted in regular selection (the one marked with dash line), but I don’t know about it.
Would be great to have a tutorial & demo of this feature in “Crop Tool” manual documentation. Maybe with a gif. I can’t upload screenshot images nor screencast videos for now because of “new user” status.
You can recorder video of the crop tool and uploading the video file in a drive link or youtube and posted the link here too.
Thats one alternative option too.
If i am wrong you can still posted links even if you are new.