Cropping multiple regions in different images

392 views4 repliesLast post: 7/30/2006
I'm using Photoshop CS (1).

I have a dozen or so screengrabs as BMPs - each 1280 x 1024 pixels in dimension.

Within each of these BMPs, in exactly the same place in all of them, is a smaller region about 300 x 200 pixels in size, at the same place in each X 900, Y 128.

I want to cut out all these regions in every BMP in an expedient way, but Crop doesn't seem to be too helpful - I have no idea exactly where the Crop origin is positioned, as the X and Y coordinates the Info window it shows are of the cursor, not the crop region. It shows the W and H fine though.

Ideally I would like a menu that allows me to type in the X origin, Y origin, width and height of a crop region, and and then the crop region would go to those settings.

But Crop only seems to allow me to type in Width and Height values, and not X origin and Y origin.

Any advice would be appreciated, and if I haven't explained my problem too well, apologies for that and let me know if anything needs clarifying.

Cheers, Miner2049er.
#1
Here is a script that I wrote that will make a new document from a selection. The zip file contains instructions for installing and
using this script.

http://www.ps-scripts.com/bb/viewtopic.php?t=30

You make a selection and then create a new document from that selection.

Larry
#2
Thanks for the reply, but it's not quite what I'm after, as it asks me to make a selection with the mouse.

I need something that presents four inputs to me - X-origin Y-origin Width Height - and then CREATES a selection.

Can anybody else assist?

Larry Scripts wrote:
Here is a script that I wrote that will make a new document from a selection. The zip file contains instructions for installing and
using this script.

http://www.ps-scripts.com/bb/viewtopic.php?t=30

You make a selection and then create a new document from that selection.
Larry
#3
Are you making only one selection? Do you want to process lots of images? Cut the selections out of the images and make new
documents out of them? What exactly are you doing - step by step?

I can write a script if you tell me step by step what you're doing!

Larry
#4
I need something that presents four inputs to me - X-origin Y-origin Width Height - and then CREATES a selection.

Your original post asked for help in cropping a known region from a set of images. Assuming that's what you actually want to do (as opposed to creating a selection, which appears to be what you've got sidetracked into) I'd recommend ImageMagick rather than Photoshop. It's free software for Win32, Mac and Unix:

http://www.imagemagick.org/

The command you're after is mogrify. e.g.:

mogrify -crop 100x200+0+0 image.jpg

crops the 100 by 200 pixel section from the top left corner of the image.

If you want to do that to all images in a directory, in Linux world you'd say:

for f in *.jpg ; do mogrify -crop 100x200+0+0 $f ; done

No doubt Windows users would know how to write a similar loop.

People do seem able to do stuff with Photoshop's scripting abilities, but it's always struck me as the hard way. ImageMagick has been designed from the ground up to be a scriptable set of cross platform image manipulation tools. It's great - well worth looking into!

--
<a href="http://www.derekfountain.org/">Derek Fountain</a> on the web at http://www.derekfountain.org/
#5