Post Reply 

Cropping an image to one layer's boundaries

Jun 24, 2014, 04:51
Post: #1
Cropping an image to one layer's boundaries
Hello,

Suppose I have several layers of different sizes and I want to crop/trim the whole image to the size of the smallest one. So I pick one layer, Select > All (yellow/black border delimiting the layer turns to black/white "marching ants", grey/white borders surround the layer and the whole image), Image > Crop to Selection. Nothing happens. The layers and the image W×H as shown in the title bar stay the same.

Now, a selection from any tool (rectangle, text > path > selection, etc.) works as I expect it to. How are these types of selections different? Once again I'm at my wits' end.

(GIMP 2.8.10)
Find all posts by this user
Quote this message in a reply
Jun 24, 2014, 05:13 (This post was last modified: Jun 24, 2014 05:28 by fluffybunny2.)
Post: #2
RE: Cropping an image to one layer's boundaries
(Jun 24, 2014 04:51)arielCo Wrote:  Hello,

Suppose I have several layers of different sizes and I want to crop/trim the whole image to the size of the smallest one. So I pick one layer, Select > All (yellow/black border delimiting the layer turns to black/white "marching ants", grey/white borders surround the layer and the whole image), Image > Crop to Selection. Nothing happens. The layers and the image W×H as shown in the title bar stay the same.
Use the Crop tool. In the tool's options, make sure 'Current Layer Only' is unchecked.
   
Find all posts by this user
Quote this message in a reply
Jun 24, 2014, 05:27
Post: #3
RE: Cropping an image to one layer's boundaries
(Jun 24, 2014 05:13)fluffybunny2 Wrote:  In the Crop tool's Tools Options, make sure 'Current Layer Only' is unchecked.

It is unchecked (how am I supposed to know to look there?).

Screenshot, after pressing Control-A with the top, smaller layer active:

[Image: gE2xdPd.png]
Find all posts by this user
Quote this message in a reply
Jun 24, 2014, 12:35 (This post was last modified: Jun 24, 2014 12:36 by arielCo.)
Post: #4
RE: Cropping an image to one layer's boundaries
Thanks for the idea, and your time.

So, the way I see it,
  • There's no way to use the layer boundary for this purpose,
    and more importantly
  • Even though I used a command called "Select All" and I'm seeing a marquee identical to a Selection, it doesn't behave entirely like one. That made me run in circles for a while.

Do you think it could be reasonably called a bug? I think the best solution would be that Gimp did treated the result of Select > All as a Selection.
Find all posts by this user
Quote this message in a reply
Jun 29, 2014, 06:40
Post: #5
RE: Cropping an image to one layer's boundaries
(Sorry for taking so long to follow up - I had trouble capturing the screen to GIF)

(Jun 24, 2014 13:51)ofnuts Wrote:  It's not a bug, it's how the selection works. The selection is not linked to a specific layer, it is linked to the canvas. The pixels that can be changed are the pixels in the current layer that are also in the selection; in other words, those that inside the moving dotted line of the selection(*).

Are you sure that only "the current layer" is affected? When I crop with a handmade selection (rectangle/lasso/etc), it affects all the layers:

[Image: Oiz4pdl.gif]

(Jun 24, 2014 13:51)ofnuts Wrote:  What you want is a different operation: Layer boundary to selection (or selection from layer boundary).

But we overlooked a very simple method:
- remove the selection Select>None
- make active the layer you want crop the image around
- shift-click on the eye icon of that layer in the Layers list: this will make all other layers invisible
- Image/Autocrop image
- Restore the visibility of other layers if needed.

(*) the part of the selection that is outside the active layer is shown with a fixed dotted line...

Now this method uses the current layer, regardless of which are visible:

[Image: ESTfcTZ.gif]
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Change Print screen Image Settings dddemauro26 1 30 Today 08:48
Last Post: paynekj
  Error Message " gimp-image-set-resolution " quand 2 226 Sep 8, 2018 19:35
Last Post: quand
Exclamation URGENT! How do I restore layers or a previously saved version of a saved xcf image? Txsweetcheeks1981 3 4,284 Aug 24, 2018 14:15
Last Post: paynekj
  How do I save a image into a press quality PDF? Komodo 1 86 Aug 23, 2018 15:02
Last Post: paynekj
  Copy/Paste part of an image RogerTheShrubber 1 84 Aug 20, 2018 20:09
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS