I use convert and mogrify to convert and mogrify images all the time. The syntax is
Code:
convert pic.jpg newoutputfilename.png
What I want to do is take a whole directory full of tiffs, and convert them to jpgs, with the same filename except for the .xyz. In order to do this, I think I need to do a "foreach".
I've done scripts like this before:
Code:
for pic in `ls *.jpg`;
do mogrify -modulate 100,0 -normalize -unsharp 15 -fuzz 50% -trim $pic;
done;
And it has been known to work. But how can I use this with convert? It seems that I need to somehow subtract "jpg" from each filename and append "tif" to form the new output filename, but I don't know how to manipulate strings with bash.