2

Basically I would like to make the layer boundary size content-aware so it will always fit and never limit content to spread.

Example A (Default GIMP Behavior): Here the layer "Layer" has the same boundary size as the canvas no matter if is just one pixel of non-transparent content or the full layer.

enter image description here

Example B: Here the layer "Layer" has the boundary size of its drawn (non-transparent) content. And If I just kept using the brush towards any direction the layer (and consequently the canvas would scale), in red was the layer boundary when I first draw something, and in blue (and the right and bottom red box) would be after a second draw has been made.

enter image description here

This was brought to my attention when I unsuccessfully tried to move a content to snap to a guide rule, however it only snapped to the layer boundary and not to the content.

3
  • 1
    Hi. Welcome to GDSE. Not sure I've understood your question fully, but perhaps you are looking for Layer > Crop to Content? GIMP won't set the layer boundary to the content unless you tell it to.
    – Billy Kerr
    Dec 3 '21 at 16:32
  • So @BillyKerr that is almost what I want, it does set the layer boundary to the content, however I cannot expand the content further away from the new boundary, it will crop the layer and I'm unable to expand it. What I need is something like that Crop to Content that will dynamically change. Maybe I'm missing something or it isn't possible to do in GIMP, if so I'll try to do something about it using the source code, but I'm checking if right now it is possible.
    – João
    Dec 3 '21 at 20:36
  • I've added an answer now.
    – Billy Kerr
    Dec 3 '21 at 20:58
2

There's no way to have the layer size change dynamically as far as I'm aware (except for dynamic text boxes). In GIMP the layer size is independent from the content on the layer. The two are unrelated. Also snapping to guides or using the Alignment tool works using the layer boundaries, not the content.

Anyway, you can manipulate the layer size manually in a few steps.

  1. Do Layer > Layer to Image size

  2. Paint some extra pixels

  3. Do Layer > Crop to content

I suppose you could speed this up by setting up some shortcut keys for the commands in steps 1 and 3.

Example

enter image description here

You can also use a selection to change the size of the layer.

  1. Make a selection

  2. Layer > Crop to Selection, then Select > None Shift+Ctrl+A to release the selection

Example

enter image description here

1
  • Thanks for your clarification, I'll use these workarounds you suggested as it seems to be the way to go.
    – João
    Dec 4 '21 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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