Convert images which have the same names but different extensions
Posted: 2017-05-31T05:18:11-07:00
For example, I have two files:
As you can see, images are different, despite of their names, which are the same.
I want to convert both these images to one single format.
The basic attempt for this task is
But it doesn't work, for obvious reasons (one folder cannot contain multiple files with the same name and extension).
Also, some notes from myself.
a) Please note, this is just example. In real life, it would be about 100-200 images.
b) From my point of view, there seems to exist at least 2 ways to fix this issue: add a timestamp to filename **OR** add random text. I think random text will be better because timestamps sometimes could be equal (if processing is very fast).
So, what do you suggest for this task, and how it could be done? Thanks.
Code: Select all
aaa.jpg (with cat)
aaa.png (with dog)
I want to convert both these images to one single format.
The basic attempt for this task is
Code: Select all
mogrify -format jpg *.png
Also, some notes from myself.
a) Please note, this is just example. In real life, it would be about 100-200 images.
b) From my point of view, there seems to exist at least 2 ways to fix this issue: add a timestamp to filename **OR** add random text. I think random text will be better because timestamps sometimes could be equal (if processing is very fast).
So, what do you suggest for this task, and how it could be done? Thanks.