Graphics have never been my force, so i decided to close this gap. After learning the basics of Inkscape and SVG, i'm trying to give more "reality" to my drawings. I have a circle which i want to make appear as a realistic sphere. After following this tutorial and playing with gradients and blurs, this was the result:

I think cast shadow can be longer, but that won't get it any closer to my idea

What i want is mainly a polished surface, or even if the matter has the same consistency as it is, at least an improved border. How to do it? Thank you.


Method 1 works only for flat colors, no high brightness nor high saturation. Method 2 works for larger color range, but it's complex and suffers from not-so-well implemented Inkscape's layer blending modes.

Polished surfaces with glossy reflections are out of the scope of this answer.

Method 1: Draw a grey background, set the luminosity near 128 to have room foor light and shadows. Draw a circle (no matter what color and make an identical copy of it by Ctrl + D, drag the copy aside.

enter image description here

At first make a plausible grey sphere. Remove the stroke. Add a three stop radial gradient that has full white center, full black outer stops and neutral grey fully transparent (alpha=0) middle stops. NOTE the middle stops are inserted by having the gradient edit tool and clicking.

Drag the stop markers until the grey sphere has the wanted appearance. The image below has a good gradient for sideways light:

enter image description here

To move the light source a little behind the watcher

  • drag the gradient center a little towards the center of the circle
  • make the stop arm lengths a little different (=elliptic gradient)

It's done in the next image.

Select the other circle. remove the stroke, give a solid (no transparency) fill color. Avoid full saturation and extreme brightness or darkness. Plausible results need a little flat color:

enter image description here

Move the colored circle under the grey sphere by the align tool (Object > Align and Distribute, raise the grey sphere to top)

enter image description here

NOTE: You can make several spheres with different colors simply by copying and changing the color of the underlying circle.

Add the cast shadow. It's a black or grey ellipse. Filter > Blur > Feather gives to it a hint of ambient light. By alpha you can control the visibility of the background - needed if it's not grey. Be consistent with the directions. Resize and move the shadow carefully when compared to the position of the highlight.

enter image description here

There's still plenty of room to play for different appearances. Here the light is made dimmer by reducing the opacity of the outer stops. The look of neutral band is made narrower by adding opacity to the mid stops. The color saturation is increased. The grey overlay is shifted a little to reveal the underlying color: enter image description here

Method 2: This uses layers and blending modes. The following fully saturated sphere is impossible by using method 1:

enter image description here

Start fom setting the background color.Goto File > Document properties. Set here the color you want. You can also select transparent background (=Checkerboard) for PNG exports. I took 50% neutral grey. The background can also be set up as a drawed rectangle, but you will clash with a bug or property in Inkscape. The same clash occurs when you add the cast shadow. Fortunately it can be worked around, as we see when we add the shadow.

Open the layers panel by clicking its icon. By default you have one layer. Rename it to "Base". Be sure it has 100% opacity and blending mode = normal.

Add a new layer "Shading" onto the base layer. Set the opacity = 100%, blending mode = Hard light.

Goto the Base layer. Draw a circle. No stroke, a solid fill of your wanted sphere color (=cyan). Copy the circle to the clipboard.

Goto the Shading layer. Paste the circle there. For difference change the color (=blue).

enter image description here

Select both circles and align them excactly to the same place. Let's call the circle in Shading layer as "Shade" and the other in Base layer as "Color". So, align Shade and Color to the same place.

NOTE: By locking layer Shading you can select Color despite its position under Shade. Now there's no need to acces Color.

Select Shade and give to it radial 3 stop gradient fill as in Method 1. All stops are greyshades. The center stop is full white, the mid stop is 50% grey, but its opacity is 0 % and the edge stop is full black. Fiddle the stop positions and the arms for the wanted appearance:

enter image description here

NOTE: You get easily some visible banding. It comes from limited underhood math resolution. It's not at all easy to find a combination that produces smooth gradients and is near enough the wanted one.

Add the cast shadow to Base layer. Let it be at first dark grey or full black with 100% opacity and no blur (remember to lower it to bottom, too):

enter image description here

If we blur the cast shadow for illusion of ambient light, we clash with a bug or property. The same happens if we simply reduce the opacity:

enter image description here

The "Shade" circle has a large ghost rectangle which is normally invisible, but affects to the blending. Our shadow is distorted.

Fortunately the unwanted effect disappears, if we draw something onto the Shading layer and then delete it (Ctrl+z). The additional temporay drawing must horizontally cover the problematic area. See an example:

enter image description here

The distortion returns if we select our cast shadow and adjust its blur or opacity. This is annoying, but tolerable because the additional drawing does its work as long as it exists, no need to draw a new one continuously.

ADDENDUM: This guy has a lot of to say about using photos as surface textures.

enter image description here

He told that you can use method 2. You must import an already spherically distorted photo as PNG with transparent background. Then you use it as the color.

  • Ok i followed your advices as much as i could and this is the actual result: ibb.co/kAOqWQ – Daniele Squalo Apr 28 '17 at 21:10
  • Wow i didn't see your addendum! :o i'll test that too! – Daniele Squalo Apr 28 '17 at 21:19
  • @DanieleSqualo About your sphere: You have quite bright color. Maybe you should try to make the black end a little darker and add some opacity to the mid stop. The monkey: It needs a spherically distorted photo. It's easy to make in Photoshop or equivalent and import as PNG. The grey sphere overlay must be in another layer that has blending mode Hard light. Simply dragging the grey sphere onto the photo flattens the contrast too much. Messing with photos is easiest to do in GIMP or Photoshop. You lose nothing because the photos ruin the infinite scalability anyway. – user287001 Apr 28 '17 at 21:36
  • Opacity in middle stop confuses ball's color. Doing just the outer stop to a full black goes to this: ibb.co/hzaR5k – Daniele Squalo Apr 28 '17 at 21:52
  • Look at what happens when i change color to something strong: ibb.co/kWwAWQ Isn't it the case to add another stop with alpha=100%? – Daniele Squalo Apr 28 '17 at 21:58

My two cents.

In my opinion, you have some problems.

You are not wrapping the lower end in a shadow.

The main gradient consists of 3 color nodes.

  • The first one, the center one is not white. It is the actual color I want the object to be. That makes the color more solid.

  • The last one is pretty dark. Take a look at this: How can I make the color white look as white as possible? on how to achive a good gradient.

  • And I added an aditional node, first at the center. Playing a bit with it gives me control of the shadow. It is not at the center but displaced to the dark side... Luke...

This is how the gradient looks:enter image description here

enter image description here

I added a glossy reflection, it is just a white ellipse with a transparent gradient. It could be a curved rectangle or any shape. This shape corresponds to the shape of the reflected light source. Take a look at this two posts regarding the materials:

Additionally really control the position of the shadow, yours do not match the position of the highlight.

The height of this shadow gives the illusion of camera position regarding the floor.


The biggest thing I see is the lack of a shadow on the sphere, realistically your shadow does not match the strength of its highlight. your gradient goes from a white > skyblue (or whichever). If you can adjust the gradient do white > skyblue > really dark blue (like almost black blue), it might help. Remeber, the stronger the light, the stronger the shadow. As if its 12 noon and not a cloud in the sky, the shadows are darker and crisper, if a cloud is blocking the light the objects become more dull (grayish), and so the shadows lighten up as well.

Another area is the edge of the sphere, its too sharp so it does not blend in with the background. if you have a blur tool, blur the edges. The way the cast-shadow edges are blurred.

Extra realism: to really make it feel real, get some textures online and overlay them on your object, like metal texture, etc.

Here's a little sample I did in photoshop trying to fix that. enter image description here

  • It's way better now. Understood all you told about colors and shadows; but what about blurred edges? The more i blur, the more the whole item is big. Is this to be done before or after the lightning? And how much should i blur? Thank you again. – Daniele Squalo Apr 27 '17 at 22:47

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.