batch resize + crop product images to ratio for ecommerce
Posted: 2016-11-30T16:07:02-07:00
I have taken 2900 pictures of shoes and bags for my ecommerce site (not live yet). I'm new at this and used my phone (Nexus 5x) and a lightbox with proper lighting. The quality of the images are fine. But I haven't been able to always keep the tripod, not the object in exactly the same place each time. So sometimes the object is a little but further in the distance or closer to the camera. Sometimes it's more to the left or right, or the tripod was facing a bit more down or up.
Usually it's hardly noticeable but I'm mentioning it in case it is of importance.
The container of the image on the site is 247x300 (catalog) and 510x600 (product page) (defined by theme). I made sure woocommerce uses double those values for people who have retina screens. This doesn't affect the image in any way. The image I will upload must be at least the twice the largest size, so 1020x1200
Now comes the problem. I have a lot of white space around the objects in the images. Those need to go away. I want the object (shoe, boot, bag, wallet, etc) to be centered in the canvas with no white space on the left and right side. The white space on the top and bottom can be variable depending on the height of the object.
Example: http://imgur.com/a/r9L8j
Here you can see that regardless the height and width of the object, all images fit in the canvas. The dimension of the image are the same for all.
Original dimensions: 4032x3024
Required dimension: 1020*1200 with object resized and centered vertically and no whitespace on left/right sides.
If anyone can help me out I'd greatly appreciate it. I've been smashing my head against the wall for a month now and it's the only thing keeping me from finishing this project.
Usually it's hardly noticeable but I'm mentioning it in case it is of importance.
The container of the image on the site is 247x300 (catalog) and 510x600 (product page) (defined by theme). I made sure woocommerce uses double those values for people who have retina screens. This doesn't affect the image in any way. The image I will upload must be at least the twice the largest size, so 1020x1200
Now comes the problem. I have a lot of white space around the objects in the images. Those need to go away. I want the object (shoe, boot, bag, wallet, etc) to be centered in the canvas with no white space on the left and right side. The white space on the top and bottom can be variable depending on the height of the object.
Example: http://imgur.com/a/r9L8j
Here you can see that regardless the height and width of the object, all images fit in the canvas. The dimension of the image are the same for all.
Original dimensions: 4032x3024
Required dimension: 1020*1200 with object resized and centered vertically and no whitespace on left/right sides.
If anyone can help me out I'd greatly appreciate it. I've been smashing my head against the wall for a month now and it's the only thing keeping me from finishing this project.