How ask-tao/image-splitter works
Image Splitter is a local image-slicing editor for sprite sheets and grid-based cuts. A user loads an image, creates or automatically detects slice regions (or configures a grid), edits them on the canvas, previews custom slices, and exports the results as a ZIP. The Vue interface delegates editor behavior to a composable and image/state operations to the core state class. The README documents these capabilities; sampled source confirms the core state and Electron wiring, though some editor actions are outside the excerpts.
Main entry points: App.vue Editor interface · main.ts Desktop process · i18n.ts Translation setup · preload.ts IPC bridge
Components 14
Image editor
- Canvas interactions
src/composables/useImageEditor.ts - Image and slices
src/core/ImageEditorState.ts
Application interface
- Editor interface
src/App.vue - Renderer startup
src/main.ts
Desktop runtime
- Desktop process
electron/main.ts - IPC bridge
electron/preload.ts - Update service
Localization and theme
- Theme preference
src/composables/useTheme.ts - Translation setup
src/i18n.ts - English messages
src/locales/en.json - Chinese messages
src/locales/zh-CN.json
Other components
- User
- JSZip
- Desktop user
Connections 14
- User → Editor interface: uses editor
README.md - Editor interface → Canvas interactions: invokes editor
src/App.vue - Canvas interactions → Image and slices: delegates state
src/composables/useImageEditor.ts - Image and slices → JSZip: creates archive
src/core/ImageEditorState.ts - Editor interface → Theme preference: uses theme
src/App.vue - Renderer startup → Editor interface: mounts interface
src/main.ts - Renderer startup → Translation setup: registers translations
src/main.ts - Translation setup → English messages: loads messages
src/i18n.ts - Translation setup → Chinese messages: loads messages
src/i18n.ts - Desktop user → Desktop process: starts desktop app
README.md - Desktop process → IPC bridge: configures bridge
electron/main.ts - Desktop process → Update service: checks updates
electron/main.ts - IPC bridge → Editor interface: exposes IPC events
electron/preload.ts - Editor interface → IPC bridge: sends language change
electron/preload.ts