Best way divide a circle

EB
Posted By
Emma Beane
Nov 5, 2008
Views
4595
Replies
29
Status
Closed
In have a white circle on a black background which I need to divide into 8 equal pie selections to post pictures into…whats the best way to do this please? Thanks so much
Emma

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

JJ
Jim_Jordan
Nov 5, 2008
It is easy to chop anything vertically and horizontally. Once you do that, rotate all the art 45 degrees and chop again.

I’d do this in a page layout application though so I can’t imagine which of the 20 ways to do this in Photoshop would be most ideal.
JM
J_Maloney
Nov 5, 2008
If the placement of the circle is not critical, and you can make a new one on a blank (transparent) layer, make one, and skip to step 2.

1) Double-click the background layer (white circle on black background) and name it layer 0. Then double click to the right of the name (layer 0). Up should pop the blending dialog. Pull the black "blend if" slider at the bottom of the dialog under "this layer" to somewhere near the middle of the slider bar (you should see the black bg vanish). Now with the alt key pressed, break the black slider apart the two sections apart. Where they end up is not critical, just make them separate. Hit ok. Then, use the key command ctrl-j to dupe the layer. Then hit ctrl-e to merge it down. You should now have your white circle (with a black fringe) over transparent checkerboard.

2) Make sure View menu… snap is checked. Now draw guides that bound the circle (top bottom left right) and put two intersecting in the center of the circle. These guides should "snap" into place.

3) With the polygon lasso tool, you should now be able to draw triangles that are precisely 1/8 of the circle. Draw one triangle, then with ctrl-alt-shift held down, click on the layer icon in the layers palette (you should see an x in a box next to your cursor as you hover over the icon). This should clip your selection. Now just open the pic you like, select all copy and go back to your new circle doc and edit… paste into. Repeat for all 8 pie pieces.

4) Make a new layer, move it underneath your circle layer and fill it with black.

< http://www.pixentral.com/show.php?picture=1tHMruqWn2okMPQyxf txgFTc3tgpM0>

< http://www.pixentral.com/show.php?picture=1qUbgUBPqoSQEOLcZI bU945yIXmSL>
P
Phosphor
Nov 5, 2008
The tricky part is making a dead-accurate 360/x pie wedge. I’d do it in illustrator.

But I’d want to do it with a vector shape, however I get there, and use the shape as a mask.

After that, then, and by copying and rotating I’d create a separate layer + mask for each image. That way each image could be moved and resized independently from the others, retaining the pie-shaped outline.

Similar to this mask-layer example I showed somebody last year, only with vector masks instead of letters.

(Click image for full size version)
< http://www.pixentral.com/show.php?picture=1L0he0TcEqWbfITy3Q 2HQI18YgdGZ>
EB
Emma Beane
Nov 6, 2008
Thank-you so much, it did the trick wonderfully
Emma
GA
George_Austin
Nov 7, 2008
Sorry for the broken record, but I can’t resist once again advocating Filter Factory (FF) for tasks such as this.

To divide a circle into 8 equal pie sections, select the circle and put it on a separate layer via CTRL-J. With that layer highlighted invoke FF and enter the following in the R G and B boxes:

R: d%128==0?0:255

G: 255

B: 255

FF splits the circle into 1024 angles. d is the angle

The R code says "If the angle divided by 128 leaves zero remainder, set R =0, else set R=255.

Thus, where d is a multiple of 128, the color is cyan (blue and green). Elsewhere it is white.

