H
H
hard_o2020-01-28 12:19:31
Images
hard_o, 2020-01-28 12:19:31

How to convert many images to next-gen formats?

There are many folders with pictures.
You need a program that would recursively go through them and convert them to JPEG 2000, JPEG XR, or WebP.
Linux, Windows, MacOS - whatever

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Arkhipov, 2020-01-28
@hard_o

XnConvert can recursively pass through folders, and it supports quite a lot of formats.

S
SOTVM, 2020-01-28
@sotvm

yes, at least find + ffmpeg

find \( -iname \*.png -o -iname \*.jpg -o -iname \*.gif -o -iname \*.jpeg \) -type f -exec ffmpeg -i {} {}.webp \;

ps
through the regular expression -iregex ".*\(\.jpeg\|\.jpg\|\.png\|\.gif\)" will be shorter
in ffmpeg the -y switch allows overwriting the file (if it already exists with the same name)
find -iregex ".*\(\.jpeg\|\.jpg\|\.png\|\.gif\)" -type f -exec ffmpeg -y -i {} {}.webp \;

if you need additional conversion options - smoke man ffmpeg (or see the info on the official site)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question