Friday, May 27, 2016

Add perspective to Bitmap in Inkscape


I have a 3D monitor drawn in Inkscape and I'd like to add a screenshot into the region. I have tried to skew, but the shape is too irregular. I have also tried to apply an envelope (Extensions -> Modify Path -> Envelope), but it seems not to work with Bitmaps.


Adding a screenshot to a monitor


How can I get the screenshot to appear like drawn on the screen?



Answer




Perspective or envelope deformation of embedded bitmaps objects is not (yet) defined in the SVG specifications. Therefore we can not do this with Inkscape.


To overcome this we have two options only.




  1. Deform the bitmap to appropriate geometry prior to embedding using an external bitmap graphics tool.




  2. Tracing the bitmap to vector to then be able to use envelope or perspecitive path deformation.


    These are the steps involved for using the envelope tool:




    • Embed bitmap image and select it.

    • Path > Trace bitmap using sensible settings for acceptable results.

    • Object > ungroup the traced vectors.

    • Transform both, the destination, and the traced bitmap to paths with Path > Object to Path.

    • Select source objects, then destination object.

    • Switch to Edit Path by nodes mode F2.

    • Apply Extensions > Modify Path > Envelope (or Perspective for rectangles).

    • wait...


    After that we have a traced bitmap with correct perspective view embedded in our destination object:





enter image description here enter image description here


As we can see this is a quite time consuming, computer memory, and processor demanding task. We may be better off to perform the deformation of the bitmap outside of Inkscape prior to embedding.


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...