New extension: apply a perspective transformation to bitmap image

Bug #1516357 reported by su_v
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Wishlist
Unassigned

Bug Description

Inkscape includes an extension to apply a perspective transformation based on a quadrilateral path to vector objects. For bitmap images included in a design to be transformed perspectively, users have to resort to either tracing them first, or using GIMP [1].

The attached extension implements perspective transformation of a bitmap image based on a quadrilateral path drawn in Inkscape, using PIL (Pillow) to modify the bitmap image itself. It is a destructive operation: embedded bitmap images are modified in-place, linked bitmap images are replaced by an embedded and modified version (the external file is unchanged).

[1] example tutorial:
http://www.inkscapeforum.com/viewtopic.php?t=13017#p49758

su_v (suv-lp)
Changed in inkscape:
assignee: nobody → ~suv (suv-lp)
Revision history for this message
su_v (suv-lp) wrote :

Quick example of the output.

Revision history for this message
su_v (suv-lp) wrote :

Changing bug status to 'Opinion' for now - my current plan is to investigate alternative solutions using python bindings for ImageMagick (e.g. py-wand) to implement perspective and other transformations/distortions (envelope, crop).

Changed in inkscape:
status: New → Opinion
Revision history for this message
su_v (suv-lp) wrote :

Attached is a snapshot of a set of 'Modify Image' extensions:
- Affine Distortion
- Crop
- Perspective/Envelope
- Shepards Distortion
and a small debug extension. They all use a new shared module (image_lib) which allows to switch the python imaging module (if supported) at runtime. Required python modules are PIL/Pillow and/or latest Wand.

Development is tracked here:
http://bazaar.launchpad.net/~suv-lp/+junk/inkscape-extensions/files/head:/modify-image/

Changed in inkscape:
status: Opinion → New
Revision history for this message
su_v (suv-lp) wrote :

New extension (WIP) added:
- Crop to Clip
to crop clipped bitmap images to the bounding box of the clipping path (based on a feature request from alimuldal on #inkscape (irc)). Optionally, the bitmap image can be cropped to the bounding box of the next clip applied on a parent group of the <image> element.

Known limitations:
- Supported element types inside <clipPath> definitions are limited to what simpletransform.computeBBox() can process (no specific checks implemented yet). Groups inside a clipPath definition are not supported by the extension (see SVG 1.1 spec).
- Nested clipPath definitions are not supported.
- Multiple clips applied on nested groups wrapped around the bitmap image are not supported (only the inner-most clip-path is used).

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote : [Bug 1516357] Re: New extension: apply a perspective transformation to bitmap image

Attaching a showcase for the basic supported image modifications.

Revision history for this message
su_v (suv-lp) wrote :

Diff for osx packaging to include py-wand for Python 2.7 (Pillow is already included).

Revision history for this message
su_v (suv-lp) wrote :

Closing - I have no plans to further promote this set of extensions for bundling with Inkscape. Any future updates about the extensions' state will be tracked in my personal launchpad repo (see linked branch).

Changed in inkscape:
status: New → Invalid
assignee: ~suv (suv-lp) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.