Skew image as if viewed from the side

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
pmdpmd
Posts: 3
Joined: 2017-03-10T12:46:40-07:00
Authentication code: 1151

Skew image as if viewed from the side

Post by pmdpmd »

I would like to skew/rotate an image as if I was viewing it from the side/top.

Given a horizontal and vertical angle and a distance of viewer from the image, I wonder if anyone could advise the correct API functions to call to achieve this.

The image is of a 2D object flat on to the camera, specifically a license plate which I would like to simulate being viewed from an observer/camera at the side of the road.

I found the rotate3D script in Fred's Scripts, which I think does what I require, but I am wanting to achieve this using the C# API rather than Unix command line calls.

Any help would be most appreciated.

Regards, Paul
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Skew image as if viewed from the side

Post by snibgo »

What version of IM? Do you use MagickCore or MagickWand?

You need a perspective transformation (aka distortion), of course.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Skew image as if viewed from the side

Post by fmw42 »

My better script is 3Drotate. But I do not know how to convert that to any of the APIs other than the command line. The basic IM command is +distort perspective.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Skew image as if viewed from the side

Post by dlemstra »

You could create an issue here https://github.com/dlemstra/FredsImageMagickScripts.NET and ask me to add this script.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
pmdpmd
Posts: 3
Joined: 2017-03-10T12:46:40-07:00
Authentication code: 1151

Re: Skew image as if viewed from the side

Post by pmdpmd »

Hi, I'm using Magick.NET-Q8-AnyCPU Nuget package 7.0.4.701

Thanks dlemstra, I will do that.
Post Reply