Page 1 of 1

Pixel aspect ratio correction

Posted: 2009-07-14T02:59:54-07:00
by rolikoff
Everybody should know the Photoshop's PAR correction. Does anybody know do imagemagick has the same feature (command-line) or not?
Thank you, Dmitry.

Re: Pixel aspect ratio correction

Posted: 2009-07-14T15:36:41-07:00
by fmw42
Not everybody has or uses Photoshop or is even familiar with pixel aspect ratios.

Nevertheless, this is only important if you want to convert between digital still images or digital images for video. Still images generally use square pixels. Digital video uses non-square pixels, typically with aspect ratios of 4:3, 3:2 or 2:1. These happen to match the dimensions and image aspect ratios of some cameras (presumably so that the digital video is square). A good article is at http://www.videouniversity.com/articles ... and-tricks.

First, I don't think that IM has the ability to recognize pixel aspect ratios in the headers of files. I could be wrong. I also don't think it can automatically change the pixel aspect ratio for you.

However, if you know the pixel aspect ratio and want to change it from square to that aspect ratio or go the other way, then all you need to do is create a new image whose size is changed by that aspect ratio. So for example if you want to go from square to 3:2 aspect ratio, then

convert squareimage.jpg -resize 150% rectangularimage.jpg

where 3:2 is equivalent to 3/2=1.5 or 150%

Re: Pixel aspect ratio correction

Posted: 2009-07-17T18:25:37-07:00
by anthony
Fred you need the \! flag for aspect ratio changes...

Code: Select all

  -resize 150x100%\!

Re: Pixel aspect ratio correction

Posted: 2009-07-18T08:42:01-07:00
by fmw42
anthony wrote:Fred you need the \! flag for aspect ratio changes...

Code: Select all

  -resize 150x100%\!

Right and I also forgot the other dimension. Your formula is correct.