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
An official TensorFlow implementation of “CLCC: Contrastive Learning for Color Constancy” accepted at CVPR 2021.

CLCC: Contrastive Learning for Color Constancy (CVPR 2021) Yi-Chen Lo*, Chia-Che Chang*, Hsuan-Chao Chiu, Yu-Hao Huang, Chia-Ping Chen, Yu-Lin Chang,

Yi-Chen (Howard) Lo 58 Dec 17, 2022
Face Mesh is a face geometry solution that estimates 468 3D face landmarks in real-time even on mobile devices

Face-Mesh Face Mesh is a face geometry solution that estimates 468 3D face landmarks in real-time even on mobile devices. It employs machine learning

Farnam Javadi 9 Dec 21, 2022
Combining Automatic Labelers and Expert Annotations for Accurate Radiology Report Labeling Using BERT

CheXbert: Combining Automatic Labelers and Expert Annotations for Accurate Radiology Report Labeling Using BERT CheXbert is an accurate, automated dee

Stanford Machine Learning Group 51 Dec 08, 2022
A Multi-attribute Controllable Generative Model for Histopathology Image Synthesis

A Multi-attribute Controllable Generative Model for Histopathology Image Synthesis This is the pytorch implementation for our MICCAI 2021 paper. A Mul

Jiarong Ye 7 Apr 04, 2022
Physics-Aware Training (PAT) is a method to train real physical systems with backpropagation.

Physics-Aware Training (PAT) is a method to train real physical systems with backpropagation. It was introduced in Wright, Logan G. & Onodera, Tatsuhiro et al. (2021)1 to train Physical Neural Networ

McMahon Lab 230 Jan 05, 2023
This is a collection of simple PyTorch implementations of neural networks and related algorithms. These implementations are documented with explanations,

labml.ai Deep Learning Paper Implementations This is a collection of simple PyTorch implementations of neural networks and related algorithms. These i

labml.ai 16.4k Jan 09, 2023
🌎 The Modern Declarative Data Flow Framework for the AI Empowered Generation.

🌎 JSONClasses JSONClasses is a declarative data flow pipeline and data graph framework. Official Website: https://www.jsonclasses.com Official Docume

Fillmula Inc. 53 Dec 09, 2022
MT-GAN-PyTorch - PyTorch Implementation of Learning to Transfer: Unsupervised Domain Translation via Meta-Learning

MT-GAN-PyTorch PyTorch Implementation of AAAI-2020 Paper "Learning to Transfer: Unsupervised Domain Translation via Meta-Learning" Dependency: Python

29 Oct 19, 2022
Exemplo de implementação do padrão circuit breaker em python

fast-circuit-breaker Circuit breakers existem para permitir que uma parte do seu sistema falhe sem destruir todo seu ecossistema de serviços. Michael

James G Silva 17 Nov 10, 2022
Training PSPNet in Tensorflow. Reproduce the performance from the paper.

Training Reproduce of PSPNet. (Updated 2021/04/09. Authors of PSPNet have provided a Pytorch implementation for PSPNet and their new work with support

Li Xuhong 126 Jul 13, 2022
Backdoor Attack through Frequency Domain

Backdoor Attack through Frequency Domain DEPENDENCIES python==3.8.3 numpy==1.19.4 tensorflow==2.4.0 opencv==4.5.1 idx2numpy==1.2.3 pytorch==1.7.0 Data

5 Jun 18, 2022
An API-first distributed deployment system of deep learning models using timeseries data to analyze and predict systems behaviour

Gordo Building thousands of models with timeseries data to monitor systems. Table of content About Examples Install Uninstall Developer manual How to

Equinor 26 Dec 27, 2022
Hierarchical Aggregation for 3D Instance Segmentation (ICCV 2021)

HAIS Hierarchical Aggregation for 3D Instance Segmentation (ICCV 2021) by Shaoyu Chen, Jiemin Fang, Qian Zhang, Wenyu Liu, Xinggang Wang*. (*) Corresp

Hust Visual Learning Team 145 Jan 05, 2023
Face Recognition Attendance Project

Face-Recognition-Attendance-Project In This Project You will learn how to mark attendance using face recognition, Hello Guys This is Gautam Kumar, Thi

Gautam Kumar 1 Dec 03, 2022
ACL'2021: LM-BFF: Better Few-shot Fine-tuning of Language Models

LM-BFF (Better Few-shot Fine-tuning of Language Models) This is the implementation of the paper Making Pre-trained Language Models Better Few-shot Lea

Princeton Natural Language Processing 607 Jan 07, 2023
HPRNet: Hierarchical Point Regression for Whole-Body Human Pose Estimation

HPRNet: Hierarchical Point Regression for Whole-Body Human Pose Estimation Official PyTroch implementation of HPRNet. HPRNet: Hierarchical Point Regre

Nermin Samet 53 Dec 04, 2022
Tools for investing in Python

InvestOps Original repository on GitHub Original author is Magnus Erik Hvass Pedersen Introduction This is a Python package with simple and effective

24 Nov 26, 2022
i3DMM: Deep Implicit 3D Morphable Model of Human Heads

i3DMM: Deep Implicit 3D Morphable Model of Human Heads CVPR 2021 (Oral) Arxiv | Poject Page This project is the official implementation our work, i3DM

Tarun Yenamandra 60 Jan 03, 2023
kapre: Keras Audio Preprocessors

Kapre Keras Audio Preprocessors - compute STFT, ISTFT, Melspectrogram, and others on GPU real-time. Tested on Python 3.6 and 3.7 Why Kapre? vs. Pre-co

Keunwoo Choi 867 Dec 29, 2022
Implementation of "Learning Multi-Granular Hypergraphs for Video-Based Person Re-Identification"

hypergraph_reid Implementation of "Learning Multi-Granular Hypergraphs for Video-Based Person Re-Identification" If you find this help your research,

62 Dec 21, 2022