Apply a perspective transformation to a raster image inside Inkscape (no need to use an external software such as GIMP or Krita).

Overview

Raster Perspective

Apply a perspective transformation to bitmap image using the selected path as envelope, without the need to use an external software to transform the image.

Installation:

On Linux:

cd $HOME/.config/inkscape/extensions
git clone https://github.com/s1291/InkRasterPerspective.git
  • Open Inkscape (if it is already open, close then re-open it) and you should find the extension under: Extensions > Raster Perspective > Perspective

On Windows:

  • Download the most recent version (direct link: zip)
  • Extract it and copy the files imagePerspective.py and imagePerspective.inx to C:\Program Files\Inkscape\share\inkscape\extensions

How to use

(This extension was tested with both Inkscape 1.1.1 and 1.2-dev on GNU/Linux Ubuntu 20.04.3)

  1. Select the raster image and the quadrangle path (envelope) . Make sure the envelope nodes are ordered as follows:

order of enveloppe nodes

For more details on how to find the nodes order for a path, check out this post.

  1. Extensions > Raster Perspective > Perspective

See below:

How to use the extension

Author

Samir OUCHENE, 2021-2022

All code is licensed under the GNU General Public License version 3. See the license file for details.

You might also like...
Applicator Kit for Modo allow you to apply Apple ARKit Face Tracking data from your iPhone or iPad to your characters in Modo.

Applicator Kit for Modo Applicator Kit for Modo allow you to apply Apple ARKit Face Tracking data from your iPhone or iPad with a TrueDepth camera to

Apply Graph Self-Supervised Learning methods to graph-level task(TUDataset, MolculeNet Datset)

Graphlevel-SSL Overview Apply Graph Self-Supervised Learning methods to graph-level task(TUDataset, MolculeNet Dataset). It is unified framework to co

Apply our monocular depth boosting to your own network!
Apply our monocular depth boosting to your own network!

MergeNet - Boost Your Own Depth Boost custom or edited monocular depth maps using MergeNet Input Original result After manual editing of base You can

Apply AnimeGAN-v2 across frames of a video clip

title emoji colorFrom colorTo sdk app_file pinned AnimeGAN-v2 For Videos 🔥 blue red gradio app.py false AnimeGAN-v2 For Videos Apply AnimeGAN-v2 acro

IJON is an annotation mechanism that analysts can use to guide fuzzers such as AFL.
IJON is an annotation mechanism that analysts can use to guide fuzzers such as AFL.

IJON SPACE EXPLORER IJON is an annotation mechanism that analysts can use to guide fuzzers such as AFL. Using only a small (usually one line) annotati

External Attention Network

Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks paper : https://arxiv.org/abs/2105.02358 Jittor code will come soon

External Attention Network

Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks paper : https://arxiv.org/abs/2105.02358 EAMLP will come soon Jitto

VID-Fusion: Robust Visual-Inertial-Dynamics Odometry for Accurate External Force Estimation
VID-Fusion: Robust Visual-Inertial-Dynamics Odometry for Accurate External Force Estimation

VID-Fusion VID-Fusion: Robust Visual-Inertial-Dynamics Odometry for Accurate External Force Estimation Authors: Ziming Ding , Tiankai Yang, Kunyi Zhan

[ACL-IJCNLP 2021] Improving Named Entity Recognition by External Context Retrieving and Cooperative Learning

CLNER The code is for our ACL-IJCNLP 2021 paper: Improving Named Entity Recognition by External Context Retrieving and Cooperative Learning CLNER is a

