[solved] Batch convert images so they are all JPG with minimal loss of data
Posted: 2016-12-22T17:39:06-07:00
I have a big folder of images (jpg, png, tif, etc.)
I need to convert all of them so they are all JPGs.
I am writing a script that checks the image extension and converts to JPG only if not already a JPG format.
Questions:
1. If the file extension is .jpeg, .jif, .jfif, can I just change the file name extension to ".jpg" without converting (note that I will be skipping files that already end in ".jpg")?
2. When converting, I want to avoid loss of quality (at least, keep it to a minimum - I understand how jpg compression works); with that said, what would be the best command to do the conversion on a lot of unknown file types?
I was hoping that this would do the trick (because it's simple):
convert input.png output.jpg
Will that retain as much of the original image's settings as possible (i.e., resolution, quality, etc.)?
I did a quick test on a JPG:
https://www.diffchecker.com/ERYIXm64
Interestingly, the changes look minimal.
Basically, I want to convert to JPG without changing, or changing only a minimal amount, of the original image as possible.
Thanks in advance!!!
I need to convert all of them so they are all JPGs.
I am writing a script that checks the image extension and converts to JPG only if not already a JPG format.
Questions:
1. If the file extension is .jpeg, .jif, .jfif, can I just change the file name extension to ".jpg" without converting (note that I will be skipping files that already end in ".jpg")?
2. When converting, I want to avoid loss of quality (at least, keep it to a minimum - I understand how jpg compression works); with that said, what would be the best command to do the conversion on a lot of unknown file types?
I was hoping that this would do the trick (because it's simple):
convert input.png output.jpg
Will that retain as much of the original image's settings as possible (i.e., resolution, quality, etc.)?
I did a quick test on a JPG:
https://www.diffchecker.com/ERYIXm64
Interestingly, the changes look minimal.
Basically, I want to convert to JPG without changing, or changing only a minimal amount, of the original image as possible.
Thanks in advance!!!