Efficient storage of icons in git #37989

Closed
opened 2013-12-30 11:56:00 +01:00 by Campbell Barton · 13 comments

Git is storing a full copy of icons for every change (almost 1mb increase to the repo size for every icon edit).

Specifically:
./release/datafiles/blender_icons16.png
./release/datafiles/blender_icons32.png
./release/datafiles/prvicons.png

From SVG source:
./release/freedesktop/icons/blender_icon_source.svg
./release/datafiles/prvicons.svg

Ideally we could use RSVG and render the SVG as a build step, but unfortunately RSVG doesn't support mask's in a way thats compatible with inkscape.

http://sourceforge.net/mailarchive/message.php?msg_id=31778009

So for now I would propose to store each icon file be moved into its own directory and split into uncompressed bitmap files (as an automated python script), Then on build the icons can be re-combined into a single PNG.

This way we can make a change to one icon without having to store a new copy of the entire file each time.

Workflow for creating icons


Basically the same as it is now...

  • Edit the SVG
  • Run release/datafiles/blender_icons.sh

Rather then committing the png, commit ./release/datafiles/blender_icons(16/32)/ directory which contains pixmaps

Workflow for building


Basically the same as it is now...

... internally there would be a program like datatoc that would take files from ./release/datafiles/blender_icons(16/32)/ and create a PNG in the build path.

Git is storing a full copy of icons for every change *(almost 1mb increase to the repo size for every icon edit).* Specifically: ./release/datafiles/blender_icons16.png ./release/datafiles/blender_icons32.png ./release/datafiles/prvicons.png From SVG source: ./release/freedesktop/icons/blender_icon_source.svg ./release/datafiles/prvicons.svg Ideally we could use RSVG and render the SVG as a build step, but unfortunately RSVG doesn't support mask's in a way thats compatible with inkscape. http://sourceforge.net/mailarchive/message.php?msg_id=31778009 So for now I would propose to store each icon file be moved into its own directory and split into uncompressed bitmap files (as an automated python script), Then on build the icons can be re-combined into a single PNG. This way we can make a change to one icon without having to store a new copy of the entire file each time. Workflow for creating icons **** *Basically the same as it is now...* * Edit the SVG * Run `release/datafiles/blender_icons.sh` *Rather then committing the png, commit `./release/datafiles/blender_icons(16/32)/` directory which contains pixmaps* Workflow for building **** *Basically the same as it is now...* ... internally there would be a program like `datatoc` that would take files from `./release/datafiles/blender_icons(16/32)/` and create a PNG in the build path.
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Campbell Barton self-assigned this 2013-12-30 11:56:00 +01:00
Author
Owner

Added subscribers: @brecht, @Sergey

Added subscribers: @brecht, @Sergey

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges

We would also need the 32x ones of course. (./release/datafiles/blender_icons32).

We would also need the 32x ones of course. (./release/datafiles/blender_icons32).

Notes so far:

  • Apart blender_icons.sh you would also need blender_icons.bat for Windows. And also make it so OSX works fine (it'll use .sh guess). Wouldn't want that some internal optimization change makes someone's life more difficult.

  • We've got other binary binary files which are much bigger even (fonts for example, splash) which are being modified on the same time basis as icons.

Ok, cambo says .blend are not compressed so this is not so big issue, but why using 0 compression level for PNG doesn't work for us?

  • Tweaking icons are gonna to become PITA. Imagine you've tweaked few icons in SVG, generated split PNG. Now what?
    All the files might be different from what they where originally (different inkscape versions, different platforms or so).

How would you stage files which you indeed changed? Unless files does have meaningful name, that would end up in rather annoying calculation of icon coords in a grid. Afraid we'll have people who'll commit all the files instead and all our attempts to optimize anything would mean nothing.

  • Based on previous note, would really recommend using rather natural names for icons (which is easy to do based UI_icons.h i would think) rather than cryptic names like 001.png and so. Would help seeing what's going on after icons modification.

  • Did someone checked other projects? From quick glance linux/gimp/calligra doesn't do anything specific against binary files in their repo. As in, we're developers and tools are to make our life easier, not we're to make tools life easier! :)

Notes so far: * Apart `blender_icons.sh` you would also need `blender_icons.bat` for Windows. And also make it so OSX works fine (it'll use .sh guess). Wouldn't want that some internal optimization change makes someone's life more difficult. * We've got other binary binary files which are much bigger even (fonts for example, splash) which are being modified on the same time basis as icons. Ok, cambo says .blend are not compressed so this is not so big issue, but why using 0 compression level for PNG doesn't work for us? * Tweaking icons are gonna to become PITA. Imagine you've tweaked few icons in SVG, generated split PNG. Now what? All the files might be different from what they where originally (different inkscape versions, different platforms or so). How would you stage files which you indeed changed? Unless files does have meaningful name, that would end up in rather annoying calculation of icon coords in a grid. Afraid we'll have people who'll commit all the files instead and all our attempts to optimize anything would mean nothing. * Based on previous note, would really recommend using rather natural names for icons (which is easy to do based UI_icons.h i would think) rather than cryptic names like 001.png and so. Would help seeing what's going on after icons modification. * Did someone checked other projects? From quick glance linux/gimp/calligra doesn't do anything specific against binary files in their repo. As in, we're developers and tools are to make our life easier, not we're to make tools life easier! :)

What is the longterm prognosis, lets say if we keep modifying the source as usual and keep the binary files as is in 1 year, 2 years?.

It shouldn't matter if its 300 or 400MB in total in a year. IMHO. ;)

What is the longterm prognosis, lets say if we keep modifying the source as usual and keep the binary files as is in 1 year, 2 years?. It shouldn't matter if its 300 or 400MB in total in a year. IMHO. ;)
Author
Owner

@ThomasDinges - disagree, if we add 80mb per year because of binary files this is going to need cleaning up later.

I doubt it would be so much, but rather avoid this if files need updating frequently and it can be avoided without too much trouble.

@ThomasDinges - disagree, if we add 80mb per year because of binary files this is going to need cleaning up later. I doubt it would be so much, but rather avoid this if files need updating frequently and it can be avoided without too much trouble.
Author
Owner

@Sergey, you raise valid points...

The other files we have in our repo are not changing that much (or we can't help it - as with splash),

I've submitted a patch which stored icons in git as small uncompressed bitmaps.

You do raise a good point that some small change in rasterization would update all icons. so I'll add a check for color difference so very minor changes dont cause all pixmaps to regenerate.

@Sergey, you raise valid points... The other files we have in our repo are not changing that much (or we can't help it - as with splash), I've submitted a patch which stored icons in git as small uncompressed bitmaps. You do raise a good point that some small change in rasterization would update all icons. so I'll add a check for color difference so very minor changes dont cause all pixmaps to regenerate.
Campbell Barton removed their assignment 2016-08-11 06:38:46 +02:00
Author
Owner

Removed subscriber: @ideasman42

Removed subscriber: @ideasman42
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Is there a need for this task anymore?

Is there a need for this task anymore?
Author
Owner

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Campbell Barton self-assigned this 2018-10-17 10:39:52 +02:00
Author
Owner

This has been implemented, closing.

This has been implemented, closing.
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
4 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#37989
No description provided.