Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align back/foreground layers with each layer separately #11

Open
barrynerd opened this issue Aug 16, 2014 · 5 comments
Open

Align back/foreground layers with each layer separately #11

barrynerd opened this issue Aug 16, 2014 · 5 comments

Comments

@barrynerd
Copy link

I have a file with six layer groups. When I export layers, all works fine, I get six images as expected.

Since the layers all share a common design element as background, I thought to factor that out into its own layer, named "[mybackground]". This is not in a layer group.

For test purposes, the first five layer groups are left alone, and the sixth I removed the design element, leaving an ample layer of transparency. The background layer is a solid color covering the entire area.

All the layers are the same size.

When I select advanced option: use square bracket named layers as background, I did not get what I expected. For the first five, I expected the same image, and for the 6th layer group I expected the background layer to show through the transparency. The first five were correct, but the 6th did not include the background layer at all, and just the transparent area shows along with the other layers in the layer group.

I have tried this with [mybackground] layer both above the list of layer groups in GIMP, and below the entire list. The results were the same.

System: Fedora 20, Gimp 2.8, your plugin v 2.2. System is fully up to date.

Question: Am I doing something wrong, or is there a bug?

Otherwise, this is an awesome plugin, doing exactly what I need. Thanks for your work!

@barrynerd
Copy link
Author

More info:

After posting the above, I tried a different test.

The layer groups are all the same size, let's say 750x900 px. They are stacked vertically in an image that is ~6000x900px.

For this test, I changed [mybackground] layer to be the size of the full image, and filled it with a solid color. Then I exported the layer groups again.

This time the one with the transparency DID show the solid color.

So I guess I misunderstood the way the background option works: It shows the background at the same place in the full image where the layer group is located. Nothing wrong with this in principle, I am sure this case occurs a lot, such as changing background colors en masse as I did in this test.

But there is a different use case here too, which is what I had intended: when the layer groups are cropped to the layer size (in my case they are all the same size, imagine them as banner ads, e.g.) then I would suggest that the square bracket background layer (if also the same size) be applied directly with the layer group aligned as an overlay.

The benefit here is that that can truly have just one copy of a shared background when there are many variations of the somewhat similar images I am trying to create.

Is this possible?

Hope this all makes sense, happy to check back soon to see if there are any questions and to clarify as needed.

@khalim19
Copy link
Collaborator

If I understood correctly, you want the background layer(s) to be aligned with each layer. By aligning, do you mean centering the background layers around each layer?

In any case, the plug-in can't do that (as you found out, the background layers stay at the same place in the image), but it's no problem for me to make such an option. I don't know when I'll be able to do this, though, as I currently have little spare time on my hands. :(

@barrynerd
Copy link
Author

Thanks for the prompt response. Yes, I was thinking to align the background layer with each of the other layers. Since in my case, all the layers/layer groups are the same size, the alignment is not critical as they are all the same.

if the layers are not all the same size, then it becomes a little more complicated, requiring some options from the user in the dialog.

In rethinking my own workflow based on your response, I should be OK if I place all my layers and layer groups at the same location (upper left = 0,0), and hiding/unhiding as needed to edit the design. Originally I wanted to have them all visible at the same time, but I can get by that way for now.
I guess I will leave this as a feature request for now. I may take a look at the code myself at some point, but in the meantime, I need to plow ahead to create my templates.

@khalim19
Copy link
Collaborator

Not sure if I understand completely now, so I'll list all of the possible options I could think of. :P

If you want adjust the alignment of all background layers, I can think of the following alignment options:

  • Don't align (background layers stay at the same place in the image canvas),
  • Upper left, Upper center, Upper right, Left, Center, Right, Lower left, Lower center, Lower right,
  • Custom offset - for x and y separately - in pixels, percent, inches or centimeters.

If you want to adjust the alignment of each background layer separately, or, adjust the alignment of all background layers for each regular layer separately, then it gets more complicated. It probably wouldn't be a good idea to do this in the plug-in dialog. Instead, I would append the alignment information to each layer name (that would be removed from the layer name when exporting).

Edit: Rather than typing this information in the layer names, I think I thought of a much more satisfying way to individualize any settings for each layer directly in the dialog should the user wanted that. I added this as an enhancement.

@khalim19 khalim19 added this to the 3.2 milestone Apr 27, 2016
@khalim19 khalim19 changed the title question re: background layers and square brackets (possible bug?) Align back/foreground layers with each layer separately Apr 27, 2016
@khalim19 khalim19 modified the milestones: 3.1, 3.2 Jun 2, 2016
@khalim19 khalim19 modified the milestones: 3.2, 3.1 Jan 25, 2017
@khalim19 khalim19 removed this from the 3.2 milestone Mar 30, 2018
@khalim19 khalim19 added this to the 3.5 milestone Jan 18, 2019
@kamilburda kamilburda removed this from the 3.5 milestone Aug 6, 2023
@kamilburda
Copy link
Owner

Hi, I realize this is quite a bit late, but I believe aligning background layers against the current layer and vice versa should now be possible with the latest version of Export Layers and this script.

  1. Install the script for layer alignment
  2. Run Export Layers
  3. Tag selected layers as background (right-click in the preview on an image to add a Background tag)
  4. Add the Insert background layers procedure
  5. Add a custom procedure named python-fu-align-layer and adjust the parameters as needed, according to the procedure description. The example below centers the background layer against the currently processed layer, both horizontally and vertically.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants