Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version Search this Thread
09-08-2008, 03:33 PM   #1
Forum Member




Join Date: Aug 2008
Location: Dallas
Posts: 98
Auto-batch-cropping photos

I have a digital picture frame, and I want to display pictures on it, but it's a 4:3 ratio screen. 35mm photos aren't, unless they are cropped. This results in letterboxing.

I'm normally not much of a cropper but I figure photos normally get cropped when they get framed in normal picture frames, so I wanted to try cropping them, but there's no way I'm doing them all in Gimp, or something. Digikam allows me to batch-resize images to 1024x768, but that actually morphs the pictures rather than auto-cropping them, and that usually doesn't look good. Any other suggestions for linuxy auto-cropping tools? I tried imagemagick, but it doesn't seem to work for example, neither of these commands works, although they result in an output file, it's identical to the input file.


Code:
convert -resize 1024x768 img001.jpg bler4g.jpg
Code:
convert -size 1024x768 img001.jpg bler4g.jpg


09-08-2008, 04:00 PM   #2
Veteran Member




Join Date: Nov 2007
Posts: 1,553
QuoteOriginally posted by BetterSense Quote
Code:
convert -resize 1024x768 img001.jpg bler4g.jpg
I think you need the bang key option for it work the way you want.

Code:
convert -size 1024x768 ! img001.jpg bler4g.jpg
Thank you
Russell
09-08-2008, 08:29 PM   #3
Veteran Member
troyz's Avatar

Join Date: May 2008
Posts: 389
QuoteOriginally posted by BetterSense Quote
I have a digital picture frame, and I want to display pictures on it, but it's a 4:3 ratio screen. 35mm photos aren't, unless they are cropped. This results in letterboxing.

...

tried imagemagick, but it doesn't seem to work for example, neither of these commands works, although they result in an output file, it's identical to the input file.


Code:
convert -resize 1024x768 img001.jpg bler4g.jpg
Code:
convert -size 1024x768 img001.jpg bler4g.jpg
Try using the -crop operator (here I'm assuming input.jpg is 3:2):

Code:
convert input.jpg -resize 1152x768 -gravity Center -crop 1024x768+0+0 output.jpg
09-08-2008, 08:44 PM   #4
Veteran Member
Venturi's Avatar

Join Date: Mar 2008
Location: Tulsa, OK
Photos: Gallery
Posts: 2,636
Beat me to it.

Note that in Troyz' example he used -resize 1152x768 to shrink the original to the right height before cropping. Doing this ensures that the crop only trims the sides of the image. Without that depending on the size of the source file you could end up with just a person's nose for the cropped image.

09-09-2008, 08:46 AM   #5
Forum Member




Join Date: Aug 2008
Location: Dallas
Posts: 98
Original Poster
QuoteQuote:
(here I'm assuming input.jpg is 3:2)
Well they are 35mm scans usually from Target Picture CDs. Is that 3:2?

Code:
-crop 1024x768+0+0
what are the 0's for? I tried telling it to crop 1024x768 but I ended up with like 13 different output files of random crops from the original image. The manpage just said '-crop geometry', it was nonspecific as to the 'geometry' syntax.

Also what does the -gravity Center do?
09-09-2008, 09:52 AM   #6
Veteran Member
troyz's Avatar

Join Date: May 2008
Posts: 389
QuoteOriginally posted by BetterSense Quote
Well they are 35mm scans usually from Target Picture CDs. Is that 3:2?

Code:
-crop 1024x768+0+0
what are the 0's for? I tried telling it to crop 1024x768 but I ended up with like 13 different output files of random crops from the original image. The manpage just said '-crop geometry', it was nonspecific as to the 'geometry' syntax.

Also what does the -gravity Center do?
Sorry convert isn't working for you yet. Were you trying individual filenames or wildcarded filenames ("dscn*.jpg")? For wildcards you should try the mogrify command

ImageMagick: Command-line Tools: Mogrify

instead of convert.

I would expect photo CD scans from 35mm film to be approximately 3:2; you'll have to check your images to be sure.

The geometry syntax is widthxheight+x-offset+y-offset
"-gravity Center" specifies that the crop area is to be centered

The syntax for ImageMagick command line options is described at
ImageMagick: Command-line Options

I agree that the syntax is somewhat arcane; the command I posted worked when I tried it, but it may not work if you change the order and capitalization of the arguments.

You may wish to check
Code:
 convert -version
I'm using 6.4.something; it's possible that older versions may choke on the -gravity argument
09-09-2008, 11:29 PM   #7
Loyal Site Supporter
Loyal Site Supporter
sabarrett's Avatar

Join Date: Jan 2008
Location: Michigan
Photos: Gallery
Posts: 270
Here is another nice utility that may work for this application. I use it to resize for a couple of pocket size digital frames. It works well, has many command line options for dimensions or quality and can be assigned to an icon so you can just drag files to it and they are resized.

Batch Picture Resize

edit: Sorry, I missed the original reference to linux. This won't work for you.


Last edited by sabarrett; 09-09-2008 at 11:31 PM. Reason: oops
09-13-2008, 01:05 AM   #8
Forum Member




Join Date: Jun 2007
Location: Oman - Muscat
Photos: Albums
Posts: 57
Bettersense,

give a try to XNVIEW freeware (working on several OS). I use it for several years on windows (there is a linux version) does pretty much anything you need to do on a picture when is in jpeg (will give you acces to pef preview as well)

Click on the link below:
XnView

in windows:
goto "tools", "batch convert", two tabs, first one to select input/output directory (always use a different output directory....) then second tab for the transformation. Choose whatever transformations you need to apply
11-25-2012, 11:20 AM   #9
New Member




Join Date: Nov 2012
Posts: 1
photo cropper bulk

ol' thread i know, but i solve ths problem few months ago, i do not know any freeware that can do that efficiently,
but there is a nice little software tool (compatible with wine too) that is called Photo Cropper
the only one i am aware of that works as a batch cropper and exclusively for that, but if i remember correctly it supports also some format conversion, anyway try it there should be a free trial somewhere
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
photography, photos, photoshop, picture, pictures

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Process for Scanned Photos Waldo Digital Processing, Software, and Printing 1 09-27-2010 08:07 AM
First batch of photos w/ new K10D paden501 Post Your Photos! 3 02-01-2008 04:36 PM
My first batch of photos with my K10D. triplej96 Post Your Photos! 10 12-03-2007 01:26 PM
Cropping by mm regken Pentax DSLR Discussion 3 01-11-2007 11:10 PM



All times are GMT -7. The time now is 12:38 AM. | See also: NikonForums.com, CanonForums.com part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top