Batch Processing Millions and Millions of Images
codeascraft.etsy.com
Batch Processing Millions and Millions of Images
1–10 of 23 posts
Re: Batch Processing Millions and Millions of Images
#2Our problem was that we were making a composite image but sometimes the 'background' image content was shifted to the left or right. (e.g. All images were the same size with a white background but some were made from different source template and so the actual content sometimes started at pixel 25 and other times at pixel 35.) To make it worse they were all JPEGS.
I ended up writing a program to find the bounding box of the content (with a fudge factor to account for the JPEG dithering) and identified the bad images to be fixed by hand. It was a nice diversion from SQL and ASP.
Re: Batch Processing Millions and Millions of Images
#3Several years ago I had to do something similar (10 of thousands instead of millions though). Our problem was that we were making a composite image but sometimes the 'background' image content was shifted to the left or right. (e.g. All images were the same size with a white background but some were made from different source template and so the actual content sometimes started at pixel 25 and other times at pixel 35…
Re: Batch Processing Millions and Millions of Images
#4Several years ago I had to do something similar (10 of thousands instead of millions though). Our problem was that we were making a composite image but sometimes the 'background' image content was shifted to the left or right. (e.g. All images were the same size with a white background but some were made from different source template and so the actual content sometimes started at pixel 25 and other times at pixel 35…
What tools did you use and how long did it take?
Re: Batch Processing Millions and Millions of Images
#5Earlier quoted context omitted.
What tools did you use and how long did it take?
This was in 2002 and I used Python with the PIL module. It didn't really take all that long, less than a day for the whole project. Probably 2-3 hours of run time on my desktop. I wasn't actually doing anything but identifying the bad images so I wasn't pounding the disk with alternating reads/writes.
It links directly with libjpeg, libpng, etc. instead of via some imagemagick bullshit. Instead of being fucked if what you want to do doesn't line up with an existing magick command, it gives you the tools to do it yourself, and even pretty performantly since it can give you numpy arrays.
Re: Batch Processing Millions and Millions of Images
#6One thing I'm skeptical about:
"We found out, almost by accident, that using the previously down-sized “large” images resulted in better quality and faster processing than starting with the original full-size images."
Obviously, the processing speed will be faster with a down-sized image, but I can't see how starting with a smaller image will give you better quality. Unless the original image was so large that downsizing caused a lot of detail loss (in which case the image should have been sharpened).
Re: Batch Processing Millions and Millions of Images
#7Re: Batch Processing Millions and Millions of Images
#8Re: Batch Processing Millions and Millions of Images
#9Good, detailed post. I just did about 250K images using ImageMagick and a shell script. It was across 3 boxes and I noticed quite a performance difference between an older and newer version of IM. It could have been another factor, I suppose. One thing I'm skeptical about: "We found out, almost by accident, that using the previously down-sized “large” images resulted in better quality and faster processing than start…