Help w/ uni-directional trimming / parameters
Posted: 2016-02-01T19:39:22-07:00
Hello,
I've tried to figure this out for a while without luck, so here we go. I'm using IM to trim/resize product images, which works beautifully when they're edited well. However, on natural backgrounds, it gets tricky. Here is what I use 90% of the time:
mogrify -trim -fuzz 15% -background white -gravity center -resize 800x800 -extent 800x800 *.jpg
When using this, however, on images with shadows, etc. I end up with hard lines between product and padding:
Original: https://s3-us-west-1.amazonaws.com/imma ... _Image.jpg
Edited (w/ above command): https://s3-us-west-1.amazonaws.com/imma ... _Image.jpg
In this case, I ideally want to trim to the largest aspect, in this case width, then resize to 800, then trim/pad the other dimension (vert in this case) to 800. Make sense?
In this ideal case, I keep the natural shadows in the vertical space while still trimming and resizing my image down to the target size. It would end up looking like this: https://s3-us-west-1.amazonaws.com/imma ... _image.jpg
Thanks in advance!
Ben
I've tried to figure this out for a while without luck, so here we go. I'm using IM to trim/resize product images, which works beautifully when they're edited well. However, on natural backgrounds, it gets tricky. Here is what I use 90% of the time:
mogrify -trim -fuzz 15% -background white -gravity center -resize 800x800 -extent 800x800 *.jpg
When using this, however, on images with shadows, etc. I end up with hard lines between product and padding:
Original: https://s3-us-west-1.amazonaws.com/imma ... _Image.jpg
Edited (w/ above command): https://s3-us-west-1.amazonaws.com/imma ... _Image.jpg
In this case, I ideally want to trim to the largest aspect, in this case width, then resize to 800, then trim/pad the other dimension (vert in this case) to 800. Make sense?
In this ideal case, I keep the natural shadows in the vertical space while still trimming and resizing my image down to the target size. It would end up looking like this: https://s3-us-west-1.amazonaws.com/imma ... _image.jpg
Thanks in advance!
Ben