What could be cleaner?
P
Phosphor
Nov 7, 2008
Despite Filter Factory’s agility (or the even more versatile Filter Foundry < http://www.telegraphics.com.au/svn/filterfoundry/trunk/dist/ README.html>) I’d still want to do it with vector masks.

But that’s just me, and my famous pickiness.

🙂
GA
George_Austin
Nov 7, 2008
Phos

Correct me if I’m not following you. I think you are referring to what you do with the eight pie sections after they have been formed, and using them as masks is one way to go. How you delineate them is one thing, and how you make masks of them and deploy the masks is another. Using FF to form the pie sections to begin with and then selecting each piece of pie, in turn, as a mask seems as good a way to go as any.

George
P
Phosphor
Nov 7, 2008
I’m saying I’d create the pie wedges as vector objects, and keep and use them as vectors so they’d re-render as cleanly as possible if I decided I wanted to move, rotate or resize them. Once you’ve created a pixel-based selection or mask, you’re kind of limited in what you can do with them and still maintain original quality.

I’ve learned the hard way too many times about trying to tweak pixel-based objects and not having them meet the quality standards I enjoy, so I do what I can to use vectors wherever possible.
GA
George_Austin
Nov 7, 2008
Can you create a vectorized circular section in PS?
P
Phosphor
Nov 7, 2008
Sure, George, but it’s kind of a PITA if you’re used to working with Illustrator’s vector tools and functions.

(For me, anyway)
GA
George_Austin
Nov 7, 2008
Ok, Phos, you rascal. I should have asked "How?" not "Can you?"
GH
Gernot_Hoffmann
Nov 7, 2008
Creating a template for N circle segments
is fairly simple. Edit the code below, for
instance by N=8, and save as EPS.
Open by PhS, AI or ID. Don’t worry about
the small file size …

Best regards –Gernot Hoffmann

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 800 800
%%Creator: Gernot Hoffmann
%%Title: N Circle Segment
%%CreationDate: November 07/2008

/mm {2.834646 mul} def
/x 150 mm def
/s 100 mm def
x x translate
s s scale % 1 –> 100mm

0.25 mm s div setlinewidth
0 0 1 setrgbcolor

0 0 1 0 360 arc
stroke

1 0 0 setrgbcolor

/N 7 def % N segments
/da 360 N div def
/an 0 def
1 1 N
{pop
0 0 moveto
an cos an sin lineto
/an an da add def
} for
stroke

showpage
P
Phosphor
Nov 7, 2008
Gernot…

When editing that code, do we replace ALL instances of ‘N’ with the integer of our choosing?
GH
Gernot_Hoffmann
Nov 7, 2008
Here it’s simply a sequential signal flow.
N is is defined once by e.g
/N 8 def

As long as it is not re-defined, N is 8.

I can imagine many applications, where such
a simple EPS is useful, for instance for grids.

Best regards –Gernot Hoffmann
P
Phosphor
Nov 7, 2008
I agree, Gernot, it can be useful, but for most of us wrapping it all in a nice GUI is what we want, and serves better for convenience.

My brain can learn and understand code, but my guts don’t like it much!

: )
GH
Gernot_Hoffmann
Nov 7, 2008
Phos,

put it on the wishlist. AI doesn’t know something simple like a circle segment, though it’s a basic PostScript
geometry element.
<http://www.adobeforums.com/webx/.59b6577c/29>

Sometimes I’m thinking that plain PostScript is more
powerful than the AI GUI (in limits, of course),
and not to talk about the idiotic blowing up of
simple PostScript graphics by AI (5kB PS –> 100kB AI).

Best regards –Gernot Hoffmann
P
Phosphor
Nov 7, 2008
"…AI doesn’t know something simple like a circle segment…"

That’s one of the reasons I really enjoy HotDoor’s CadTool plugin. I don’t use it all the time, but when I need it, I need it. I really ought to dig in and learn Canvas better, but the different usage conventions between Canvas and AI always bog me down.

"Sometimes I’m thinking that plain PostScript is more powerful than the AI GUI…"

Again, I’m sure you’re right, but wrapping the code in a click-friendly GUI is FAR more attractive to 99.8% of AI users…even the hard-core, long-time users. And it’s quicker to use, as well.

"…and not to talk about the idiotic blowing up of simple PostScript graphics by AI (5kB PS –> 100kB AI)."

And so we siiiiiiggggghhhh, and live with it. Short of finding another mythical vector application that has all the capability and none of the bloat, what else can we do?
GA
George_Austin
Nov 8, 2008
Gernot,

My word processor doesn’t have EPS as a save option. Photoshop DOES. So I enter your code as text in a PS file and save it using EPS format. When I open the saved EPS file I get an image of the rasterized text. Great! I was expecting to get an eight-segmented circle. Clearly I need more explicit help.

George
JM
J_Maloney
Nov 8, 2008
Save as text with a .ps/.eps extension. Notepad should.

<http://en.wikipedia.org/wiki/List_of_text_editors>
P
Phosphor
Nov 8, 2008
I copied Gernot’s script, pasted it into a new BBEdit document, made no changes, saved as "GerneotPie.eps" and dragged the document from my desktop onto the PS CS2 icon in the dock.

I was asked to make a choices for rasterizing; I accepted the default values— 11.111 inches for both width & height, at 72 ppi. RGB, antialiased, constrained proportions.

