Split Icon SVG File to be 1 Icon per File #88467

Open
opened 2021-05-21 18:43:54 +02:00 by Julian Eisel · 14 comments
Member

@Shrinks99 did the work of splitting the SVG itself already:
https://devtalk.blender.org/t/splitting-the-icons-svg-file/18937

Next step would be to update the update script ({https://developer.blender.org/diffusion/B/browse/master/release/datafiles/blender_icons_update.py}) to work with the individual SVGs.

@Shrinks99 did the work of splitting the SVG itself already: https://devtalk.blender.org/t/splitting-the-icons-svg-file/18937 Next step would be to update the update script ({https://developer.blender.org/diffusion/B/browse/master/release/datafiles/blender_icons_update.py}) to work with the individual SVGs.
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscribers: @Shrinks99, @JulianEisel

Added subscribers: @Shrinks99, @JulianEisel
Member

Added subscriber: @Harley

Added subscriber: @Harley

Added subscriber: @jenkm

Added subscriber: @jenkm

Added subscriber: @tiles

Added subscriber: @tiles

Next step would be to update the update script (rB release/datafiles/blender_icons_update.py) to work with the individual SVGs.

Just curious, and while touching this issue, why even stick with svg? The datatoc conversion script converts a png file to dat at the end anyways. So wouldn't it be wiser to work with png in the first place at all? PNG allows to work with gradients and 16 million colors in an easy way. Literally every 2D graphics will work then.

You wouldn't loose anything, you could still create svg icons first in case you really want to. This exports just fine to png. But you could also pixel your graphics in Gimp then. Or render them out. Or paint it in oil, then scan it in. You could use any valid method that produces a bitmap graphics in png format in the end. But at the moment you are limited to a SVG pipeline. And in case of the toolbar icons you are even limited to model your icons first in 3D, to work with a color system that doesn't match, with the cumbersome material setup of Blender, and with a system that does not allow pixel perfect icon creation at all. Pixels is a 2D unit.

So why not go with png for all icons? Then the artist could decide what route he wants to go to achieve his goal.

> Next step would be to update the update script (rB release/datafiles/blender_icons_update.py) to work with the individual SVGs. Just curious, and while touching this issue, why even stick with svg? The datatoc conversion script converts a png file to dat at the end anyways. So wouldn't it be wiser to work with png in the first place at all? PNG allows to work with gradients and 16 million colors in an easy way. Literally every 2D graphics will work then. You wouldn't loose anything, you could still create svg icons first in case you really want to. This exports just fine to png. But you could also pixel your graphics in Gimp then. Or render them out. Or paint it in oil, then scan it in. You could use any valid method that produces a bitmap graphics in png format in the end. But at the moment you are limited to a SVG pipeline. And in case of the toolbar icons you are even limited to model your icons first in 3D, to work with a color system that doesn't match, with the cumbersome material setup of Blender, and with a system that does not allow pixel perfect icon creation at all. Pixels is a 2D unit. So why not go with png for all icons? Then the artist could decide what route he wants to go to achieve his goal.

Added subscriber: @AlexeyAdamitsky

Added subscriber: @AlexeyAdamitsky

Added subscriber: @jendrzych

Added subscriber: @jendrzych

So why not go with png for all icons? Then the artist could decide what route he wants to go to achieve his goal.

Perhaps @jendrzych would be better suited to answer this but I'll give it a go.

SVG is a good choice for authoring icons in general because one can target multiple pixel densities while keeping a resolution agnostic (though technically targeting the lowest resolution) master copy. I find it preferable because I can target the 1x PPI scale, work within the pixel grid, and everything will rasterize predictably at higher resolutions too. An example of this applied within Blender is available in the forum post.

I would also argue that more variation in icon-set production will not lead to a better or more cohesive end product. Sets of icons are defined by their grid, colour scheme, and shape language, I believe by keeping the authoring process standardized as vectors it is easier to keep Blender's icon set consistent. By allowing or encouraging designers to author icons as bitmaps instead of (or in addition to) vectors, I think consistency of shape language would be diminished due to a lack of standardization in the rasterization process.

As for Blender's toolbar icons, I will 100% agree with you there. I also don't think Blender is the right tool for creating these and if anyone wants my opinion it would be "switch to SVG for those too". Nobody asked for my thoughts there though and they look reasonably nice already... However, if there is demand to convert them to SVGs I will happily give that a shot. :)

> So why not go with png for all icons? Then the artist could decide what route he wants to go to achieve his goal. Perhaps @jendrzych would be better suited to answer this but I'll give it a go. SVG is a good choice for authoring icons in general because one can target multiple pixel densities while keeping a resolution agnostic (though technically *targeting* the lowest resolution) master copy. I find it preferable because I can target the 1x PPI scale, work within the pixel grid, and everything will rasterize predictably at higher resolutions too. [An example of this applied within Blender is available in the forum post. ](https://devtalk.blender.org/t/splitting-the-icons-svg-file/18937/7?u=shrinks99) I would also argue that more variation in icon-set production will not lead to a better or more cohesive end product. Sets of icons are defined by their grid, colour scheme, and shape language, I believe by keeping the authoring process standardized as vectors it is easier to keep Blender's icon set consistent. By allowing or encouraging designers to author icons as bitmaps instead of (or in addition to) vectors, I think consistency of shape language would be diminished due to a lack of standardization in the rasterization process. As for Blender's toolbar icons, I will 100% agree with you there. I also don't think Blender is the right tool for creating these and if anyone wants my opinion it would be "switch to SVG for those too". Nobody asked for my thoughts there though and they look reasonably nice already... However, if there is demand to convert them to SVGs I will happily give that a shot. :)

Thanks for your thoughts Henry,

I would also argue that more variation in icon-set production will not lead to a better or more cohesive end product.

But this way the artist could decide what pipeline to use. There wouldn't be a need anymore to convince anybody to his favourite method. Since all methods would be allowed. The pipeline would become much simpler and easier and faster. Without the need to have Inkscape installed to be able to change the icons in Blender.

As told, PNG is already part of the pipeline. It's the forelast step. Convert to PNG sheet, then slice this sheet and convert it to dat. And this for both, the regular icons, and the tool shelf icons. And when you would open up the pipeline at this point, then you could still use SVG in the first place, if you want to. Or PNG, Bitmap, etc if you prefer to.

And it would finally be pixel perfect. Since you work with pixels already. Especially the tool shelf icons are not to manage in this regards.

Well, it's in the end your decision. I understand that you at Blender don't want to let the old way go. You are used to the working SVG method, and the whole setup is for this existing pipeline already. I just thought it is a good opportunity to raise my concerns while you are at changes here anyways. From the view of somebody from outside who is not part of the Blender team. Who does custom icons for Blender, and always scratches his head why things have to be this super complicated.

Well, it would already a big improvement to change at least the method for the tool shelf icons. You have my upvote here :)

Kind regards
Tiles

Thanks for your thoughts Henry, > I would also argue that more variation in icon-set production will not lead to a better or more cohesive end product. But this way the artist could decide what pipeline to use. There wouldn't be a need anymore to convince anybody to his favourite method. Since all methods would be allowed. The pipeline would become much simpler and easier and faster. Without the need to have Inkscape installed to be able to change the icons in Blender. As told, PNG is already part of the pipeline. It's the forelast step. Convert to PNG sheet, then slice this sheet and convert it to dat. And this for both, the regular icons, and the tool shelf icons. And when you would open up the pipeline at this point, then you could still use SVG in the first place, if you want to. Or PNG, Bitmap, etc if you prefer to. And it would finally be pixel perfect. Since you work with pixels already. Especially the tool shelf icons are not to manage in this regards. Well, it's in the end your decision. I understand that you at Blender don't want to let the old way go. You are used to the working SVG method, and the whole setup is for this existing pipeline already. I just thought it is a good opportunity to raise my concerns while you are at changes here anyways. From the view of somebody from outside who is not part of the Blender team. Who does custom icons for Blender, and always scratches his head why things have to be this super complicated. Well, it would already a big improvement to change at least the method for the tool shelf icons. You have my upvote here :) Kind regards Tiles
Contributor

Added subscriber: @RedMser

Added subscriber: @RedMser

Added subscriber: @hlorus

Added subscriber: @hlorus

There were some historical reasons for this strange SVG > PNG > DAT > PNG pipeline.

  • The need to cut the sheet into separate icons for efficient storage in the repository.
  • These icons had to store their coordinates on the sheet for back-assembly into a sheet.
  • During the build process you can't just use PNGs, you need an additional tool to read PNG.
  • The same image can be saved in a different PNG encoding, which will lead to overwriting in the repository.

After splitting the source file into separate icons, everything becomes easier.

  • We don't need to store icon coordinates, proof of concept: Ver. 2 (WIP) in [D13068](https://archive.blender.org/developer/D13068).
  • We can store icons as PNG (produced by a script, so a builder can read it) or it could be another simple BMP/TGA format.
  • There is no need to regenerate all icons, as it happens now, when updating only one.

I am not sure that it is reasonable to store the svg source and raster versions in the repository at the same time. There should be one of them.
I prefer bitmap. The source svg can be considered optional and stored outside of the Blender repository, like it does with toolbar icons.
Or you can try rasterizing svg while compiling with, e.g. librsvg, but this needs to be checked for quality.


And actually I have a question what about unused icons or alternative versions.
It would be nice to store them somewhere for future use.

There were some historical reasons for this strange SVG > PNG > DAT > PNG pipeline. - The need to cut the sheet into separate icons for efficient storage in the repository. - These icons had to store their coordinates on the sheet for back-assembly into a sheet. - During the build process you can't just use PNGs, you need an additional tool to read PNG. - The same image can be saved in a different PNG encoding, which will lead to overwriting in the repository. After splitting the source file into separate icons, everything becomes easier. - We don't need to store icon coordinates, proof of concept: Ver. 2 (WIP) in `[D13068](https://archive.blender.org/developer/D13068)`. - We can store icons as PNG (produced by a script, so a builder can read it) or it could be another simple BMP/TGA format. - There is no need to regenerate all icons, as it happens now, when updating only one. I am not sure that it is reasonable to store the svg source and raster versions in the repository at the same time. There should be one of them. I prefer bitmap. The source svg can be considered optional and stored outside of the Blender repository, like it does with toolbar icons. Or you can try rasterizing svg while compiling with, e.g. librsvg, but this needs to be checked for quality. *** And actually I have a question what about unused icons or alternative versions. It would be nice to store them somewhere for future use.
Contributor

Added subscriber: @IyadAhmed

Added subscriber: @IyadAhmed
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:23:27 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#88467
No description provided.