I want to convert several jpg files into png files. As far as I know, one can use this command
mogrify -format png *.*
I have one problem, I have a lot of subfolders. Let's say a is my main folder and b,c and d are subfolders. The images are in the subfolders.
How can I convert all images without having to open every folder manually?
-> I would like to write a command that works, when I am in folder a, but works for all files in the subfolders.
Open Finder and select the images you want to convert. Open them in Preview and then Select All. Go to "File" and choose "Export Selected Images". Choose the export format as PNG.
In Windows, open JPG in Microsoft Paint, and click File > Save as > PNG > Save. In Photoshop (Windows or Mac), go to File > Save as > Save as type > PNG > Save. Or File > Export > Export As > PNG > Export. In Preview on Mac, select File > Export > Export As > Format > PNG > Save.
First, you need to open an image in GIMP by clicking on the File then Open. Now, complete the editing and go to the “Export as” option under the File section, or use the “Shift,CTRL and E” as shortcut keys. After that, select the file type to convert the image into your desired format, which is PNG in this topic.
png file, you can just rename image. png to image. jpeg or image. gif , and it automatically gets converted to the other format and works perfectly fine.
Assuming you're in folder a the following might work for you
find . -name "*.jpg" -exec mogrify -format png {} \;
You can use the find command to get all the jpg files in all the subfolders and pass your command as an argument to find
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With