I added a Layer beneath the generated image and filled it with white.

VoilĂ !

< http://www.pixentral.com/show.php?picture=1I1EDYuszkaKZdeTV0 xbYzu5Ilxos>
P
Phosphor
Nov 8, 2008
Sooo, OK, that’s cool and all, but it still doesn’t easily address the original question. Sure, we could make a selection of the interior of one of the wedges—say with the Tragic Wand, for example—but it’s still going to have to start out as a raster-based image, unless the wedge is traced with the Pen Tool. That, then puts us back to square one, where we might as well start out creating the vector shape manually.
GA
George_Austin
Nov 8, 2008
I used Wordpad. Although it doesn’t list EPS as a specific format, just adding .eps to the doc name was sufficient. It opened in PS as a segmented circle. Thanks. Saving as EPS in PS doesn’t save as a text file.

So then, back to you Phos—just like a TV sportscaster—Phos is going to tell us how he manages to create the vector piece of pie in PS, however arduous.

BTW, working with a rasterized shape created by Gernot’s code isn’t all that bad because you just change parameters for the size you want rather than suffering degradation from trying to go one-size-fits-all.
P
Phosphor
Nov 8, 2008
Just for fun, about 76KB:

< http://home.comcast.net/~phosphor-digital/bbs/8vectorwedgema sks.psd.zip>

Siiiggghhh…explaining how I did this is a daunting task, because I’ve just done it twice, with some different steps each time. It’s really not difficult, or super time consuming. It’s just fiddly.

Both times, no matter how careful I was with anchor point placement, it seems I always end up with wedges that are just slightly under 45°. This leaves a bit of white space between adjacent wedges. I suppose that could be adjusted for, but it would take some experimentation.

That’s why I like the precision of Illustrator for this type of work.
JM
J_Maloney
Nov 8, 2008
For precision, but nasty too…draw a line tool radius vertically. Duplicate and rotate by x degrees. Make sure the rotate proxy is set to the bottom right. Then, draw a guide that snaps to the bottom right corner of the rotated line (horiz. guide). Now draw a guide vertical against the right side of the original line. Now you have your center origin and the right side of the rotated line is your right side of the pie piece, with the vert guide being the left side. Kill the extraneous points and complete the triangle. Now, using the circle shape tool in intersect mode, draw a circle from the origin (click-drag-shift-alt to have it originate from the origin). Now you have a pie piece. You can select the triangle only and rotate with the lower-left proxy on a duplicated shape for pie two.

I’m thinking the third way will be extra pretty.

I get white space too, anti-aliasing in the vector render? The horizontal paths are dead on, but still make white space.
P
Phosphor
Nov 8, 2008
On the other hand, creating the wedges in AI, and pasting them into PS is much more accurate. And easier. And quicker.

< http://home.comcast.net/~phosphor-digital/bbs/8AIvectorwedge s.psd.zip>
P
Phosphor
Nov 10, 2008
I don’t usually do this, but I’m floating this thread because it addresses a couple things that don’t get a whole lot of attention. There might be some whose contributions would be most welcome, but who may never see it if the thread dumps off the front page of the index.
GA
George_Austin
Nov 10, 2008
Phos

Wow! Although you haven’t revealed HOW, you have sure enough cooked up a most interesting pie. I have not worked with shape layers or vector masks, so this is adventureland for me. Your product should serve well in exploring them. There’s much more there than meets the eye. Thanks for the road map.

George
P
Phosphor
Nov 11, 2008
It’s not that I want to keep it a secret, George, it’s just that in order to write it up I have to go through it a bunch of times, make sure I’ve discovered the easiest, most translateable way to do it, then write it out without missing any details or steps.

There’s a little thing I did with the Command + Option + Shift + T (CTRL + ALT + Shft + T) "Copy and repeat transform" function that was putting each new rotated wedge on a new layer…I did it once, but I can’t figure out how I did it again. I can still do it, but for some reason there’s another cumbersome little step that I don’t think I had to do before.

Let me play for a little while. I’ll re-float the thread again when I have something new to add.
P
Phosphor
Nov 11, 2008
Dang, and grrr…

"Spent several hours yesterday and last night into the wee hours setting up a Photoshop tutorial in prep for screen motion cap recording…" <http://www.adobeforums.com/webx?14@@.1de5f905.3c063549/945>

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

Related Discussion Topics

Nice and short text about related topics in discussion sections