Rotated Crop Rectangle

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
spammy63
Posts: 12
Joined: 2016-02-26T02:20:29-07:00
Authentication code: 1151

Rotated Crop Rectangle

Post by spammy63 »

Hi all,
any glue how to create a crop geometry to get exactly cut these selected rotated area from a real huge image ito a new one ?
I have all exact pixel positions for x, y, height, width and angle of that red crop area.
As the unrotated crop is no problem, I found no tips so far how to cut a rotated crop area from images.
Rotate the huge image first and then crop seems to be too slow for my application.
Many thanks for any tip in advance ...

Chris

(Do you see that image?)->
Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Rotated Crop Rectangle

Post by snibgo »

(Do you see that image?)
No.
snibgo's IM pages: im.snibgo.com
spammy63
Posts: 12
Joined: 2016-02-26T02:20:29-07:00
Authentication code: 1151

Re: Rotated Crop Rectangle

Post by spammy63 »

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

Re: Rotated Crop Rectangle

Post by snibgo »

You need to rotate sometime. You could either:

1. rotate the main image, then crop, OR

2. crop the main image down to the outer-limits of the rotated rectangle, then rotate the result, then crop that again.
snibgo's IM pages: im.snibgo.com
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Rotated Crop Rectangle

Post by anthony »

Or if you want the results unrotated, fill the outline and use it as a mask!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
spammy63
Posts: 12
Joined: 2016-02-26T02:20:29-07:00
Authentication code: 1151

Re: Rotated Crop Rectangle

Post by spammy63 »

Many Thanks Anthony ... I used option 2 (crop-rotate-crop).
Post Reply