Cross-Platform Command-Line Utilities for HVIF & SVG Conversion

If you like it ok!
But I do not know for what it is worth!

I managed to make a utility for converting the Icon-O-matic format to svg - iom2svg. The difficulty of creating a cross-platform version is that I had to implement a simplified cross-platform version of the BMessage class. Right now, it’s only for Unflatten and reading values. Everything is working fine. To implement the conversion in the opposite direction - svg2iom - I will have to finish the full version of BMessage:

9 Likes

This is wonderful.

The thumbnail provider for Windows currently supports both HVIF and Icon-O-Matic formats.

11 Likes

Inkscape is also now able to open and save Icon-O-Matic files.

18 Likes

Just tested it, really cool to have a quick image to SVG to IOM icon :slight_smile:

Original image:

img2svg conversion result:

svg2iom result:

Another try, with a PNG wolf:

Converted to SVG and displayed in SVGear :

Converted to IOM :

Note : cross platform hvif-tools compiled and used on MacOS successfully.

Really nice job :+1:

8 Likes

I haven’t tested the build for macOS, and I’m glad to hear that everything went well. Were there any problems?

Everything was working fine from the few tests I’ve done :slight_smile:

1 Like

SVGear is currently working quite fine, any plan to release it in HaikuDepot ? I have already used the version compiled from the GitHub repo :slight_smile:

Not yet, I haven’t finished some of the things I planned to do. At the very least, this includes importing and exporting to Icon-O-Matic format. And some other improvements.

5 Likes

If I’m not wrong, it should be possible to extend - for instance - existing PNG translator to export into SVG format ?

I was wondering if having that kind of enhancements could be useful to have ShowImage exporting PNG to SVG format (or any bitmap format to SVG)

I think there is no need to add SVG support to every raster image translators, just have a translator that output SVG but support B_TRANSLATOR_BITMAP as input format.

Maybe @3dEyes could add this to his NanoSVGTranslator add-on which, currently, AFAIK, is supporting SVG → raster but not the reverse way.

2 Likes

Is it possible to create a new animation format based on HVIF in the next step?
The idea is to create a container format that treats animations as the instructions of movement of independent HVIF objects, rather than a sequence of full frames.

The format would have two sections:

  1. Static HVIF objects
  2. A dynamic timeline consist of instructions that control the transformation (position, rotation, scale, color, transparency) of these objects over time

I believe this HVIF animation can at least replace gif with better color depth and smaller file size. I’m not sure whether it can be smaller than lottie though, and what can it be applied on.

I think SVG can already do animations just fine.

Are you in a situation where:

  • The compactness of HVIF matters, and
  • The animation is so simple that typical compression methods (gzip, LZ algorithms, …) don’t work efficiently?

If not, maybe just use SVG and the existing tooling around it?

I see your point.
In general, SVG animation should be fine. I propose this way more for the purpose of making use the compactness of HVIF to create smallest animation possible, and what else can HVIF do except for system icons.
Would this be useful for embedded systems with low hardware specifications?

Also, as an OS targeting multimedia, vector multimedia creation might be a possible direction.
Was there once having a suggestion for svg screenshot function?

We’re already using the icons in tool bars, so theoretically, if someone wanted some transition animations there (for instance to toggle between two states), we could make use of this without needing to support full blown SVG animations.

However, I’m not sure animations fit too well in Haiku’s current interface language.

3 Likes

Animation for buttons in toolbars is already overkill.

But, to be fair, I want to remind you that NetPositive had animated gif icons on the toolbar.

Perhaps would it be useful for few deskbar applets that are indicating a status? I was thinking about netpulse or USBDeskbar as anyway their icon has to be replaced for scaling.

But if you are just indicating a change in state, like an active/inactive distinction, you can just use two separate icons, surely. Is there a need to invent an entire new AHVIF format?

Creating that would be an interesting programming challenge, and once it exists, someone will think of a use for it, perhaps as a Moe replacement. I just don’t think that your suggestion works out.

If the deskbar is going to end up blinking away like a christmas tree on steroids, that’s fine, just give me a way to turn it off.

1 Like