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
The Official PyTorch Implementation of "LSGM: Score-based Generative Modeling in Latent Space" (NeurIPS 2021)

The Official PyTorch Implementation of "LSGM: Score-based Generative Modeling in Latent Space" (NeurIPS 2021) Arash Vahdat*   ·   Karsten Kreis*   ·  

NVIDIA Research Projects 238 Jan 02, 2023
Official Pytorch implementation of 'RoI Tanh-polar Transformer Network for Face Parsing in the Wild.'

Official Pytorch implementation of 'RoI Tanh-polar Transformer Network for Face Parsing in the Wild.'

Jie Shen 125 Jan 08, 2023
Official implementation of Long-Short Transformer in PyTorch.

Long-Short Transformer (Transformer-LS) This repository hosts the code and models for the paper: Long-Short Transformer: Efficient Transformers for La

NVIDIA Corporation 198 Dec 29, 2022
Official implementation of "A Unified Objective for Novel Class Discovery", ICCV2021 (Oral)

A Unified Objective for Novel Class Discovery This is the official repository for the paper: A Unified Objective for Novel Class Discovery Enrico Fini

Enrico Fini 118 Dec 26, 2022
A Library for Modelling Probabilistic Hierarchical Graphical Models in PyTorch

A Library for Modelling Probabilistic Hierarchical Graphical Models in PyTorch

Korbinian Pöppel 47 Nov 28, 2022
Official implementation of Self-supervised Graph Attention Networks (SuperGAT), ICLR 2021.

SuperGAT Official implementation of Self-supervised Graph Attention Networks (SuperGAT). This model is presented at How to Find Your Friendly Neighbor

Dongkwan Kim 127 Dec 28, 2022
Multi-modal Vision Transformers Excel at Class-agnostic Object Detection

Multi-modal Vision Transformers Excel at Class-agnostic Object Detection

Muhammad Maaz 206 Jan 04, 2023
3D Multi-Person Pose Estimation by Integrating Top-Down and Bottom-Up Networks

3D Multi-Person Pose Estimation by Integrating Top-Down and Bottom-Up Networks Introduction This repository contains the code and models for the follo

124 Jan 06, 2023
face property detection pytorch

This is the face property train code of project face-detection-project

i am x 2 Oct 18, 2021
Generative Models as a Data Source for Multiview Representation Learning

GenRep Project Page | Paper Generative Models as a Data Source for Multiview Representation Learning Ali Jahanian, Xavier Puig, Yonglong Tian, Phillip

Ali 81 Dec 03, 2022
TrTr: Visual Tracking with Transformer

TrTr: Visual Tracking with Transformer We propose a novel tracker network based on a powerful attention mechanism called Transformer encoder-decoder a

趙 漠居(Zhao, Moju) 66 Dec 27, 2022
Character Controllers using Motion VAEs

Character Controllers using Motion VAEs This repo is the codebase for the SIGGRAPH 2020 paper with the title above. Please find the paper and demo at

Electronic Arts 165 Jan 03, 2023
Fast, flexible and fun neural networks.

Brainstorm Discontinuation Notice Brainstorm is no longer being maintained, so we recommend using one of the many other,available frameworks, such as

IDSIA 1.3k Nov 21, 2022
Neural Reprojection Error: Merging Feature Learning and Camera Pose Estimation

Neural Reprojection Error: Merging Feature Learning and Camera Pose Estimation This is the official repository for our paper Neural Reprojection Error

Hugo Germain 78 Dec 01, 2022
Dataset VSD4K includes 6 popular categories: game, sport, dance, vlog, interview and city.

CaFM-pytorch ICCV ACCEPT Introduction of dataset VSD4K Our dataset VSD4K includes 6 popular categories: game, sport, dance, vlog, interview and city.

96 Jul 05, 2022
NUANCED is a user-centric conversational recommendation dataset that contains 5.1k annotated dialogues and 26k high-quality user turns.

NUANCED: Natural Utterance Annotation for Nuanced Conversation with Estimated Distributions Overview NUANCED is a user-centric conversational recommen

Facebook Research 18 Dec 28, 2021
Using LSTM write Tang poetry

本教程将通过一个示例对LSTM进行介绍。通过搭建训练LSTM网络,我们将训练一个模型来生成唐诗。本文将对该实现进行详尽的解释,并阐明此模型的工作方式和原因。并不需要过多专业知识,但是可能需要新手花一些时间来理解的模型训练的实际情况。为了节省时间,请尽量选择GPU进行训练。

56 Dec 15, 2022
Contains modeling practice materials and homework for the Computational Neuroscience course at Okinawa Institute of Science and Technology

A310 Computational Neuroscience - Okinawa Institute of Science and Technology, 2022 This repository contains modeling practice materials and homework

Sungho Hong 1 Jan 24, 2022
Supplemental Code for "ImpressionNet :A Multi view Approach to Predict Socio Facial Impressions"

Supplemental Code for "ImpressionNet :A Multi view Approach to Predict Socio Facial Impressions" Environment requirement This code is based on Python

Rohan Kumar Gupta 1 Dec 19, 2021
BitPack is a practical tool to efficiently save ultra-low precision/mixed-precision quantized models.

BitPack is a practical tool that can efficiently save quantized neural network models with mixed bitwidth.

Zhen Dong 36 Dec 02, 2022