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!
Remove two surfaces of image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Remove two surfaces of image
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?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Remove two surfaces of image
convert UX8qK.png -crop 720x550+0+50 +repage x.png
snibgo's IM pages: im.snibgo.com
Re: Remove two surfaces of image
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.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?
Re: Remove two surfaces of image
This Works! Great!snibgo wrote:convert UX8qK.png -crop 720x550+0+50 +repage x.png
Do you know how to convert a whole folder? Thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Remove two surfaces of image
snibgo's command should do what you askYeah the areas are always the same, but not the same color,
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Remove two surfaces of image
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
Also see
http://www.imagemagick.org/Usage/crop/#crop_repage
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
http://www.imagemagick.org/Usage/crop/#crop_repage