FFmpeg / imagemagick Cut image top and bottom

0

I am creating an image like this:

ffmpeg -i chapter_Border.jpg -vf scale=220x176 chapter_Border.jpg -y';

how can I cut 15.5px from the bottom and 15.5px from the top of the image so that the image has a height of 145px.

utdev

Posted 2017-04-07T09:02:35.873

Reputation: 159

Answers

0

Using imagemagick:

Get the size of the image:

identify img.jpg
# img.jpg JPEG 1024x768 1024x768+0+0 8-bit sRGB 29.2KB 0.000u 0:00.000

Crop a part of img.jpg and save it to new.jpg:

convert img.jpg -crop 220x145+0+16 new.jpg
# 220x145 is the new size. +0+16 is the X,Y position (upper left corner)

I don't think that half-pixels are possible.

Michael D.

Posted 2017-04-07T09:02:35.873

Reputation: 698

0

Using ffmpeg,

ffmpeg -i chapter_Border.jpg -vf scale=220x176,crop=iw:145 chapter_Border.jpg -y';

Gyan

Posted 2017-04-07T09:02:35.873

Reputation: 21 016