Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drawing a simple rectangle layer?
#1
I'm learning the basics of using GIMP. I'm making a simple "color palette" for a design project.

I want to draw several rectangles, each as their own layer, and have that entire layer be the size of the rectangle. 

When I click "New Layer" and draw the selection, I can color the selection, but the layer still has the size of the background layer (instead of the small rectangle, like I want).

I can manually resize the layer, but I'd assume there's a better way size the entire layer to the rectangle I want.

How do you do this?
Reply
#2
2 ways:
1) when you create a new layer, you can specify its width and height in the dialog window
or
2) if you have an layer too big for your needs, create a selection and do menu Layer > Crop to Selection
Reply
#3
Other way:

Select the layer that has the desired dimensions and duplicate it.
You can duplicate it as many times as needed.
Then edit the new layers with the desired colors.

Another way using the ofn-layer-tiles.py plugin.

1- Create a new image (400x400 in this example);
2- Image - Guides - Grid
2.1 - Set the width of the small rectangles (100x100 in this example), Mode: Spacing of Guides (px), check Border guides;
3- Layer - Tiles - Split tiles (by width and height)...;
4- Provide the values for the width and height of the rectangles (100x100 in this example);

This will result in 16 layers of 100x100 (in the same image), each small rectangle can be edited separately.
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#4
(04-09-2022, 09:42 PM)tmanni Wrote: 2 ways:
1) when you create a new layer, you can specify its width and height in the dialog window
or
2) if you have an layer too big for your needs, create a selection and do menu Layer > Crop to Selection

just adding 1 more way
Very similar and as simple as tmanni's answer
Once you've filled your selection and have by accident de-selected(no active selection) Main menu do Layer ➤ Crop to content will do the trick as well
Reply
#5
When I suggested the steps in my previous post (#3) I was initially thinking about using Image - Slice Using Guides. But this generated new images for each created tiles, and I wanted everything in one image.

So I ended up inserting the first 2 (unnecessary) steps in the steps I suggested.

Basically the ofn-layer-tiles.py plugin does all the work itself.

➤ Just Layer - Tiles - Split tiles (by width and height)...; et voilà!

Tiles 25x25  (Image 100x100)
   
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#6
(04-10-2022, 12:17 PM)Krikor Wrote: I was initially thinking about using Image - Slice Using Guides. But this generated new images for each created tiles, and I wanted everything in one image.

See ofn-guillotine-layer Smile
Reply
#7
(04-10-2022, 05:02 PM)Ofnuts Wrote:
(04-10-2022, 12:17 PM)Krikor Wrote: I was initially thinking about using Image - Slice Using Guides. But this generated new images for each created tiles, and I wanted everything in one image.

See ofn-guillotine-layer Smile

Ofnuts,

I almost 'lost my mind' in amazement with the practicality and simplicity of this plugin! ("perdu la tête")

I needed this plugin countless times and didn't know it existed!

If I had read Carmen's entire e-book - A Guide to Ofnuts Tools - I would have downloaded it a long time ago!

The ofn-guillotine-layer Plugin is found in the Sundry ofn-Scripts section as:
Code:
"Follow some plugins getting (and needing) hardly any documentation."

I will definitely have to read this e-book from time to time.


Thanks for the tip of this plugin!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply


Forum Jump: