Cropping a single row of pixels with ImageMagick


I can never remember the syntax for cropping a single row of pixels using ImageMagick, hence the title of the post where I elude to the fact I want to crop a single row of pixels with ImageMagick.

For a row:

$ magick convert $INPUT -chop 0x1 +repage $OUTPUT

For a column:

$ magick convert $INPUT -chop 1x0 +repage $OUTPUT

I probably keep forgetting because I want -crop, not -chop.

While I’m here, thanks to the ImageMagick team for their amazing toolkit, and kwm@ and adam@ for maintaining the FreeBSD Port and pkgsrc packages!

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person in bios. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.