views:

224

answers:

1

I need to be able to determine if a part of an image (outside of predetermined crop marks) contains any image content.

Is there a way with ImageMagick (specifically the php interface) to do this?

Scenario: The canvas is 8.5x11 with .5 in margins on the top, left, and bottom edges and a 1 in margin on the right edge. The image needs to fit within the crop marks for printing.

Normally I use Photoshop actions to do this, but I am trying to automate the process.

+1  A: 

Replace everything within crop marks with black/white rectangle, do a histogram of the resulting image and analyze it?

I can do this with command-line version of ImageMagick, but dont know how to express it with PHP api.

ADEpt