Skip to main content

Removing letterboxing from a video screenshot with ImageMagick

Using -trim will remove the black portions and leave you the unletterboxed image.

I was doing some work today with screenshots of a video that had black “letterboxing” bars around it. If you use convert [input] -trim [output], you can remove this with ImageMagick.

If the bars aren’t pure black, you can add -fuzz 10% to pick up dark greys also.

Original file, from Wikimedia Commons

convert Windowboxed.jpg -trim Unboxed.jpg
convert Windowboxed.jpg -fuzz 10% -trim Unboxed.jpg