Page 1 of 1

Crop HD Frames in Half

Posted: 2010-11-16T23:41:07-07:00
by bydersjoint
Hi All,
This is a really weird thing I am getting.

I have an HD frame of 1920x1080 and want to process it twice... once giving me the top 540pixels and the command '-crop 1920x540+0+0' works perfectly for this, but the minute I try to crop the top half out leaving me with the lower portion of the image using '-crop 1920x540+0+540' I simply get black frames returned.

My process doesn't end there though, I perform a -resize and then another -crop after the initial crop (above) and then place the result in the center of a larger frame using '-background black -gravity Center -extent 2048x1080'

Could the '-gravity Center' that comes 4 commands after the 540pixel crop be affecting its usage?!

Thanks,
Chris

Re: Crop HD Frames in Half

Posted: 2010-11-17T09:31:25-07:00
by GreenKoopa
I don't immediately see anything helpful. No, a setting after should not affect a command from before. Settings before, even ones intended for another operation (even when in parentheses) will. Is the black frame the correct size? It would be helpful if you could provide the shortest example that has the unexpected behavior.

Re: Crop HD Frames in Half

Posted: 2010-11-17T10:34:28-07:00
by Bonzo
My process doesn't end there though, I perform a -resize and then another -crop after the initial crop (above) and then place the result in the center of a larger frame using '-background black -gravity Center -extent 2048x1080'
Why not check the resulting images after each process to find where the problem occures ?

Your full code would be useful to see.

Re: Crop HD Frames in Half

Posted: 2010-11-17T11:27:53-07:00
by fmw42
your input image may already have a virtual canvas with an offset.

try

convert image +repage -crop ... +repage result

see http://www.imagemagick.org/Usage/crop/#crop_repage