Custom Icons for applications

Is there some way to convert SVG / PNG icon file to Haiku HVIF and them set to selected application, the question is how to do this via command line (not icon-o-matic with gui mode) ? and what with sizes, what is the prefered size for app 32x32 and 16x16 or higher posible?

my idea is get some icons pack i like crystal icons and make script for do everything with this package automaticaly

HVIF is a vector format like SVG, though it is a much more effcient format. The maximum size by design is 128x128 (I think), at least in terms of rendering as a vector, they could always be scaled up more (with the associated “blurring” of any bitmap scaling process.)

I don’t know off hand if there is a direct way to convert SVG to HVIF though I know some people have done it (maybe just through Wonderbrush or Icon-O-Matic.) I think it is sort of a lossy process because SVG may be able to represent things HVIF cannot. Here is a good article about HVIF written by someone outside the Haiku project if you want to learn more.

So I don’t know if there is a good answer to your first few questions, but I am also interested in icons so I can look into this further. We might need some custom code to convert SVG icons to HVIF in a smarter way.

OK, so assuming you then had a bunch of new HVIF icons how do you update applications? Unfortunately that is also a bit tricky. It was tricky before, but now with our package system it is even more tricky. You see the icons for applications are embedded in them as resources inside the executable. Before we had our package system you could maybe write an application to update the icons in each app by updating the resources. But now most Haiku applications are in hpkg files which are never actually extracted by mounted “virtually”, meaning you can’t really change the applications without actually opening the hpkg file and changing the files inside. This is certainly possible but sort of a pain.

Honestly at this point the easier approach to have a more customized icon set may be to patch Deskbar and Tracker to support SVG icons and a way to override application icons from outside the package system. Though now that I think about it, maybe it can already be done with the MimeTypes preferences…

I am mainly writing all this to educate but as I say if you really want custom icons probably we just need to provide an easier way to override them. It is really just a matter of changing the code which loads an icon so it might be easier then I think.

I guess that we need an app to analyse and ‘simplify’ SVG files so importation will always work even if there are losses. We could also have HVIF importation/exportation plugins for Inscape but it would be sad to rely on an external app.

You can extract the app then update resources (using Resourcer?) or open binary in Filetypes and drop your icon there.
After that put the modified binary in /home/config/non-packaged/… where it should override the binary contained in the package.
But doing that for a long list of packages doesn’t seem realistic.

The short answer is no.

If your icon is in PNG, convert it to the legacy bitmap icon format used in BeOS instead. Then you can only provide 16x16 and 32x32 icons and the system will do its best to scale them.

If they are SVG you can import them in Icon-O-Matic but it will usually need some manual tweaks to look nice, since the conversion between the two formats isn’t straightforward. Also, doing things this way tends to generate HVIF icons that are not optimal, they will be quite large. The nice thing about HVIF is that we can fit most of the icons in a smaller size than the raw bitmaps.