1

I'm using Gimp. I have a new layer with a cropped-to-content square image overlapping the original image and I would like to crop to selection. When I press Ctrl+A on the top layer and then choose Crop To Selection, it doesn't crop the whole canvass to square. I assume Ctrl+A does a select around the whole canvass instead of the square image only. I know I could use the tedious approach of manually doing a selection with the Rectangle Select Tool around the square part and making sure it is perfectly positioned around the square, but I was wondering if there is a way to make the selection go around the square automatically? My current workaround is to use the Fuzzy Select Tool with a Threshold of 255 to make sure everything in the square is selected. Is this the only proper approach?

enter image description here

3
  • Perhaps Image > Crop to Content is what you are looking for. No need to make a physical selection on the image. As long as you have the cropped layer selected in the layers panel, it should crop the entire image to the size of the selected layer.
    – Billy Kerr
    Commented Dec 12, 2022 at 13:41
  • @BillyKerr i tried that but it doesnt work, it will say nothing to crop. Commented Dec 12, 2022 at 14:05
  • Did you select the layer with the cropped content? It works for me. Just tested it. see screen recording
    – Billy Kerr
    Commented Dec 12, 2022 at 14:11

1 Answer 1

2

Yes, the selection is always apply to the whole image (there is then an intersection between the selection and the current layer)

If the square is fully opaque you can do Layer > Transparency > Alpha to selection and this will give you a selection that exactly matches the layer.

If it is not, duplicate the layer (this creates a layer with the same position and dimensions), then fill it (just drag a color from the FG/BG swashes), and then you are back to the previous technique (just erase the copy layter when done).


If this is for a crop, a totally different solution that doesn't use a selection in Gimp 2.10:

  • In the layers list, right click the top layer, and Composite Mode >> Clip to layer. This makes the whole image transparent outside the layer
  • In the image window, Image >> Crop to content crops the image to what is still visible
  • Restore the layer mode: right click the top layer, and Composite Mode >> Auto

Not the answer you're looking for? Browse other questions tagged or ask your own question.