Re: [Gimp-user] Fit Canvas to Path





On Sat, Nov 7, 2015, at 09:26 AM, Ofnuts wrote:
On 07/11/15 12:40, akovia wrote:

On Fri, Nov 6, 2015, at 06:31 PM, Ofnuts wrote:
On 06/11/15 20:58, akovia wrote:
Would it be possible to script this in any way? Seems like it should be
a feature already as I keep looking for it but no matter how many times
I check, it never appears. :P

--
    akovia
Stroke the path with a 1px brush and autocrop the image

Without stroking it could be slow because you have to follow the path
pixel by pixel and keep min/max coordinates. To do it a lot faster you
can instead keep the min/max coordinates of anchors and handles but if
this guarantees that you get a rectangle that contains the path, in the
general case it won't be the tightest fit.
_______________________________________________


Thanks for the reply Ofnuts,
What I was looking for was to expand the canvas to accommodate a path.
The inverse is easy as I just load path to selection and then crop to
selection. It has always seemed instantaneous to me.

I trace out elements in a picture and continue my path outside the
canvas to restore elements that were either cropped off or were never
there. I end up with a path that goes beyond the bounds of the canvas
and have to just take a stab of how big to enlarge the canvas to make it
fit. I usually just go overboard and use the technique I described
above, but I do it enough that a function to expand/fit canvas to path
would be extremely helpful. I'm guessing this just isn't possible with a
script/plugin at this point.


OK, see ofn-fit-canvas-to-path on 
https://sourceforge.net/projects/gimp-path-tools/files/scripts/

Actually a mix of Bodo's ideas and mine. First compute a rough bounding 
box using path coordinates, resize the canvas to this, then crop using a 
selection on the path for a tighter fit.

If you want to be able to add a margin just ask.





_______________________________________________
gimp-user-list mailing list
List address:    gimp-user-list gnome org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list

!!!
Just tried this now and already can't live without it.
You have my utmost thanks. Truly!

I saw you already added the margin option as well which is extremely
useful for me. 
If I could make one suggestion, it would be to duplicate or replace the
menu items to the vector menu as that's where I would use it from as I
want to select which path to set it to.

No worries if not as I can hack the script for my personal needs, but I
think it would be better served in that menu.
 
Thanks for putting a smile on my face. After your first response I
thought it was kinda hopeless.

Cheers!
-- 
  akovia


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]