It is currently Wed Nov 25, 2026 3:09 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 19 posts ] 
Author Message
 Post subject: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 11:53 am  (#1) 
Offline
GimpChat Member

Joined: May 18, 2013
Posts: 27
GIMP Version: 2.8.4
Operating System: Windows
OS Version: XP - SP3
GIMP Experience: Beginner Level



I created a circular selection then go to Layer - Crop to Selection and expected a circular result - but the cropped area is rectangular ! Rather stupid, must say.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 12:09 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
Using the Crop tool give you a square or a rectangle. Using any selection tool use Edit | Clear.
A crop include transparent pixels.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 12:20 pm  (#3) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14283
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
Image

If you wish the image to look like the selection, you must be sure that there is an 'alpha channel' on the layer your working with. Make your selection, invert it and then clear the selection.
Once it's cleared you will have an image that looks like your selection.
If you then invert the selection again and do a 'crop to selection', it will crop the selection at the limits of your selection. Which is always rectangular/square in shape.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Last edited by Wallace on Fri May 24, 2013 12:45 pm, edited 3 times in total.

Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 12:26 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
The following script will remove everything (on the layer) that lies outside the selection. It does not, however, resize the layer.

http://chiselapp.com/user/saulgoode/rep ... sg-isolate

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 12:38 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Bonaca wrote:
.....the cropped area is rectangular ! Rather stupid, must say.


Crop command pertains to image size, which is always defined by Width and Height, and, naturally, is a rectangle.
Crop to selection translates into rectangle formed by the longest parts of the selection along x;y coordinates.


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 12:47 pm  (#6) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14283
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
K1TesseraEna wrote:
Bonaca wrote:
.....the cropped area is rectangular ! Rather stupid, must say.


Crop command pertains to image size, which is always defined by Width and Height, and, naturally, is a rectangle.
Crop to selection translates into rectangle formed by the longest parts of the selection along x;y coordinates.


Yes... what K1TesseraEna said. :hehe

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 12:48 pm  (#7) 
Offline
GimpChat Member

Joined: May 18, 2013
Posts: 27
So, why the author named this command "Crop to Selection" ?
My selection is circular and cropping should be - circular.
The command should be named: CropToRectangleWhateverIsYourSelection !


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 12:53 pm  (#8) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14283
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
Bonaca wrote:
So, why the author named this command "Crop to Selection" ?
My selection is circular and cropping should be - circular.
The command should be named: CropToRectangleWhateverIsYourSelection !


Well, I agree, but that is how it works in most if not all graphic programs when you want to crop an image.
I'm not 100% sure, but I don't think it's possible to elliptically crop an image.


BTW... I've never used the word 'elliptically' in my life before today. :hehe

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 1:10 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
I've never heard of circular images. Every image file opened in any program that i know of
is always rectangular. Even if your image contains only an elliptical object, the areas around it are always
being filled with transparency (if file format allows) or background color.


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 1:13 pm  (#10) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14283
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
K1TesseraEna wrote:
I've never heard of circular images. Every image file opened in any program that i know of
is always rectangular. Even if your image contains only an elliptical object, the areas around it are always
being filled with transparency (if file format allows) or background color.


Agreed... :bigthup

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 1:20 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
Bonaca wrote:
So, why the author named this command "Crop to Selection" ?
My selection is circular and cropping should be - circular.
The command should be named: CropToRectangleWhateverIsYourSelection !
7.53. Crop to Selection
I can understand how you might be confused by the wording until you understand how a crop works. A crop is to the x, y of your selection.

Image

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 1:25 pm  (#12) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14283
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
Odinbc wrote:
7.53. Crop to Selection
I can understand how you might be confused by the wording until you understand how a crop works. A crop is to the x, y of your selection


Maybe it could be called 'Boundary Crop to Selection'. ;)

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 2:23 pm  (#13) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
When referring to image cropping, it is always rectangular https://en.wikipedia.org/wiki/Cropping_(image) as an image frame is always square.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 2:41 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
RobA wrote:
When referring to image cropping, it is always rectangular https://en.wikipedia.org/wiki/Cropping_(image) as an image frame is always square.

-Rob A>


+1
Cropping does exactly what it means. I don't think this operations needs to be renamed.

Maybe asking the right questions will help to avoid frustration. Like, how do i copy a selection to another image?
Ctrl+C and Ctrl+V. No need to crop, etc.
If you need this selection to be a reusable template, just add alpha channel (if there is none), invert the selection and Delete.
Crop to selection and export as PNG, XCF, BMP, GIF or whatever format that supports transparency.


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 2:47 pm  (#15) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16309
I do not know of any program that "crops" to a shaped layer. :)
Which is basically what you are asking Gimp to do.

_________________
Image


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 3:29 pm  (#16) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14283
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
K1TesseraEna wrote:
RobA wrote:
When referring to image cropping, it is always rectangular https://en.wikipedia.org/wiki/Cropping_(image) as an image frame is always square.

-Rob A>


+1
Cropping does exactly what it means. I don't think this operations needs to be renamed.

Maybe asking the right questions will help to avoid frustration. Like, how do i copy a selection to another image?
Ctrl+C and Ctrl+V. No need to crop, etc.
If you need this selection to be a reusable template, just add alpha channel (if there is none), invert the selection and Delete.
Crop to selection and export as PNG, XCF, BMP, GIF or whatever format that supports transparency.


There' s only one way to crop an image. ;)

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 4:21 pm  (#17) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
The thing is, that there is a fundamental disconnect taking place here. All this new thinking in UI-design where everything must be designed as a metaphor to some real world object in order to make "difficult" computer concepts easily chewable to the layman shows it's disadvantages exactly in situations like this.

The same applies to GIMP and graphics software in general. We easily compare the image with a sheet of paper, or maybe a stack of papers where the layers are individual sheets (that can also be partially or wholly transparent). But whereas you can cut sheets of paper in whatever shape you want, a bitmap image just doesn't work that way. A bitmap image is always rectangular, and I'll explain why.

See, a bitmap image is merely a two-dimensional array of data (or 3-dimensional, if you consider the layers as an extra dimension, but let's keep it simple and forget layers for now). In a bitmap, visual information is represented as a collection of sample points (where each sample point contains the colour and transparency information of that location), arranged into a grid, ie. a 2-dimensional array. This is of course not the only possible way to arrange sample points, one could easily create eg. hexagonal bitmaps, or bitmaps made of squares and octagons, or triangles, or whatever you can tessellate. But rectangular grids make sense because that's just how our display technology works for now, so they are easy to map on to the screen.

So any bitmap image must necessarily be rectangular. We have bitmaps that allow transparency, so you can sort of emulate an image of any shape you want, but that's just an illusion created by a rectangular bitmap with parts of it left transparent. Therefore, for bitmaps, it doesn't really make sense to expect to be able to "cut" them in different shapes, like you can with paper.

Now, how this is relevant to the crop command is this: The crop command only works rectangularly, because that is the way bitmaps work in general. Since the image can only be rectangular, there would be no point in allowing layers to be any other shape either - they would still have to be represented as rectangles, only you'd be making parts of the layer "inaccessible" - and you can already get the same effect by layer masks, so it would be too much work for no gain whatsoever. Crop to selection giving a rectangular result also makes sense, because it crops to the smallest possible rectangle that can still contain your selection - afterwards, you can simply use the selection to erase (make transparent) the parts of the rectangle you want to be transparent.

This is why I always say that if you want to be good with any graphics software, you should familiarize yourself with how computer graphics work. Become intimate with the pixels. When you see a hex triplet, you should be able to immediately see the approximate colour in your head. With computer graphics, it's all mathematics when you strip down all the fancy abstractions. It becomes so much easier to understand how all the different features and filters work, when you're able to think of the image as simply a set of numbers, which just happen to be represented visually.


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 5:26 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Feb 14, 2012
Posts: 426
If someone came up with circular windows operating system that would be cool. It would change the world as we know it and make things much more organic and true to life.

alan


Top
 Post subject: Re: how to crop a layer to a circular selection
PostPosted: Fri May 24, 2013 5:59 pm  (#19) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
PegLeg44 wrote:
If someone came up with circular windows operating system that would be cool. It would change the world as we know it and make things much more organic and true to life.

alan


Or, you know, would just be horribly awkward and inconvenient for pretty much anything.

Image


Top
Post new topic Reply to topic  [ 19 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group