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
Affine / perspective transformation in Pose Estimation with Tensorflow 2

Pose Transformation Affine / Perspective transformation in Pose Estimation with Tensorflow 2 Introduction 이 repo는 pose estimation을 연구하고 개발하는 데 도움이 되기

Kim Junho 1 Dec 22, 2021
Inkscape extensions for figure resizing and editing

Academic-Inkscape: Extensions for figure resizing and editing This repository contains several Inkscape extensions designed for editing plots. Scale P

null 192 Dec 26, 2022
Implementation of "RaScaNet: Learning Tiny Models by Raster-Scanning Image" from CVPR 2021.

RaScaNet: Learning Tiny Models by Raster-Scanning Images Deploying deep convolutional neural networks on ultra-low power systems is challenging, becau

SAIT (Samsung Advanced Institute of Technology) 5 Dec 26, 2022
Deep Learning Datasets Maker is a QGIS plugin to make datasets creation easier for raster and vector data.

Deep Learning Dataset Maker Deep Learning Datasets Maker is a QGIS plugin to make datasets creation easier for raster and vector data. How to use Down

deepbands 25 Dec 15, 2022
A Python script that creates subtitles of a given length from text paragraphs that can be easily imported into any Video Editing software such as FinalCut Pro for further adjustments.

Text to Subtitles - Python This python file creates subtitles of a given length from text paragraphs that can be easily imported into any Video Editin

Dmytro North 9 Dec 24, 2022
Does MAML Only Work via Feature Re-use? A Data Set Centric Perspective

Does-MAML-Only-Work-via-Feature-Re-use-A-Data-Set-Centric-Perspective Does MAML Only Work via Feature Re-use? A Data Set Centric Perspective Installin

null 2 Nov 7, 2022
codes for Image Inpainting with External-internal Learning and Monochromic Bottleneck

Image Inpainting with External-internal Learning and Monochromic Bottleneck This repository is for the CVPR 2021 paper: 'Image Inpainting with Externa

null 97 Nov 29, 2022
ktrain is a Python library that makes deep learning and AI more accessible and easier to apply

Overview | Tutorials | Examples | Installation | FAQ | How to Cite Welcome to ktrain News and Announcements 2020-11-08: ktrain v0.25.x is released and

Arun S. Maiya 1.1k Jan 2, 2023
I tried to apply the CAM algorithm to YOLOv4 and it worked.

YOLOV4:You Only Look Once目标检测模型在pytorch当中的实现 2021年2月7日更新: 加入letterbox_image的选项,关闭letterbox_image后网络的map得到大幅度提升。 目录 性能情况 Performance 实现的内容 Achievement

null 55 Dec 5, 2022
Reference implementation of code generation projects from Facebook AI Research. General toolkit to apply machine learning to code, from dataset creation to model training and evaluation. Comes with pretrained models.

This repository is a toolkit to do machine learning for programming languages. It implements tokenization, dataset preprocessing, model training and m

Facebook Research 408 Jan 1, 2023