Page 1 of 1

Remove two surfaces of image

Posted: 2015-06-29T10:57:35-07:00
by Thom
Hello,

I have 300+ images of the same format below, and I want to remove the grey surfaces of the picture, so the final image need to be the blue surface with the measurements of 720x550 px.

Can someone help me with a commandline script to do that.
All the images are in the same folder.

Thanks in advange!

Image

Re: Remove two surfaces of image

Posted: 2015-06-29T11:22:26-07:00
by fmw42
Are the gray and blue areas always the same size and color? Are they always labeled with the sizes? What version of IM are you using (convert -version) and what platform?

Re: Remove two surfaces of image

Posted: 2015-06-29T11:23:20-07:00
by snibgo
convert UX8qK.png -crop 720x550+0+50 +repage x.png

Re: Remove two surfaces of image

Posted: 2015-06-29T11:32:16-07:00
by Thom
fmw42 wrote:Are the gray and blue areas always the same size and color? Are they always labeled with the sizes? What version of IM are you using (convert -version) and what platform?
Yeah the areas are always the same, but not the same color, but I make it in the drawing so to simplify my question. I am using version "6.9.1--6 Q16" And I am running Windows 8.

Re: Remove two surfaces of image

Posted: 2015-06-29T11:42:30-07:00
by snibgo
Does my command do the job?

Re: Remove two surfaces of image

Posted: 2015-06-29T11:43:14-07:00
by Thom
snibgo wrote:convert UX8qK.png -crop 720x550+0+50 +repage x.png
This Works! Great!

Do you know how to convert a whole folder? Thanks!

Re: Remove two surfaces of image

Posted: 2015-06-29T11:44:08-07:00
by fmw42
Yeah the areas are always the same, but not the same color,
snibgo's command should do what you ask

Re: Remove two surfaces of image

Posted: 2015-06-29T12:15:30-07:00
by fmw42
see mogrify at http://www.imagemagick.org/Usage/basics/#mogrify

create a new empty directory, so that you do not write over your existing files, for example test2. Assuming your images are in test1, then

Code: Select all

cd test1
mogrify -path pathto/test2 -format png -crop 720x550+0+50 +repage *.png
Also see
http://www.imagemagick.org/Usage/crop/#crop_repage