Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Offset Path Script for PS CS5 Possible?

Explorer ,
Jun 21, 2012 Jun 21, 2012

Hey all, my needy self is back to ask if anyone has heard of or attempted a script that will offset a path in the same way Illustrator does. ?

I have a group of images with clipping paths penned too much to the outside of the image edge, which will result in the "halo" effect when pasting into InDesign. Currently, I'm copying the path into Illustrator, using Offset Path with a negative value, then pasting back into PS, deleting old clipping path, and saving.

Thanks in advance for any help!

TOPICS
Actions and scripting
5.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Mentor ,
Jun 21, 2012 Jun 21, 2012

Inset the path in id using the options…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 21, 2012 Jun 21, 2012

Yep Mark that's an option, but it's not much faster than the copy/paste method I'm using since multiple images' clipping paths can't be insetted at once in ID. Also, the original images would still be left with an incorrect path. Many times I'll need to run a batch in PS converting these images to tiff files, so then I'm still left with the "haloing" problem when finished. But thanks anyway, I can use that ID inset option for a few of them in a tight spot.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 21, 2012 Jun 21, 2012

The problem is script has no idea of how much halo you get in id… Relative to the scaling factor. At leat you can preview the result doing this in ID. You can't adjust an existing path item in PS just read out the data then create a new path with math your adjustments… If you search the forums you won't find much regarding bézier math and ExtendScript. I've tried to get my head around this with AI scripting and failed miserably on several occasions…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 21, 2012 Jun 21, 2012

A ha, hmm, well again, thanks for the input. I understand ID wouldn't be able to tell how the edges of my clipped images look. To me, that wouldn't matter. If the script were possible, or existed, it would just need to be written for PS only.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 21, 2012 Jun 21, 2012

If you are going to try this in PS then a few things I would add… Path Items I recall are one of the PS items that presume 72dpi so change image res while trying to work them then put back res… Making path from selection is not going to cut it ( well doesn't for me ) I wouldn't make selection from path, contract, make new path and remove old… If you manage it, do post your findings I may be able to utilize myself … nothing like cheek…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 21, 2012 Jun 21, 2012

I agree with Mark, the main problem I see is the script has no way of knowing if the path is off or by how much. And as he pointed out there is no easy way( that I know of ) to preview a clipping path in Photoshop.

Having said that if it just a matter of scaling down the size of the path to correct for the 'too much to the outside of the image edge' that is easy to script if you can figure out the scale amount.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 21, 2012 Jun 21, 2012

Hey Michael, thanks for chiming in..

As far as the scale amount needed, the good thing is, it would be exactly the same for every image. So, I'd say a path inset of 1%, 1 pixel, or 1 or 2 pts would work great for all of my images across the board. That's why I mentioned that ID wouldn't need to know where the edges are at all. So you say this script would be simple?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 21, 2012 Jun 21, 2012

Scale in not going to work in numerous cases… or so I think…? If a path is not square-ish or has compounds… would you not need the creep to go in both directions? Just thoughts… For a doughnut you want the outer loop to get smaller and the inner to get larger no?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 21, 2012 Jun 21, 2012

Yes Mark you're correct. What I'm working with is hardware images that have been clipped incorrectly. Hinges, pulls, knobs.. etc.. so yes, some have screw holes and what not that probably have compound paths. However, so far I've found that the add and subtract parts of the clipping paths are kept separated and not combined in a a compound path at all, which still works in ID of course.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 21, 2012 Jun 21, 2012

Yeah, sorry compounds is an Illustartor term… ( but you know what I mean ). You have path operators a bit like pathfinder in PS, that deal with add/sub/intersect… not sure you can access all that though been a while since I tinkered with this…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 22, 2012 Jun 22, 2012

The task would seem to be a complicated one to me indeed.

It would be possible to determine the direction of a path at the position of a curve pathPoint and »move the point« some distance angled 90˚ relative to that, but with corner points there are problems (compare the Corner > Miter etc.-settings in Illustrator).

The amount by which the bezier handles of the offset points would have to be shortened or lengthened and, even worse, where additional points would have to be introduced make it even more complicated.

If the script were possible, or existed, it would just need to be written for PS only.

A BridgeTalk-Script handing the path’s information over to Illustrator, editing it there and passing it back would probably be easier.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 22, 2012 Jun 22, 2012

I have looked into the very same issue some time back… Like I said my math skills failed me but thats not to say it can't be done… AI would be a no go from the point you would need to do the same thing there. No built in commands for insetting/offsetting and path items… As of CS6 it may be possible but a hassle still ( you can now evoke menus and run actions )… When I searched I could find almost nothing in ExtendScript… I would suspect that developers of this kind of stuff would use C++ ( is that right for plug-ins? ) and not be willing to share such hard work… I found stuff in other languages but I couldn't translate…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 22, 2012 Jun 22, 2012

Illustrator’s Object > Path > Offset Path can not be Scripted directly?

Dang, that Illustrator team sure seems to know how to play difficult when it comes to automation …

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 22, 2012 Jun 22, 2012

Up until CS6 nope… Only recordable in action and ExtendScript can't run actions only AppleScript & VB can. The changes added to CS6 should open up a lot though… Illustrator team I would use that term lightly… Doesn't there need to be more than one to make a team?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 22, 2012 Jun 22, 2012

Illustrator team I would use that term lightly…

OK, I may have done somebody a disservice by not trying to find out how many people at Adobe are actually involved in developing Illustrator … I just assumed the number would justify the term »team«.

Is there anything we should know about? (Not that this is the place or you would be likely to be at liberty to divulge any information you may have beyond what a quick googling did find – pretty much nothing.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jun 22, 2012 Jun 22, 2012

Nope that would just be my sarcastic sence of humor… shinning though…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 22, 2012 Jun 22, 2012

Roger that.

In »Adobe_Fast_Facts_3_2011.pdf« Illustrator is not even metioned under »Flagship products and solutions« …

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 23, 2012 Jun 23, 2012
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2015 Jan 29, 2015
LATEST

The work around is using inDesign's Object>Clipping Path>Options>Inset Frame settings, Choose path, and refit clipping path via a measurement.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines