Efficient storage of icons in git #37989

Closed
opened 9 years ago by ideasman42 · 13 comments
Owner

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.
Poster
Owner

Changed status to: 'Open'

Changed status to: 'Open'
ideasman42 self-assigned this 9 years ago
Poster
Owner

Added subscribers: @brecht, @Sergey

Added subscribers: @brecht, @Sergey
Owner

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges
Owner

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).
Sergey commented 9 years ago
Owner

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! :)
Owner

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. ;)
Poster
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.
Poster
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.
ideasman42 removed their assignment 7 years ago
Poster
Owner

Removed subscriber: @ideasman42

Removed subscriber: @ideasman42
Collaborator

Added subscriber: @Blendify

Added subscriber: @Blendify
Collaborator

Is there a need for this task anymore?

Is there a need for this task anymore?
Poster
Owner

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
ideasman42 closed this issue 4 years ago
ideasman42 self-assigned this 4 years ago
Poster
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#37989
Loading…
There is no content yet.