Reversed Bilinear Distortion + Crop

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
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Reversed Bilinear Distortion + Crop

Post by GreenKoopa »

Welcome. Please share the exact command you tried. Before and after images may also help.

In that usage example, the input and output canvas sizes are the same. Is this what you are seeing, and what you want?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Reversed Bilinear Distortion + Crop

Post by fmw42 »

Also post your IM version and platform
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Reversed Bilinear Distortion + Crop

Post by fmw42 »

User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Reversed Bilinear Distortion + Crop

Post by GreenKoopa »

etb972 wrote:the problem is that my image is not croped.. and has not the good size !
I'm not clear on your meaning. Do you know about the viewport setting of -distort ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Reversed Bilinear Distortion + Crop

Post by snibgo »

I would use distort perspective for this. To avoid unnecessary processing, I'd start with an approximate crop. Windows scripts:

Code: Select all

convert 807434source.jpg ^
  -crop 1500x2400+1400+200 ^
  +repage ^
  p0.png
The corners of the posters have approximate coordinates:

58,208
1384,65
1366,2379
50,2243

I would shift these points to the corners of a rectangle that contains them:

58,208 58,65
1384,65 1384,65
1366,2379 1384,2379
50,2243 58,2379

So we have:

Code: Select all

convert 807434source.jpg ^
  -crop 1500x2400+1400+200 ^
  +repage ^
  -distort perspective "58,208 58,65 1384,65 1384,65 1366,2379 1384,2379 50,2243 58,2379" ^
  p1.png
You can now crop this down to the poster and resize, if you want.
snibgo's IM pages: im.snibgo.com
Post Reply