Comments
  • Inkscape 1.2.1: PIL.UnidentifiedImageError: cannot identify image file if image is linked instead of embedded.

    Inkscape 1.2.1: PIL.UnidentifiedImageError: cannot identify image file if image is linked instead of embedded.

    Since I used a quite old version in issue #3, I thought I'd better upgrade to the latest version of Inkscape. Now I get this error:

    Traceback (most recent call last): File "C:\Program Files\Inkscape\share\inkscape\extensions\imagePerspective.py", line 179, in imagePerspective.run() File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 231, in run self.save_raw(self.effect()) File "C:\Program Files\Inkscape\share\inkscape\extensions\imagePerspective.py", line 123, in effect orig_image = PIL_Image.open(io.BytesIO(img_data)) File "C:\Program Files\Inkscape\lib\python3.10\site-packages\PIL\Image.py", line 3147, in open raise UnidentifiedImageError( PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x000001ca3022c900>

    My image is a 1314x2592 pixel 24 bit PNG file with a size of 6.99 MB, if that matters. Same error for a 3072x2048 pixel 8 bit BMP file with a size of 6 MB.

    The problem disappears if the file is embedded instead of linked. image

    opened by WelliSolutions 10
  • Inkscape 1.0.2-2: Your selection must contain an image and a path with at least 4 points.

    Inkscape 1.0.2-2: Your selection must contain an image and a path with at least 4 points.

    I tried the extension with Inkscape 1.0.2-2 on Windows 10 and I got the error message:

    Your selection must contain an image and a path with at least 4 points.

    I'm 100% sure I do the steps correctly. Here's how my selection looks like when I invoke the command.

    image

    I don't know how to debug the extension in Inkscape, but I have debugging skills in general. Maybe I just need a pointer on how to enable extension debugging.

    opened by WelliSolutions 2
  • Image distorted when resized in a non-uniform way (aspect ratio changed)

    Image distorted when resized in a non-uniform way (aspect ratio changed)

    First of all thanks for this awesome extension. This is exactly what I need.

    The following does not happen for all images. I have not yet identified criteria when it happens or when it doesn't.

    Using commit https://github.com/s1291/InkRasterPerspective/commit/897d8eb4532eac2032d4dc17f8c30fe4c3b053fe which fixes #4 so I can use linked images.

    I start with a linked image like this 1280x960 pixel 24 bit 3.5 MB BMP file:

    image

    and I get this result

    image

    Note the lower right corner which doesn't match the path.

    opened by WelliSolutions 2
  • Not working on windows - issues with deconstructing self.svg.selection and uuto unit

    Not working on windows - issues with deconstructing self.svg.selection and uuto unit

    Using this package on windows had to fix this error.

    issue:

    will not deconstruct the_image_node, envelope_node = self.svg.selection error of missing expected atribute units when calling unit_to_vp

    Created fix and will submit.

    Thanks for the excellent package.

    needs info 
    opened by cia05rf 5
Releases(v1.0.1)
Owner
s.ouchene
s.ouchene
Self-Supervised Generative Style Transfer for One-Shot Medical Image Segmentation

Self-Supervised Generative Style Transfer for One-Shot Medical Image Segmentation This repository contains the Pytorch implementation of the proposed

Devavrat Tomar 19 Nov 10, 2022
Official implementation of Protected Attribute Suppression System, ICCV 2021

Official implementation of Protected Attribute Suppression System, ICCV 2021

Prithviraj Dhar 6 Jan 01, 2023
Evolution Strategies in PyTorch

Evolution Strategies This is a PyTorch implementation of Evolution Strategies. Requirements Python 3.5, PyTorch = 0.2.0, numpy, gym, universe, cv2 Wh

Andrew Gambardella 333 Nov 14, 2022
curl-impersonate: A special compilation of curl that makes it impersonate Chrome & Firefox

curl-impersonate A special compilation of curl that makes it impersonate real browsers. It can impersonate the four major browsers: Chrome, Edge, Safa

lwthiker 1.9k Jan 03, 2023
PyTorch implementations of the beta divergence loss.

Beta Divergence Loss - PyTorch Implementation This repository contains code for a PyTorch implementation of the beta divergence loss. Dependencies Thi

Billy Carson 7 Nov 09, 2022
Resources complimenting the Machine Learning Course led in the Faculty of mathematics and informatics part of Sofia University.

Machine Learning and Data Mining, Summer 2021-2022 How to learn data science and machine learning? Programming. Learn Python. Basic Statistics. Take a

Simeon Hristov 8 Oct 04, 2022
Make a Turtlebot3 follow a figure 8 trajectory and create a robot arm and make it follow a trajectory

HW2 - ME 495 Overview Part 1: Makes the robot move in a figure 8 shape. The robot starts moving when launched on a real turtlebot3 and can be paused a

Devesh Bhura 0 Oct 21, 2022
Official implementation of "UCTransNet: Rethinking the Skip Connections in U-Net from a Channel-wise Perspective with Transformer"

[AAAI2022] UCTransNet This repo is the official implementation of "UCTransNet: Rethinking the Skip Connections in U-Net from a Channel-wise Perspectiv

Haonan Wang 199 Jan 03, 2023
VD-BERT: A Unified Vision and Dialog Transformer with BERT

VD-BERT: A Unified Vision and Dialog Transformer with BERT PyTorch Code for the following paper at EMNLP2020: Title: VD-BERT: A Unified Vision and Dia

Salesforce 44 Nov 01, 2022
CS506-Spring2022 - Code and Slides for Boston University CS 506

CS 506 - Computational Tools for Data Science Code, slides, and notes for Boston

Lance Galletti 17 May 06, 2022
Starter Code for VALUE benchmark

StarterCode for VALUE Benchmark This is the starter code for VALUE Benchmark [website], [paper]. This repository currently supports all baseline model

VALUE Benchmark 73 Dec 09, 2022
General Vision Benchmark, a project from OpenGVLab

Introduction We build GV-B(General Vision Benchmark) on Classification, Detection, Segmentation and Depth Estimation including 26 datasets for model e

174 Dec 27, 2022
本步态识别系统主要基于GaitSet模型进行实现

本步态识别系统主要基于GaitSet模型进行实现。在尝试部署本系统之前,建立理解GaitSet模型的网络结构、训练和推理方法。 系统的实现效果如视频所示: 演示视频 由于模型较大,部分模型文件存储在百度云盘。 链接提取码:33mb 具体部署过程 1.下载代码 2.安装requirements.txt

16 Oct 22, 2022
CL-Gym: Full-Featured PyTorch Library for Continual Learning

CL-Gym: Full-Featured PyTorch Library for Continual Learning CL-Gym is a small yet very flexible library for continual learning research and developme

Iman Mirzadeh 36 Dec 25, 2022
AFLFast (extends AFL with Power Schedules)

AFLFast Power schedules implemented by Marcel Böhme [email protected]

Marcel Böhme 380 Jan 03, 2023
Code for "Adversarial Training for a Hybrid Approach to Aspect-Based Sentiment Analysis

HAABSAStar Code for "Adversarial Training for a Hybrid Approach to Aspect-Based Sentiment Analysis". This project builds on the code from https://gith

1 Sep 14, 2020
PyTorch framework, for reproducing experiments from the paper Implicit Regularization in Hierarchical Tensor Factorization and Deep Convolutional Neural Networks

Implicit Regularization in Hierarchical Tensor Factorization and Deep Convolutional Neural Networks. Code, based on the PyTorch framework, for reprodu

Asaf 3 Dec 27, 2022
Machine Learning University: Accelerated Computer Vision Class

Machine Learning University: Accelerated Computer Vision Class This repository contains slides, notebooks, and datasets for the Machine Learning Unive

AWS Samples 1.3k Dec 28, 2022
House3D: A Rich and Realistic 3D Environment

House3D: A Rich and Realistic 3D Environment Yi Wu, Yuxin Wu, Georgia Gkioxari and Yuandong Tian House3D is a virtual 3D environment which consists of

Meta Research 1.1k Dec 14, 2022
Time-stretch audio clips quickly with PyTorch (CUDA supported)! Additional utilities for searching efficient transformations are included.

Time-stretch audio clips quickly with PyTorch (CUDA supported)! Additional utilities for searching efficient transformations are included.

Kento Nishi 22 Jul 07, 2022