Is it possible to convert or export a lot of HVIFs to other formats at once, such as SVG or PNG? AFAIK I-o-M can export HVIF to other formats, but that would require doing that with every file individually.
Could scipt it i would think
Scripting I-o-M or something else?
You might be able to use the “hey” command with Icon-o-Matic and just generate the scripts with output redirection of the “ls” command of the Bash prompt.
I test I-O-M with hey, but it seems that I-O-M has no scripting support, because i test I-O-M with -v or something else. there is no output. it starts only I-O-M.
translate lovely_icon.hvif exported.png PNG
You can of course run translate in a bash loop with your files, pass it to
find or use whatever other trickery you are used to when processing a lot of files.
There’s no SVG exporter that I know of, though. I think there was a thread about why while possible, it would be too much work or something.
It is a lot of work, but not necessarily too much work (otherwise we would have not done anything for Haiku because the whole project is “too much work”).
Making an ad-hoc translator to convert HVIF to/from SVG isn’t so hard. It’s only a matter of extracting the relevant code from Icon-O-Matic, and putting it in a translator.
What can be more complicated is making a generic system to translate any vector graphics format into any other (like we have for bitmap/raster formats). But we can see about that later.
Also for completeness, there is an experimental Rust implementation of HVIF parsing and rendering now: HVIF parser and renderer It’s still not working perfectly and icons will not render exactly the same as in Haiku. But if you’re looking for a way to do this on a non-Haiku system, it’s one possible starting point.
Not sure where I put it but I once wrote a script to make an image showing all the icons in the repo…
Ah yes, here it is, and it’s using translate + ImageMagick.
This certainly looks promising! Is this also possible with exporting/converting HVIF to SVG?
I think Pulkomandy said that it isn’t currently possible. Haiku lacks a translator for that format.
I wrote a tool
hvif2png.cpp which is in the source tree and is a small command line program to render HVIF to PNG. It’s actually used by the HDS system to render HVIF for display on the web site. It would a very easy task to use this tool together with
bash to bulk render a number of HVIF files as PNG. This runs on Linux as well as Haiku.
There’s also an unfinished patch to add a batch-mode to IoM: https://review.haiku-os.org/c/haiku/+/60