I have hundreds of images in a folder of size 1920x~100,000. I need to cut out the middle 900p of every file leaving the height unaffected. how do I pass each file to this command? magick convert image.jpg -crop 900x+510+0 result.jpg
            Asked
            
        
        
            Active
            
        
            Viewed 718 times
        
    0
            
            
         
    
    
        guppiegreenf35
        
- 3
- 1
2 Answers
1
            
            
        Two options:
- use mogrifyinstead ofconvertto replace the image with the result
- Let IM deduce the output file from the input fil:
convert *.jpg -crop 900x+510+0 -set filename:base "%[basename]" "%[filename:base]-cropped.jpg"
(or use a similar idiom to target a different directory)
 
    
    
        xenoid
        
- 8,396
- 3
- 23
- 49
0
            
            
        @echo off
setlocal
md "destinationdirectory" 2>nul
pushd "sourcedirectory"
for %%e in (*.jpg) do magick convert "%%e" -crop 900x+510+0 "destinationdirectory\%%e"
popd
simply substitute your directory names for sourcedirectory and destinationdirectory - and they can't be the same directory.
 
    
    
        Magoo
        
- 77,302
- 8
- 62
- 84