Remove white background and resize
Posted: 2010-04-27T22:09:15-07:00
I'm fairly new to ImageMagick, but have used some of the command line tool/options to do basic stuff.
I've got a lot of images that have varying amounts of white background (photos of commercial products). I'd like to make the image sizes consistent, which probably isn't too hard. But ideally what I would like to do is remove the white background, then resize the image so that the image is enlarged as much as possible to fit within a given constraint and isn't affected by the background.
In other words, suppose the image is actually 25% white border/background. I'd like to resize that inner 75%, so that the scaled image has no boarder, making the processed image as large as possible given the size constraints, and not wasting image area on borders. Is that possible?
I've got a lot of images that have varying amounts of white background (photos of commercial products). I'd like to make the image sizes consistent, which probably isn't too hard. But ideally what I would like to do is remove the white background, then resize the image so that the image is enlarged as much as possible to fit within a given constraint and isn't affected by the background.
In other words, suppose the image is actually 25% white border/background. I'd like to resize that inner 75%, so that the scaled image has no boarder, making the processed image as large as possible given the size constraints, and not wasting image area on borders. Is that possible?