[Solved] Autocrop photographed Postcards (black border)
Posted: 2016-12-21T02:29:42-07:00
Hi!
I’ve got a bunch (>1000) Canon RAW Files (*.CR2) of photograped postcards. The Postcards are all photograped in the same fashion and not 100% straight and have a bigger or smaller black border around them. Here is an sample file: https://cloudup.com/cuU67sTBe5P
My workflow now looks like this: Import RAW Files into Lightroom, crop & roate the image and apply minor enhancements, then export to tiff.
I’ve tried to use ImageMagick to automatically identify the size of the black border and crop the image to get rid of it, with mixed success.
I’ve been using Fred’s unrotate (http://www.fmwconcepts.com/imagemagick/ ... /index.php) and autotrim (http://www.fmwconcepts.com/imagemagick/autotrim/) scripts after I converted from RAW to tiff because I figured that IM can’t write or alter RAW files. So, using and then does not always work the way I want. Also, the TIFFs are about five times the size of the RAWs which I understand is normal.
How would you tackle this particular problem? I was thinking that there has to be a simple, automated solution for something like this, is there not?
Thanks for your help and consideration, I’ve been learning quite a lot about IM as a frequent reader of this forum.
---
I’m using IM on a MBPr 10.11
That’s info on the RAW files:
I’ve got a bunch (>1000) Canon RAW Files (*.CR2) of photograped postcards. The Postcards are all photograped in the same fashion and not 100% straight and have a bigger or smaller black border around them. Here is an sample file: https://cloudup.com/cuU67sTBe5P
My workflow now looks like this: Import RAW Files into Lightroom, crop & roate the image and apply minor enhancements, then export to tiff.
I’ve tried to use ImageMagick to automatically identify the size of the black border and crop the image to get rid of it, with mixed success.
I’ve been using Fred’s unrotate (http://www.fmwconcepts.com/imagemagick/ ... /index.php) and autotrim (http://www.fmwconcepts.com/imagemagick/autotrim/) scripts after I converted from RAW to tiff because I figured that IM can’t write or alter RAW files. So, using
Code: Select all
convert rawfile.CR2 tifffile.tif
Code: Select all
unrotate -f 5 tifffile.tif unrotatedtiff.tiff
How would you tackle this particular problem? I was thinking that there has to be a simple, automated solution for something like this, is there not?
Thanks for your help and consideration, I’ve been learning quite a lot about IM as a frequent reader of this forum.
---
I’m using IM on a MBPr 10.11
Code: Select all
identify -version
Version: ImageMagick 6.9.7-0 Q16 x86_64 2016-12-18
http://www.imagemagick.org
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
Code: Select all
identify os_ub_0004379.CR2
os_ub_0004379.CR2=>/var/tmp/magick-13136Hhig0CYSQFOH.png CR2 5496x3670 5496x3670+0+0 16-bit sRGB 105.8MB 0.010u 0:00.009