Page 1 of 1

Trim one border

Posted: 2006-08-02T04:49:14-07:00
by vav
How can I trim only one border?

Posted: 2006-08-02T07:28:05-07:00
by magick
ImageMagick does not have an option to trim one border. You could certainly use the ImageMagick API to access the pixels and trim one border.

Posted: 2006-08-03T17:06:28-07:00
by glennrp
Add a 1-pixel thick black row or column opposite the side you want to trim, then add a 1-pixel thick white row or column next to it. Run "convert" with the -trim option. This will trim the desired side and will also remove the white row/column, but won't remove anything from the sides. Then remove the black row/column.

Posted: 2006-08-07T20:18:50-07:00
by anthony
To trim one broder, your want to -chop it!

See IM Examples...
http://www.cit.gu.edu.au/~anthony/graph ... crop/#chop

The solution GlenRP provided is of corse valid, but a round-about way of doing the same thing.

Posted: 2006-08-08T07:36:33-07:00
by glennrp
It's not the same. "-trim" and my solution remove a variable number of rows or columns that contain all the same color pixels. "-chop" or "-crop" (and "-shave") remove a specified number of rows. ../GlennRP

Posted: 2006-08-08T18:28:34-07:00
by anthony
I stand corrected. I'll see about adding an example for this.
Done
http://www.cit.gu.edu.au/~anthony/graph ... im_oneside