I want to 'optimize' all my *.png images and found this so I made the bash as it says with:
#!/bin/bash
pngnq -vf -s1 *.png
rename -f 's/-nq8.png$/.png/' *.png
optipng -o7 *.png
And here I have 2 problems:
The first one is that the second line (rename) does nothing... it is supposed to change all the images named [name]-nq8.png
which is the result of the first line of the bash to the original name
The second and main problem is: I have a folder named ImagesFolder and inside I have other folders with more *.pngs and I want to run this bash in every subfolder of ImagesFolder but I don't know how to do it (I'm new in unix and shellscripts and so on) and what I tried didn't work or was a mess...
To understand it better what I have is something like:
ImagesFolder
|-Folder1
| |- Folder12
| | |-20 images here
| |- Folder13
| | |- 10 images more here
| |- 5 images here
|-more images
And I want the script to run from ImagesFolder
Thank you so much!