I think you will be astonished how view lines of code that actually is. It is 309 loc (lines of code) → 10.5kByte including comments.
- 2/3 of it can not be removed, because it is initialising, loading and rendering of the canvas in edit mode
- Edit mode is necessary to be able to define type and fields
- IMO rotating an image without modifying it is mandatory and can not be removed
- Resizing an image is needed and can not be removed
- At line 225 the “touch” and “mouse” handling starts
- At line 325 is the save mechanism which needs to stay
So the only code that can be removed or “moved into a plugin” is about 90 locs. If we say the average line length is 50 characters, we can safe 4500 character.
- The edit-toolbar has 9 icons. 4 of them could be moved into a plugin.
- 4 toolbar buttons have dropdowns
- colour picker (used for 2 buttons) … 46 loc → 3kB
- Opacity dropdown … 32 loc → 1kB
- Line width dropdown … 25 loc → 1kB
- Icon SVGs
- Line width → 0.5kB
- Opacity icon → 1.2kB
- Paint icon → 0.9kB
- Eraser icon → 0.5kB
So we can safe: 12.6kByte in the core if we remove the icons from the core. Which means they are not available for users without installing a plugin.
A plugin for 4 icons and 3 wikitext templates and 90 lines of code → IMO that’s not worth it, since core plugins need extra maintenance work.
Especially, since we remove simple very light weight sketching functionality from the app.
You are right. Images done wrong can have a huge impact on wiki size. So telling users, how they should use and optimise images, is worth wile. There is a pending PR at GitHub that will make the wiki at tiddlywiki.com smaller by 2000kB.
IMO that’s worth it. Removing basic drawing functionality and winning 13kByte isn’t.
No offence intended.