Friday, November 30, 2018

images - Imitate a photo realistic rendering of a book cover


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' \
front_pers.png
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' \
spine_pers.png
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




No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...