Copy link to clipboard
Copied
I can't exactly figure out how to describe it. Essentially, is there a way to stroke, like you can on the inside, outside, or center of selection boundries, but have the stroke center itseslf in the middle of a selection?
Currently, the only way i can *sort of* do this is with a backwards method of taking a shape and inverting its color, then doing an inside stroke layer effect with the color of the original, like this
(To repeat, the actual shape here is white, the inside stroke is why it looks purple with a white center line)
This is annoying because:
3. where as a regular stroke (like from the edit dropdown menu) can be pencil tool/bianary, this is always a brush (i know theres some nonsense to make it a pixel outline, but it doesnt actually get me any closer to my task)
The way i do it now besides this, is to take whatever selection and just narrow it by however much until its as close as possible, and then manually go through the entire outline and tune it up by hand. Which i can, do, technicly, but this seems like the kind of thing that A: should be in ps already and B: if it isnt could be like, a plugin or something.
To be clear, essentially what im after is a pen path that can do its own stroke. The reason i dont use pens is because many times there are pre existing, complex shapes that would be time consuming to do by hand especially when i need this stroke for a guide, not for the final product, making it feel like a waste of time. That is, i know the pen tool exists and its a viable alternative but it would still take just as long to do as any other dumb method ive been using.
im not putting this in as an idea because im so sure its possible and im just missing it, but if it isnt i guess ill submit it as one? thank you all 🙂
I don’t think there’s a function like that in Photoshop, but somebody could probably script it.
If you have Adobe Illustrator, you could try this (yes I tested it):
1. In Illustrator, open or paste the Photoshop graphic.
2. Run Image Trace on the graphic, to convert it to vector outlines. Try the Image Trace preset “Black and White Logo”.
3. Expand and ungroup the results so that you can get at the paths.
4. Select the paths for the inner and outer outlines of the Photoshop graphic.
5. Apply
...Copy link to clipboard
Copied
- it isnt actually a stroke, its a layer effect, therefore i cant alter it without altering the main whatever it is im working on.
Say what?
Layer Styles (including »Stroke«) are obviously editable.
Could you please post screenshots taken at View > 100% with the pertinent Panels (Toolbar, Layers, Options Bar, …) visible?
Copy link to clipboard
Copied
I will, but to clarify: When i say "i can't alter it" i mean i can't alter the thin line in the middle.
in the screenshot you can see i duplicated layer 1, inverted its colors, then added an inside stroke with a thickness such that the inverted, mint color is showing through the stroke is as thin as possible. If all i wanted was a stroke in the middle, this would be somewhat servisable, but i actually need to *use* the inner stroke and rasterize it to be its own thing and not dependant on any layer effects.
and even if i did just do that, this only works for shapes that are uniform in width, because any deviation leaves places with too much or spaces with none at all.
what im looking for is a stroke that would find the average 'center' of a selection, and stroke a line down it, so that the stroke is the same width whether the shape its stroking is 3 wide or 8 wide
Copy link to clipboard
Copied
I may not follow, what is the problem with a center stroke?
Can you please provide two files – one with your starting Layer/Selection and one with the intended result?
Copy link to clipboard
Copied
I'm not sure what that would accomplish. To be clear, refer to the title of my post. A CENTER stroke is a stroke that lines the center of a selection's edge. what im looking for is a stroke down the MIDDLE of a selection.
Like, for ex, a selection that's 14x5 pixels. I'm looking for an action or function or whatever that will stroke the middle of the shape, not the selection boundries.
Something like this. Where it finds a point down the middle.
or for selections like this, it would make a stroke down the center of it, creating a "thinnest possible version" of a selection without gaps.
Copy link to clipboard
Copied
I don’t think there’s a function like that in Photoshop, but somebody could probably script it.
If you have Adobe Illustrator, you could try this (yes I tested it):
1. In Illustrator, open or paste the Photoshop graphic.
2. Run Image Trace on the graphic, to convert it to vector outlines. Try the Image Trace preset “Black and White Logo”.
3. Expand and ungroup the results so that you can get at the paths.
4. Select the paths for the inner and outer outlines of the Photoshop graphic.
5. Apply the command Object > Blend > Make. This interpolates between the two paths. You should get one new path running down the middle between the inner and outer paths.
6. Expand the blend results.
7. Select the inner and outer outlines and combine them into a single object with a hole, by using the Exclude icon in the Pathfinder panel, or by appyling the command Object > Compound Path > Make. Apply a black fill to that.
8. Select the new blend path (the path running down the center between the inner and outer paths), and apply a white stroke color and a narrow stroke width.
Copy link to clipboard
Copied
Golly, all that for what seems so simple ;-;
Thanks for the info! Currently just tracing over it or doing some other dumb and tedious manual way is probably less work than importing to and from a whole dif program with 8 steps a peice, but theres at least one thats complex enough to warrent automation, even if its with this system.
Where would i go/who would i talk to if i wanted a script for it for photoshop?
Copy link to clipboard
Copied
That’s just how I would approach it. And it would actually be more than 8 steps if it was explained in full detail. (For example, the command for expanding the blend is different than the command for expanding the Image Trace result.) Yes, it’s a bit involved. Maybe others with different experience would have a better, more direct solution.
There’s nothing wrong with the request, but regarding the lack of a good quick answer…it’s just that this doesn‘t come up very often. You’ve gotten responses from several people who know Photoshop quite well and have been answering questions in this community for many years, and, well…I’m sure most of us can’t even remember if anyone has ever asked this before. And that’s probably a big part of the reason Adobe never made it a feature.
It would be interesting to know if any of the other well-known photo apps (the ones not from Adobe) can find a center line between the inner and outer edges of a pixel shape of varying widths. My guess is they don’t have a way either.
As far as how to script it, I’ll tag @Stephen Marsh in case it looks like something that scripting might take care of.
Copy link to clipboard
Copied
thanks! and yeah, to be quite honest, ive been thinking about this for some days, and while i suppose with my cherry picked examples and broader example of "thick outlines needing a thin centered outline" may make it sound easy, i started imagining all the kinds of complex shapes where 'center' is incredibly subjective, if one even exists, and how it would have to be manually defined by the user which defeats the purpose of not doing it some other way.
Surprisingly, no one ive asked has brought that up either, which makes me feel less dumb about thinking it would be easy in the first place, lol. once again, thanks for the info and help!
Copy link to clipboard
Copied
I don't know about doing it in Photoshop, but if you search for "Image Processing Skeletonize", there are some articles which might help find a way.
Copy link to clipboard
Copied