I have the image of a front cover of a book, for example,

Front and sydeways photo

that I would like to use (along with the image of the spine) to produce the image on the right, which is, a sideways view of the same book. The transformations of the front and the spine along with the darkening of the spine and stitching of the images together are very easy steps, and I describe them down below (using ImageMagick). I would be interested in listening to strategies for:

  • the soft shadow (on the lower left)
  • a soft edge on the borders and
  • the shadow of the bulge of the binding

and other transformations you would consider (and how) to make this a more photo-realistic composition.

I am specially interested in solutions that are scriptable like ImageMagic

If you you want to try your hand at two examples images, here they are:

The spine The cover

and here is a short script to put them together:

convert wc4jd.png -matte -virtual-pixel transparent \
         -distort Perspective \
              '0,0 0,0   0,651 0,651   453,0 320,43   453,651 320,608' \
convert UPj8N.png -matte -virtual-pixel transparent \
         -distort Perspective \
              '0,0 0,4   0,652 0,648   36,0 36,0   36,652 36,652' \
convert -brightness-contrast -15x10 spine_pers.png spine_pers_dark.png
convert spine_pers_dark.png front_pers.png +append output1.png
convert output1.png -alpha set -virtual-pixel transparent -channel A \
          -morphology Distance Euclidean:1,5\! +channel output.png

and here the not-so-good yet results:

enter image description here

  • 1
    You might check out boxshot.com it's scriptable and is designed for product mockups.
    – Scott
    Commented Apr 16, 2017 at 18:39

1 Answer 1


Unfortunately I have no ImageMagic knowledge, but the following is a simple 3D extrude in Illustrator. The profile with a binding bulge was extruded to the wanted height and your photos were inserted as mapped surface textures

enter image description here

The extruded profile was originally a rectangle, but the visible narrow side was rounded and a quessed binding bulge was added. A short side was deleted by the direct selection tool and the new was drawn by the pen tool. Invisible details were ignored.

The binding end is here enlargened:

enter image description here

The black stroke was removed before the extrusion. The grey fill was given to fill the narrow vertical slices between the cover and the back. I hadn't texture photos for them. I believe this fake to be unnoticeable due the smooth untextured surface (=no canvas or inset patterns)

The shadow on the table was added as heavily blurred black parallellogram; again drawed by the pen. It's opacity was reduced for more subtle appearance.

NOTE: The 3D processing in Illustrator is non-destructive. One can easily change the viewing angle, perspective and the the light for the wanted appearance. The shadow on the table is an independent element, so draw it after you are happy with the 3D extrusion.

The brightness and contrast easily suffer in 3D shading. This is because Illustrator reduces the light to achieve the shading. It can be restored in Photoshop ; see the result.

enter image description here

If one wants to stay in Illustrator, he needs more light sources. Here is a screenshot of two source light:

enter image description here

Scripting: Illustrator is controllable by scripts. Once the right parameters are found, a competent programmer creates a script surely without difficulties.

  • This is extremely nice, I am pretty sure it will take me some time to digest it all, but the results are impressive. Illustrator is controllable by scripts, but not from within a sever that has to process thousands of those on the fly ... read Linux server. It would be really nice to see if anyone can reproduce these moves on IM
    – Paulo Ney
    Commented Apr 16, 2017 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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