Your brain is your body's most neglected organ...nurture it here.

Producing an EBook Cover With POVRay and Inkscape

Date/Time Permalink: 12/03/08 06:49:52 pm
Category: Graphics Tutorials

This is going to be half-tutorial and half-exhibition, for at least the intermediate graphics artist.

In selling ebooks, even though you're buying an electronic document that exists only in the virtual world, sellers prefer to market the book with a graphic of the book as if it were a physical object. Which has given rise to a small market for ebook cover design and renders. Here, I've produced a hypothetical example:

sample ebook

So I'll just walk you through the steps. It isn't worth pinning it down in detail, because that might change for an individual project. You might draw the cover and spine in something besides Inkscape, you might need a different size, and you might want to show a paperback or a spiral-bound book or some other design. I'm also going to use KPOVModeler and show how to do it in the GUI, since my usual POVRay tutorials degenerate into a gobbledegook of code which I'm not sure if that's lost on anybody or what. So let's try reaching the visual learners this time.

So I first draw the cover and the spine as PNG files which have dimensions of 765x990 and 100x990. Here's the aspect, chosen to mimic A4 letter size paper, and a book of about 100 pages or so:

aspect of cover and spine

But they're actually saved as two separate files. Now in POVRay, we're simply going to shape a book out of a few polygons and use the two images as textures for the front and side. Let's try to get KPOVModeler showing it. Start with a merge of a box and a cylinder.

book step 1

The two objects are textures with the flat images we made earlier.

book step 1 texture

Next we're going to cut a slice out of those two merged objects with another box.

book step 2

Last, we put another box inside of the sliced-out box and color it white. This will be our "pages" object. We could go to a lot of trouble and use a texture on top of the white block to look more like paper pages and we could also add some detail inside the top of the spine to make it look like it has binding. Those are all more painstaking details. We'll forget that here.

book step 3

Now comes the really hard part. If we just slap a white-colored plane for the book to sit on and use a default light and camera, we get this:

don't do this

God, that's terrible! To fix things so they're realistic, let's give the plane a texture instead. It will still be pure white, but with the addition of a finish which will have these tweaks:

  • ambient color: a neutral gray
  • diffuse: 1.5
  • reflexion: set the maximum to a slightly less than black shade. We only want to reflect enough light to give it a gloss, not make it look like a mirror.

The next fix is to eliminate the horizon, so we make a huge cylinder around the whole scene, camera, book, light, and all. We want an endless sea of uniform white, just like if we had a studio backdrop. We give the cylinder the same texture as the plane.

book step 4

Now we have this:

some progress

The next thing is to soften the shadow. Look around you now: you never really look at the edge of a shadow again in quite the same way after you start 3D modeling. Let's make our point-light be an area light, with many light-points spread out over a disk shape.

book step 5

Your light in the preview windows now looks like a mesh. Every intersection of that mesh represents a light source. In fact, we're making a round disk of light-emitting objects which is more like our real-world bulb. We're almost there:

almost there

One thing you'll notice is that the render takes about ten times as long to finish! That's because your computer's doing many times the work, tracing a lot more rays than it was before.

One more thing we'll do is illuminate the spine with a second light. This time, it's a plain point light, with the color set to neutral gray - the concept is called a "fill light". We're just filling in the shadowed part of the spine so you can see it, but not making it strong enough for the book to cast two shadows.

book step 6

And now for the last tweak, we're going to create a render mode that is 1600x1200, quality 11, antialiasing set to 'recursive', threshold 0.1, depth 8, turn on 'jitter' set to depth 2, and turn on radiosity. Oh, boy, is that ever going to take a lo-o-o-ong time, even on a fast machine! Go take a coffee break or even a nap; on a slower machine I just leave it rendering overnight.

When it's done, save it, then open it in Gimp and crop it down to usable size. I'd recommend saving it as a high-quality PNG, that way it will stay crisp until you're ready to use it. Scale it down and put it next to your order button on your sales page, you crafty Internet entrepreneur, you!

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

suddenly the moon