4 ms·
I think the script to apply it to a folder could be clear with: for image in *.jpg ; do gm convert $image -resize "900x" -unsharp 2x0.5+0.5+0 -quality 98 `base
by cientifico 13y ago
I think the script to apply it to a folder could be clear with:
for image in *.jpg ; do gm convert $image -resize "900x" -unsharp 2x0.5+0.5+0 -quality 98 `basename $image .jpg`_s.jpg ; done
- fragmede 13y agoThe script on the linked page deals with filenames with spaces while that for loop does not. Neither of them deal with filenames with \n in them, eg 'pretty sunset.jpg' For that, you'll want to run find: find . -name '*.jpg' -exec convert '{}' -resize "900x" -unsharp 2x0.5+0.5+0 -quality 98 `basename '{}' .jpg`_s.jpg \;
- hnha 13y agoimagemagick/graphicsmagick comes with a batch tool called mogrify. no need for scripting.