Post Reply 

Cropping problem

Feb 2, 2011, 04:16
Post: #1
Cropping problem
I want to make a box with the top corners rounded and the part outside the box at the top two corners to be transparent.

I created a new image and then added a layer named bottom. I moved this layer to the bottom and named the first layer Top.

On the Rectangle Select tool I checked the rounded corners option. I selected the entire box and then cropped to the selection. I selected the top layer and filled it. The entire top layer turned gray (my fill color). The two corners that I thought I cropped did not get cropped.

I was planning to resize the image to get the square corners for the bottom of the box. I want to put a border on the box with the rounded corners but have no idea how I select just the borders and then Paint them. But until I figure out how to get the rounded top corners I see no need to continue.

What did I do wrong?

Bob
Find all posts by this user
Quote this message in a reply
Feb 3, 2011, 21:11
Post: #2
RE: Cropping problem
(Feb 2, 2011 04:16)bsprowl Wrote:  What did I do wrong?
Image or layer can only be rectangular shape


To make the box:

1. Create new image [in 'Advanced Options' choose Fill with: Transparency]
OR
Layer->New layer [Layer Fill Type: Transparency]
You can delete all other layers if you want

2. Select the box [Rectangle Select Tool with rounded corners option, remember the radius for future use]

3. Fill the selection with desired color [Bucket Fill Tool]

4. While selection is still on get rid off extra work space
Image->Crop to Selection
OR
Layer->Crop to Selection

5. Select->None

6. Select lower part of the layer and bucket fill lower corners of the box


To make the border (probably, can be done better):

