We need to create a donut (=a torus) with a gradient along its length Basically we want to take this rectangle

enter image description here

and wrap it around and make it a tube, then connect it end to end to create this torus (but with the black color in the center of the surface, not on the inside as in this picture)

enter image description here

Actually we do not need a 3D torus, only a circular ring shaded like a torus. I would appreciate any suggestions on how to create such a graphic.

  • 1
    What software? -
    – Scott
    Oct 11, 2017 at 18:55
  • @Scott We are currently using Gimp, but we also have access to Photoshop. We are all programmers, so we could use something like ImageMagik also
    – puk
    Oct 11, 2017 at 19:24
  • 1
    I dare say that a programmer could also use an sdl language like Pov-Ray and obtain easily a torus (see also here, to be rendered with a transparent background.... Oct 12, 2017 at 7:31
  • This is trivial in Illustrator. In the software you name... not so much.
    – Vincent
    Oct 12, 2017 at 9:57
  • @Vincent I disagree: for a developer it's just a matter of writing a line of code, and the resulting effect is more realistic and detailed: torus{1.0,0.25 texture{pigment{color rgb y} finish{phong 1}}}. Oct 12, 2017 at 12:52

3 Answers 3


Make a three stop radial gradient and fill your ring with it. (I'll add soon images)

ADDENDUM That was actually not a good idea, because the same method is meanwhile appeared in another answers. Here's something else:

  1. Have a square image with a white layer. Let the image have pixel dimensions 200% of the wanted ring diameter. Draw a horizontal rectangular selection just at the middle of the image and fill it with black

enter image description here

  1. Let the selection stay, make a gaussian blur, so heavy that the black just lightens a little in the middle, too. The blur is now a gradient.

enter image description here

  1. Let the selection stay. Take the curves tool and adjust the steepness of the gradient to resemble a straight tube:

enter image description here

  1. Remove the selection Goto Filter > Distort > Polar coordinates > Rectangular to Polar

enter image description here

  1. Take the magic wand. Select the white and press DEL. Be sure you have the tolerance = 0 or 1 and antialiasing =ON. Before deleting you can goto selection menu and contract the selection if you want to save more white. Otherwise the pure white is removed.

enter image description here

ADD2: I just read you are programmers. Then you should have no problems to implement the following radial brightness:

enter image description here

Bx = Brightness (0...255) at the edge

Bm = Brightness at the middle of the ring

R1 = internal radius

W = radial width of the ring

h = roundness exponent, positive, start with h=1

  • Wow, these answers are amazing. Usually I post questions in StackOverflow, and the majority of comments come back RTFM
    – puk
    Oct 12, 2017 at 0:08
  • 1
    @puk If the manual is busy, it cannot be read.
    – user82991
    Oct 12, 2017 at 1:09

You can apply a radial gradient to the stroke of a vector layer in Photoshop.

enter image description here

Or a reflected gradient as a layer style stroke using the Shape Burst option:

enter image description here

. . . the Layer style is a bit easier to apply and edit if necessary.

  • Good answer you get my vote but you never brought it all the way to his example (single gradient from light to dark with hard stop on inner circle edge)
    – Webster
    Oct 11, 2017 at 21:04
  • @Webster.. I think you missed part of the question. Specifically -- "(but with the black color in the center of the surface, not on the inside as in this picture)" [emphasis mine]
    – Scott
    Oct 12, 2017 at 0:59

Have you perhaps thought about trying Inkscape(dot)org - like GIMP it's also free and Open Source.

Draw a circle, set a wide stroke size, no fill, colour the stroke blue.

Copy it, and Paste in Place, then colour the stroke black, reduce the width of the stroke, and apply some blur.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.