It is currently Thu Jul 04, 2024 3:56 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: Scaling paths?
PostPosted: Wed Oct 19, 2011 6:54 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
GIMP Version: 2.6.11
Operating System: Windows
OS Version: Win 7 - 64 bit
GIMP Experience: Advanced Level



This is something I never tried before, and is probably quite simple. I'm just having a brain spasm about it, so I figured I'd ask.

If I take a basic graphic image/shape and enlarge it, the edges tend to get tiled, which is standard for raster graphics. But if I make a selection of a graphic image and make a path from the selection, I should be able to enlarge the path and in essence make a cleaner, larger version of the same basic image/shape, from the enlarged path. Does anyone know how I could go about doing this? I would think Gimp can do it, but I'm not sure.

Thanks in advance,

Greg

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


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: Scaling paths?
PostPosted: Wed Oct 19, 2011 7:06 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12531
As long as your path is from a selection fill (single color) this can be done PM. Then scale the path and fill it. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Scaling paths?
PostPosted: Wed Oct 19, 2011 7:22 pm  (#3) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
A path will enlarge along with its image. The first image is 300x300 and I drew a path in it that takes up most of the image. Then I scaled the image to 500x500 and the path enlarged along with it.

Image Image

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Scaling paths?
PostPosted: Wed Oct 19, 2011 7:23 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 06, 2011
Posts: 26
I just realized what those buttons are for at the top of the tool options. PhotoMaster jedi-mindtricked me into learning some thing new. He's sneaky like that...

Image


Top
 Post subject: Re: Scaling paths?
PostPosted: Wed Oct 19, 2011 10:06 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
Thank you muchly! I tried it and it did work, although creating a selection from the enlarged path was still blocky. So I created a selection from the enlarged path, and created a new path from the selection. Then finally I created a new selection from the new path and when I filled the selection, it was smooth! No blockiness!

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 3:35 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I was going to suggest just that.
Take your path and create a selection from it, enlarge that and re save as path again. :)
Then stroke or fill the path.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 4:59 am  (#7) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
PhotoMaster wrote:
Thank you muchly! I tried it and it did work, although creating a selection from the enlarged path was still blocky. So I created a selection from the enlarged path, and created a new path from the selection. Then finally I created a new selection from the new path and when I filled the selection, it was smooth! No blockiness!
You must have missed something ... because if you scale a path up and stroke it (or Select from path+Fill) the result is sharp and clean. In fact your method may look smooth, but it also rounds off sharp edges. Here is a comparison of the various methods to get a 5x enlargement. To my naked eye, even with zooming, I don't see any difference in quality between the last three, that are:

- Path from font size 20 blow up 5 times, selected and filled
- Path from font size 100, selected and filled
- Output from the Text tools (font size 100)

(there may be a minute shape difference if the font in size 100 isn't exactly the size 20 one blown up 5x).
Attachment:
ScalePath.png
ScalePath.png [ 28.77 KiB | Viewed 11263 times ]

_________________
Image


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 7:38 am  (#8) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Thanks for a timely thread. Good info!

Stroking the path does what stroking the selection with a paint brush is supposed to do, but doesn't.

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 8:31 am  (#9) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
When creating paths from selections, you can use the advanced options. Shift-click the "selection to path" icon and it brings up the advanced options window.

What I do is I just switch "align treshold" and "error treshold" to minimum, this way the selection-to-path conversion seems to be much more accurate.

Then just scale the resulting path to whatever size you want with the scale tool, and you're all set.

Also, this way you can also adjust the corner tresholds, to choose which corners will be rounded and which won't.


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 8:45 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Nice info DD thanks!

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 9:04 am  (#11) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
:ditto
Cool info dd, thanks!

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 12:07 pm  (#12) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
GnuTux wrote:
Stroking the path does what stroking the selection with a paint brush is supposed to do, but doesn't.

When GIMP paints colors onto a layer, it does so with sub-pixel accuracy (unless the Pencil is used). What this means is that if you specify coordinates with fractional components, GIMP shades the neighboring (integral) pixels by proportional amounts of the specified color as shown in the following diagrams:

Attachment:
sub-pixel-paint.png
sub-pixel-paint.png [ 8.91 KiB | Viewed 2116 times ]


Unless you are zoomed into the image to see those discrete pixels, your eyes will interpolate the amount of color in each of the neighboring pixels and the end result is that you perceive the full color as appearing proportionally at a single point "between" the pixels. I'm sure you are aware of all this, but it is necessary background for explaining the difference between stroking a selection and stroking a path.

When GIMP strokes a selection, what it actually is stroking is the "marching ants" outline of the selection (what some other image editors call a "marquee"). These marching ants run along the pixels where the selection transitions from below 50% to above 50% and, being the actual coordinates of the pixel, they are always integer values with no fractional components (zoom in to an elliptical selection and note the "stair-stepping" of the marching ants). While a brush stroke from one point on the marching ants to the next may include interpolated points containing fractional components, the end points of that stroke will always fall exactly on a pixel with integer coordinates (because they are on the marching ants).

When stroking a path, there is no restriction of the points on the path being integer values (zoom in while an elliptical path is shown and you will see that it does not follow the shape of the pixels like the marching ants do). This is why stroking a path renders the shape more accurately than stroking a selection, because the painting of the strokes is done with sub-pixel accuracy of all points along the stroke.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 5:46 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I think i get it.The selection will round out to the next value then?
If you want 2 pixels selected it selects 2 pixels EXACTLY.
If you want 2.3 pixels selected it selects 2 pixels EXACTLY.
If you want 2.5 pixels selected it selects 3 pixels EXACTLY.

Why can't it select transparent pixels?After all they are there.Half or less alpha and the rest solid.
If it could do that you would pretty much have the same effect as the new foreground select tool right?

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 6:13 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
Some important information for me to play with and figure out! Thank you all!

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 6:32 pm  (#15) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
Rod wrote:
I think i get it.The selection will round out to the next value then?
If you want 2 pixels selected it selects 2 pixels EXACTLY.
If you want 2.3 pixels selected it selects 2 pixels EXACTLY.
If you want 2.5 pixels selected it selects 3 pixels EXACTLY.

Why can't it select transparent pixels?After all they are there.Half or less alpha and the rest solid.
If it could do that you would pretty much have the same effect as the new foreground select tool right?
Selection isn't interested by transparency but by selection :). But if you have partially selected pixels, since it has to translate an area (of things more or less selected) into a line, it takes the most obvious one, the outline of areas where selection > 127 which also happens to be the marching ants line, so there is no surprise for the user.

Moreover, if we can compute the value of a pixel given its distance to a line, the reverse may not be true, a "dark" pixel can be dark because its close to a single line, or because it's a bit farther from two different lines.

_________________
Image


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 6:36 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thanks Ofnuts. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Scaling paths?
PostPosted: Thu Oct 20, 2011 11:41 pm  (#17) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Thanks to everyone for all the detailed technical info on selection -vs- path.

Are there any procedures available to fill to path, something equivalent to fill to selection?

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Scaling paths?
PostPosted: Fri Oct 21, 2011 12:21 am  (#18) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
GnuTux wrote:
Are there any procedures available to fill to path, something equivalent to fill to selection?

To my knowledge, there are none that are currently available to the user or exposed by the Procedural DataBase. Path filling is obviously performed when fonts are rendered, but this I believe is handled by the Pango and Cairo libraries.

GEGL provides a path filling operation, but it has not yet been made available to the user or the PDB. There also has been some work done on implementing "vector layers" in GIMP but I am not sure what the status of that project is. One of the concepts of vector layers is that every path has an associated fill color (or pattern), which may or may not be rendered.

As far as I know, filling a path is currently best handled by a manual process involving filling the selection and stroking the path. This also demands some degree of user analysis of the situation because these two operations may overlap when you don't want them to, or not overlap when you do.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Scaling paths?
PostPosted: Fri Oct 21, 2011 1:12 am  (#19) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5242
Location: Gimpville
Hopefully, we will see a "fill to path" procedure in the not to distant future. It seems another deficiency using "fill to selection/stroke to path" would be when the aim was to fill with a pattern or gradient, although using that approach might make for some interesting effects. :hehe

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Scaling paths?
PostPosted: Fri Oct 21, 2011 2:52 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
GnuTux wrote:
Hopefully, we will see a "fill to path" procedure in the not to distant future. It seems another deficiency using "fill to selection/stroke to path" would be when the aim was to fill with a pattern or gradient, although using that approach might make for some interesting effects. :hehe


A fill to path option would be true vector objects then wouldn't it?
You would be in path/vector mode, so it would have to create the math for the fill right?

Could this be possible with a SVG gradient?Even if the gradient was 0% = 000000 100% = 000000.
(2 points on the gradient line)... this would fill all points in between with black or a solid color.You could also do it with real gradient fill (SVG), as Gimp already can handle SVG gradients.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Find and fill paths if closed, convert closed paths to transparent

1

No new posts Attachment(s) Scaling

5

No new posts Attachment(s) Gimp is not behaving in scaling images.

1

No new posts Attachment(s) Seamless Pattern - Help please - Scaling issue

4

No new posts Paths Tool Help

1



* Login  



Powered by phpBB3 © phpBB Group