1. I would try to make the same selection as in 2. above, then drag it smaller, adjust radius...
[You can save selection from 2. as a channel but if you try to Select->Shrink it
antialiasing won't be pretty]

2. Selection->Invert

3. Check 'Lock alpha channel' box for the layer in Layers Dialog and bucket fill or paint the border, uncheck the box

4. Work on the lower part of the box
Find all posts by this user
Quote this message in a reply
Feb 4, 2011, 20:08
Post: #3
RE: Cropping problem
I saw you asked the same question on GimpTalk forum and got good answers.
http://www.gimptalk.com/forum/beginners-...51562.html
I just want to add couple of things I've figured out while looking around on the topic.

First of all, my approach (above post) is legitimate, but it is definitely better to make complete selection first [rounded top + rectangular bottom holding Shift button] and then work with it.

Second, it turned out that Edit->Stroke selection... and Edit->Stroke path... give noticeably different results. Since you have defined dimensions, it is better to convert selection to path and stroke path.
   

Third, when you stroke an already filled path, background color shows through the anti-aliasing. It is so minor thing. But it is the only one where my approach shines Smile
   

Fourth, almost unrelated note I've found out.
It is possible to center selection inside a layer. Actually, the other way around, so you need some extra working space. It is done with the help of the Alignment tool. Click the layer, choose Relative to: Selection and press 'Align center of target' and 'Align middle of target'.

PS I am learning Smile

PPS I can't see my attachments when I Preview Post. I hope they'll show up later. Smile
Find all posts by this user
Quote this message in a reply
Feb 5, 2011, 10:40
Post: #4
RE: Cropping problem
(Feb 4, 2011 20:08)marina Wrote:  Second, it turned out that Edit->Stroke selection... and Edit->Stroke path... give noticeably different results.
This is normal, because your "stroke path" was restricted to the selection so yo only got the inner half. If you remove the selection before stroking the path you get something different (and better, because real antialiasing is used, not "transparency through selection antialiasing"). From left to right: stroke selection, stroke path with selection, stroke path after selection removal (all with a 6pix line):

[attachment=156]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Feb 7, 2011, 20:57
Post: #5
RE: Cropping problem
Thank you.

It looks like it is never a good idea to stroke a selection. Right?


Here is my final take...
I apologize for one big image.
   
Find all posts by this user
Quote this message in a reply
Feb 7, 2011, 21:41
Post: #6
RE: Cropping problem
Never say "never". But on the whole, yes, it's better to stroke a path.

Some interesting results (check the layers descriptions):

[attachment=167]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Feb 8, 2011, 04:05
Post: #7
RE: Cropping problem
First, raw data...
Selection No.1: 50x50, antialiasing, rounded corners radius 11.0, filled
Path: 48x48, -- same --, stroked with 2px line, cut to 50x50, filled

Since selection No.1 and selection that was converted to path have same corner radius but are different dimensions I would suggest that it makes visual difference.

   

Please, explain. What point you were trying to make?

Since 'stroke path' is better than 'stroke selection', it should mean that 'shrinking' selection and stroking corresponding path is better than just filling selection.
It doesn't make sense only for complex selections and for feathery ones.
Sounds tiring. Undecided

Unfortunately, it is not easy to do the right curve for small selections or for wide strokes(?). (Like in your case, final box doesn't have 11px radius. But probably no one needs it. Smile)

P.S. JUST LEARNED: Radius for rounded corners in options for Rectangle Select Tool is in px and only up to 100px.
To define radius as a percentage of the shorter side of the rectangle there is Select->Rounded Rectangle. (Good for larger rectangles, but performs strange for 100x100, for example.)
Find all posts by this user
Quote this message in a reply
Feb 8, 2011, 19:32
Post: #8
RE: Cropping problem
Second thought:
Am I right or not that...

while the selection is being constructed, for example with Ellipse Select Tool, information that it is an ellipse, in a vector sense, is still available to the GIMP. All antialiasing and feathering are calculated with this knowledge. It means that bucket fill this selection is the same as rasterizing solid vector ellipse.

In case of a border, GIMP works with already defined selection and there is only transparency information at this point.

It seems that drawing rounded box and filling it with color is good enough.


Interesting yesterday article:
http://www.smashingmagazine.com/2011/02/...ectangles/
section Rounded Rectangles (for Photoshop)
Find all posts by this user
Quote this message in a reply
Feb 8, 2011, 20:39
Post: #9
RE: Cropping problem
(Feb 8, 2011 04:05)marina Wrote:  First, raw data...
Selection No.1: 50x50, antialiasing, rounded corners radius 11.0, filled
Path: 48x48, -- same --, stroked with 2px line, cut to 50x50, filled

Since selection No.1 and selection that was converted to path have same corner radius but are different dimensions I would suggest that it makes visual difference.

Actually the selection has been shrunk 1x before being converted to a path that is stroked with a 2pix line, so selection and path should give the same results (and they indeed do so in the straight portions, if we forget the "smear").

(Feb 8, 2011 04:05)marina Wrote:  Please, explain. What point you were trying to make?

That sometimes the selection is better (no smear)

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Feb 8, 2011, 20:54
Post: #10
RE: Cropping problem
(Feb 8, 2011 19:32)marina Wrote:  Second thought:
Am I right or not that...

while the selection is being constructed, for example with Ellipse Select Tool, information that it is an ellipse, in a vector sense, is still available to the GIMP. All antialiasing and feathering are calculated with this knowledge. It means that bucket fill this selection is the same as rasterizing solid vector ellipse.
I have found "experimentally" that this is not the case. And a look at Gimp's source code confirms this: the ellipse selection is at once transformed into a mask.

(Feb 8, 2011 19:32)marina Wrote:  Interesting yesterday article:
http://www.smashingmagazine.com/2011/02/...ectangles/
section Rounded Rectangles (for Photoshop)

Fascinating. Thanks for sharing.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Feb 9, 2011, 20:31
Post: #11
RE: Cropping problem
(Feb 8, 2011 20:54)ofnuts Wrote:  I have found "experimentally" that this is not the case. And a look at Gimp's source code confirms this: the ellipse selection is at once transformed into a mask.
I meant that...
while you are checking and unchecking options for a Select Tool you have not yet technically finalized you selection, so GIMP knows numbers, not transparency info.
Right after you have finalized your selection, it is a mask.
The selection is not bad at this point. Exactly the same as if it was done from a path.
(for Rectangle and Ellipse selections)
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Cropping but selecting stuff to discard, not keep. seanspotatobuisness 1 225 Jul 14, 2017 18:46
Last Post: ythgilb
  problem with drop shadow Kharl 37 1,853 Oct 8, 2014 04:53
Last Post: Kharl
  image cropping to a pre-selected size geomcd49 1 310 Oct 1, 2014 04:42
Last Post: fluffybunny2
  Multiple Resizing, Oval Cropping and Watermarking ermns 9 435 Sep 30, 2014 02:18
Last Post: ermns
  trouble cropping active layer bugsinherteeth 5 392 Sep 4, 2014 20:37
Last Post: fluffybunny2

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS