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.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityUsing 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.
Using ffmpeg,
ffmpeg -i chapter_Border.jpg -vf scale=220x176,crop=iw:145 chapter_Border.jpg -y
-q
value e.g. -q:v 1