IconThemes

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IconThemes

Post by yorik »

Note that converting a png into svg has no real advantage, it will simply embed the png data inside the svg file.
If these icons were designed in a bitmap application, there is no point in making svg versions, as there is no vector version to begin with...
Aside from that, these look VERY nice!
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: IconThemes

Post by MisterMaker »

I did some 1337 hacks on the add-on and now it works on png files.
The instructions say preferably svg files, but the code definitely say if svg or not.
This probably needs to be if SVG or PNG or JPG or GIF.
@kunda1 and@yorik tnx!
Also some devs cleanup the icon names, as lots of especially std icons have the proper std name.
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: IconThemes

Post by MisterMaker »

Ok this is a bit weird and annoying, The icon theme addon seems to translate the icon names to the function name.
Example:
Std_refresh is called "Std_Refresh.png" in the icon theme, while it is called "view-refresh.png" in Linkstage icon theme.
If I open the icon theme addon in linkstage my icon: "view-refresh.png" now has the name of "Std_Refresh.png" so there is some translating going on there.
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: IconThemes

Post by dprojects »

yorik wrote: Tue Jun 28, 2022 12:58 pm Note that converting a png into svg has no real advantage, it will simply embed the png data inside the svg file.
I have Xubuntu and I use GIMP to create icons. GIMP has no SVG export, so I have to save PNG as XPM. I found conversion tools from PNG to SVG (don't remember which one) but they didn't work. For me this is more convenient to export PNG directly to XPM at GIMP, because screenshots are made to PNG.

However, in fact for me it is not an issue. SVG would be useful if the icon would be zoomed after mouse hover. But normally there is no need to have SVG, the XPM works fine too. I would like to have rotated icons, instead ;-) but this would probably impact FreeCAD performance ;-)

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: IconThemes

Post by MisterMaker »

Inkscape I I think the way to go if you like to make 2D icons with SVG.
Can really recommend using blender for 3D icons. It can also export svg but you will only get the outline and have to manually color in the colors.
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: IconThemes

Post by dprojects »

MisterMaker wrote: Wed Jul 06, 2022 8:56 am Inkscape I I think the way to go if you like to make 2D icons with SVG.
Can really recommend using blender for 3D icons. It can also export svg but you will only get the outline and have to manually color in the colors.
Thanks for the info about Inkscape, I will try it someday. However, I will stay with XPM because the icons are so small there is no difference if this is SVG or any other format.

For 3D icons I use FreeCAD. I make screenshot from Xubuntu region selector and import to GIMP the PNG file. Then I change the PNG and export to XPM. For me this is quick, working and not so hard way.

I don't use Blender. I run once Blender to check if there is possibility to script it or make spreadsheet reports. What I like at Blender is that it starts many times faster than FreeCAD. I was surprised how fast the Blender started. But didn't saw the possibility to create spreadsheet cut-list and scripting in a quick way. The Blender code editor is annoying to use and I don't want to spend half-life to learn how to use editor.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
MisterMaker
Posts: 739
Joined: Mon Sep 21, 2020 7:41 am

Re: IconThemes

Post by MisterMaker »

I also have no idea why Freecad uses svg since it never scales things up so that it would cause a png to start looking blocky,

And my experience by now is file size of a detailed svg is similar to a png at 256x256 which is more than enough for an icon.

I btw have a render script in Blender that sets a certain camera then selects an object, hides the rest and render it. It then saves the render as that object name to a certain folder.
When I change colors of my material or ad a new icon I just press play on the script and it poops out a new icon theme.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: IconThemes

Post by yorik »

The SVG format (or anything vectorial) basically suppresses the resolution question. At any resolution it will look good, without filesize increase. If you draw a 256x256px PNG icon, 1) it will take more space than a corresponding SVG, and 2) it will probably look bad at 16x16px.

That said, for a custom theme, these questions are less important, I'd go for it without banging my head ;)

I would avoid XPM too, because it has indexed colors, it has no good transparency, etc..
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: IconThemes

Post by dprojects »

MisterMaker wrote: Wed Jul 06, 2022 9:19 am I also have no idea why Freecad uses svg since it never scales things up
Yes, the zooming icons on mouse hover could justify that. But for me performance, stability and reliability (no crashes if you have no saved project) is essential. I don't want FreeCAD to be heavy piece of junk like other paid CAD software.

MisterMaker wrote: Wed Jul 06, 2022 9:19 am png at 256x256 which is more than enough for an icon.
While I create icon for new tool, I just make what the tool do in FreeCAD, make screenshot of this to PNG. Usually I have to only change colors into gradient at GIMP, resize the PNG to 48x48 and export directly to XPM. It is about 1 minute job to create 3D icon. I use transparent for all icons and don't see anything wrong.

Maybe if I would resize icons at GUI FreeCAD preferences (I guess there is such option but I have never use it) the XPM defects would be visible but for me essential is space for 3D model, editor and other things. The icons should not take half-of-the-screen ;-)

EDIT:

More interesting is icons space planning. Because if you have a lot of icons the space became less and less... I was thinking about some kind of workbench but only for icons, quick scroll and you have other icons sets...

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: IconThemes

Post by dprojects »

yorik wrote: Wed Jul 06, 2022 10:52 am I would avoid XPM too, because it has indexed colors, it has no good transparency, etc..
The last 4th row has 2 icons. The 1st one from the left is XPM made with GIMP and the second one (the one from right) is the plain SVG made from the same PNG file with inkscape tool.

And yes I can confirm that the SVG look a little better, more dark colors, and the red edge is visible a little better. However I am not sure if this is worth to change? ;-) This is not so extreme difference ;-)

EDIT:

At GIMP it is much quicker to change screenshot into gradient PNG. At inkscape I was thinking half-hour how to resize image ;-) I didn't know there is such thing like Page size that need to be resized too and I have to select image before transform ;-) Looks like user need to have PhD first to use inkscape for real ;-)

Image

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
Post Reply