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
IEEE-CIS Technical Challenge on Predict+Optimize for Renewable Energy Scheduling

IEEE-CIS Technical Challenge on Predict+Optimize for Renewable Energy Scheduling This is my code, data and approach for the IEEE-CIS Technical Challen

3 Sep 18, 2022
Pytorch implementation for "Large-Scale Long-Tailed Recognition in an Open World" (CVPR 2019 ORAL)

Large-Scale Long-Tailed Recognition in an Open World [Project] [Paper] [Blog] Overview Open Long-Tailed Recognition (OLTR) is the author's re-implemen

Zhongqi Miao 761 Dec 26, 2022
[NeurIPS'21] "AugMax: Adversarial Composition of Random Augmentations for Robust Training" by Haotao Wang, Chaowei Xiao, Jean Kossaifi, Zhiding Yu, Animashree Anandkumar, and Zhangyang Wang.

[NeurIPS'21] "AugMax: Adversarial Composition of Random Augmentations for Robust Training" by Haotao Wang, Chaowei Xiao, Jean Kossaifi, Zhiding Yu, Animashree Anandkumar, and Zhangyang Wang.

VITA 112 Nov 07, 2022
OBG-FCN - implementation of 'Object Boundary Guided Semantic Segmentation'

OBG-FCN This repository is to reproduce the implementation of 'Object Boundary Guided Semantic Segmentation' in http://arxiv.org/abs/1603.09742 Object

Jiu XU 3 Mar 11, 2019
Object detection on multiple datasets with an automatically learned unified label space.

Simple multi-dataset detection An object detector trained on multiple large-scale datasets with a unified label space; Winning solution of E

Xingyi Zhou 407 Dec 30, 2022
PyTorch implementation for the visual prior component (i.e. perception module) of the Visually Grounded Physics Learner [Li et al., 2020].

VGPL-Visual-Prior PyTorch implementation for the visual prior component (i.e. perception module) of the Visually Grounded Physics Learner (VGPL). Give

Toru 8 Dec 29, 2022
Secure Distributed Training at Scale

Secure Distributed Training at Scale This repository contains the implementation of experiments from the paper "Secure Distributed Training at Scale"

Yandex Research 9 Jul 11, 2022
Third party Pytorch implement of Image Processing Transformer (Pre-Trained Image Processing Transformer arXiv:2012.00364v2)

ImageProcessingTransformer Third party Pytorch implement of Image Processing Transformer (Pre-Trained Image Processing Transformer arXiv:2012.00364v2)

61 Jan 01, 2023
Official implementation of "Learning Not to Reconstruct" (BMVC 2021)

Official PyTorch implementation of "Learning Not to Reconstruct Anomalies" This is the implementation of the paper "Learning Not to Reconstruct Anomal

Marcella Astrid 13 Dec 04, 2022
A PyTorch implementation of Sharpness-Aware Minimization for Efficiently Improving Generalization

sam.pytorch A PyTorch implementation of Sharpness-Aware Minimization for Efficiently Improving Generalization ( Foret+2020) Paper, Official implementa

Ryuichiro Hataya 102 Dec 28, 2022
PyTorch version of Stable Baselines, reliable implementations of reinforcement learning algorithms.

PyTorch version of Stable Baselines, reliable implementations of reinforcement learning algorithms.

DLR-RM 4.7k Jan 01, 2023
Facial Action Unit Intensity Estimation via Semantic Correspondence Learning with Dynamic Graph Convolution

FAU Implementation of the paper: Facial Action Unit Intensity Estimation via Semantic Correspondence Learning with Dynamic Graph Convolution. Yingruo

Evelyn 78 Nov 29, 2022
Data loaders and abstractions for text and NLP

torchtext This repository consists of: torchtext.datasets: The raw text iterators for common NLP datasets torchtext.data: Some basic NLP building bloc

3.2k Jan 08, 2023
Predicting Price of house by considering ,house age, Distance from public transport

House-Price-Prediction Predicting Price of house by considering ,house age, Distance from public transport, No of convenient stores around house etc..

Musab Jaleel 1 Jan 08, 2022
A simple library that implements CLIP guided loss in PyTorch.

pytorch_clip_guided_loss: Pytorch implementation of the CLIP guided loss for Text-To-Image, Image-To-Image, or Image-To-Text generation. A simple libr

Sergei Belousov 74 Dec 26, 2022
Official implementation of ACTION-Net: Multipath Excitation for Action Recognition (CVPR'21).

ACTION-Net Official implementation of ACTION-Net: Multipath Excitation for Action Recognition (CVPR'21). Getting Started EgoGesture data folder struct

V-Sense 171 Dec 26, 2022
buildseg is a building extraction plugin of QGIS based on PaddlePaddle.

buildseg buildseg is a building extraction plugin of QGIS based on PaddlePaddle. TODO Extract building on 512x512 remote sensing images. Extract build

Yizhou Chen 11 Sep 26, 2022
A Re-implementation of the paper "A Deep Learning Framework for Character Motion Synthesis and Editing"

What is This This is a simple re-implementation of the paper "A Deep Learning Framework for Character Motion Synthesis and Editing"(1). Only Sections

102 Dec 14, 2022
DenseCLIP: Language-Guided Dense Prediction with Context-Aware Prompting

DenseCLIP: Language-Guided Dense Prediction with Context-Aware Prompting Created by Yongming Rao*, Wenliang Zhao*, Guangyi Chen, Yansong Tang, Zheng Z

Yongming Rao 321 Dec 27, 2022
Implementation of our paper "Video Playback Rate Perception for Self-supervised Spatio-Temporal Representation Learning".

PRP Introduction This is the implementation of our paper "Video Playback Rate Perception for Self-supervised Spatio-Temporal Representation Learning".

yuanyao366 39 Dec 29, 2022