17

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?

2
  • 1
    today, I used GIMP for this - which was a great success :)
    – Wolf
    Feb 14, 2018 at 15:03
  • its not actually possible to manipulate a pixel image like this inside a vector application without making it a pixel manipulation software, which certainly is possible. But how to ensure it allways manipulates the pixels the way you want to? Its just that inorder to the vector application truly to do this the right by keeping things intact needs homogenious coordinates, or other way to specify perspective divide. In the actual vector specification. Which admittedly we should have but dont. But alas this would mean rewriting quite a bit of our graphics frameworks.
    – joojaa
    Nov 15, 2022 at 20:07

3 Answers 3

9
+50

I have created this Inkscape extension InkRasterPerspective to apply a perspective transformation to a raster image with defined path.

Below is a demonstration on how it works:

How to use the extension to apply a perspective transformation

2
  • That is very nice!
    – Rafael
    Jan 8, 2022 at 20:27
  • Thank you for providing this extension. It works fine for embedded images. Very easy to use. Great work. Nov 14, 2022 at 18:36
9

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.

6
  • Didn't think it would go back to the SVG specification. Thanks for the options. I think I'll go for the external bitmap tool (which might bring me to another question). Jul 29, 2014 at 19:24
  • 2
    Deform the bitmap to appropriate geometry prior to embedding using an external bitmap graphics tool. -> I think I'll go for the external bitmap tool -> So, that can be done with GIMP - just export your blank monitor as a png, open it in GIMP, open the desired image as a Layer, and use GIMP's perspective tool to fit the image there - then it should be possible to ust copy/paste it over to inkscape)
    – jsbueno
    Jul 30, 2014 at 11:58
  • Wouldn’t Perspective and not Envelope be the correct tool for this?
    – Wrzlprmft
    Jul 30, 2014 at 19:11
  • @Wrzlprmft for a rectangle destination Perspective is fine too.
    – Takkat
    Jul 30, 2014 at 19:25
  • Perspective works for any tetragon and produces different results than Envelope, which – and that’s what I was after – look more perspectively correct to me (considering a scenario like the above). And there probably is a reason, why this tool is called perspective.
    – Wrzlprmft
    Jul 30, 2014 at 21:41
2

Better use the right tool for this: GIMP for example. There is a great perspective function, it also supports you in cutting the image after applying the perspective and makes the background transparent.

After the GIMP step, you can place it into you Inkscape drawing. Whereas I'd suggest to think twice about integrating a physical screen. I believe that it would be better to abstract from an actual physical device.

... a video showing exactly this is: GIMP Tutorial - using the Perspective Tool - YouTube

0

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.