A browser-based tool for optimizing EPUB files for e-ink readers. Converts images to baseline JPEG, fixes common EPUB issues, and supports Rotate & Split mode for wide image handling.
No installation required Β· Works 100% offline after loading
- Simple Mode (default): Drop files, convert, download. No configuration needed.
- Advanced Mode: Full control with quality settings, image selection grid, detailed logs, and validation info.
- Format conversion: PNG, GIF, WebP, BMP β baseline JPEG
- Quality control: 1-95% JPEG quality with presets (Low 60%, Medium 75%, High 85%, Max 95%)
- Smart scaling: Automatically scales images to fit e-reader screen (default 480Γ800) β dramatically reduces file size and improves e-reader responsiveness
- Grayscale mode: Converts all images to grayscale for e-ink displays
Optimized for manga and light novels with horizontal spread images:
Three processing modes (per-image selection):
| Mode | Color | Description |
|---|---|---|
| β» CW | π΅ Blue | Rotate 90Β° clockwise + split right-to-left (Japanese manga) |
| βΊ CCW | π Orange | Rotate 90Β° counter-clockwise + split left-to-right (Western comics) |
| ββ Vertical | π’ Green | Split vertically without rotation (panoramic images) |
Selection features:
- Thumbnail grid with per-image mode selection
- Images displayed in OPF spine reading order
- Quick selection buttons: "Select Landscape", "Select All", "Clear"
- Small images (β€480Γ800) auto-locked β no processing needed
Overlap settings:
- Separate overlap for rotation modes (CW/CCW): 5%, 10%, or 15%
- Separate overlap for vertical split: 5%, 10%, or 15%
- SVG cover fix: Unwraps images from problematic SVG containers (supports
<svg:svg>namespace prefix) - SVG-wrapped images: Detects and fixes
<svg><image xlink:href="..."/></svg>and<svg:svg><svg:image>patterns - Cover metadata: Ensures
<meta name="cover" content="..."/>exists in OPF - Manifest sync: Updates image references and media-types after conversion
- NCX identifier sync: Synchronizes
dtb:uidwith OPFdc:identifier - EPUB OCF compliance: Writes
mimetypeas first uncompressed entry
- Drop multiple EPUB files at once
- Individual progress tracking
- Combined statistics (total saved, conversion count)
- Download all as single ZIP file
- Dark/Light theme: Toggle with π/βοΈ button, preference saved
- User Guide: Built-in documentation (π button or footer link)
- Export logs: Save detailed conversion report as text file
- Drag & drop an EPUB file onto the drop zone
- Click Convert to Baseline JPEG
- Download the converted EPUB
Default settings: 85% quality, grayscale ON, no rotation/split.
- Toggle βοΈ Advanced Mode below the drop zone
- Drop an EPUB file
- Adjust JPEG quality if needed
- Select images for Rotate & Split in the thumbnail grid
- Choose mode for each image: β»CW, βΊCCW, or ββVertical
- Adjust overlap settings if needed
- Toggle Grayscale on/off
- Click Convert to Baseline JPEG
- Review detailed logs and stats
- Download the converted EPUB
- Drop multiple EPUB files at once
- Configure quality settings (applies to all)
- Click Convert All
- Download individual files or Download All as ZIP
| Option | Default | Description |
|---|---|---|
| JPEG Quality | 85% | Compression level (1-95%). Lower = smaller file, higher = better quality |
| Rotate & Split | OFF | Manually select images and choose CW/CCW/Vertical mode |
| Rotate Overlap | 15% | Overlap between split pages for CW/CCW modes |
| Vertical Overlap | 15% | Overlap between split pages for Vertical mode |
| Grayscale | ON | Convert all images to grayscale |
| Screen Width | 480px | Target e-reader screen width |
| Screen Height | 800px | Target e-reader screen height |
1. Load image from EPUB
2. Convert to RGB (handle RGBA/LA/P modes)
3. Check if image selected for Rotate & Split
4. If selected:
a. CW/CCW mode:
- Scale width to screen height (800px)
- Rotate 90Β° clockwise or counter-clockwise
- Calculate split positions (edges forced to exact boundaries)
- Clear canvas with white background before each part
- Split into pages with configured overlap
- CW: right-to-left order, CCW: left-to-right order
b. Vertical mode:
- Scale to fit height (800px)
- Split vertically left-to-right with configured overlap
- Clear canvas with white background before each part
5. If not selected: scale to fit 480Γ800
6. Apply grayscale (if enabled)
7. Encode as baseline JPEG (non-progressive)
8. Update all references (XHTML via DOMParser, OPF, CSS, NCX)
For a 2400Γ1600 image rotated CW with 15% overlap on 480Γ800 screen:
- Scale width to 800px β 2400Γ800
- Rotate 90Β° CW β 800Γ2400
- Overlap: 480 Γ 0.15 = 72px
- Step: 480 - 72 = 408px
- Number of parts: ceil((2400 - 72) / 408) = 6 parts
- Extraction order: right β left (CW) or left β right (CCW)
| File Type | Modifications |
|---|---|
| Images | Convert format, scale, rotate, split, grayscale |
| XHTML | Update <img> src, duplicate container blocks for splits (via DOMParser), fix IDs |
| OPF | Update manifest hrefs, media-types, add split image entries, ensure cover meta |
| NCX | Sync dtb:uid with OPF identifier |
| CSS | Update image references |
All XHTML modifications use DOMParser for safe, bulletproof manipulation:
1. Split Image Block Duplication
Original: After split (2 parts):
<figure> <figure id="img_part1">
<img src="spread.jpg"/> <img src="spread_part1.jpg"/>
</figure> </figure>
<figure id="img_part2">
<img src="spread_part2.jpg"/>
</figure>
2. SVG Cover/Image Unwrapping
Original: After fix:
<svg:svg viewBox="0 0 600 900"> <img src="../images/cover.jpg" alt="Cover"/>
<svg:image xlink:href="..."/>
</svg:svg>
Why DOMParser? Regex cannot reliably handle nested HTML or XML namespaces:
<div> β regex might start here
<p>
<img/>
</p> β regex might end here (WRONG!)
</div>DOMParser understands document structure, handles all namespace variants (svg:, xlink:), and always produces valid XML.
Pre-conversion checks:
- β Valid ZIP structure
- β
mimetypefile present - β OPF file exists
- β Images found for conversion
Post-conversion checks:
- β All images successfully converted
- β Manifest references valid
- β
mimetypeis first entry (OCF compliance)
| Browser | Status |
|---|---|
| Chrome 90+ | β Full support |
| Firefox 88+ | β Full support |
| Safari 14+ | β Full support |
| Edge 90+ | β Full support |
Requirements: Modern browser with ES2020 support, Canvas API, File API
Typical compression results (85% quality, grayscale enabled):
| Source | Result |
|---|---|
| 3000Γ4000 PNG (5MB) | 480Γ800 JPEG (~50KB) β 99% reduction |
| PNG (lossless) | 70-90% smaller |
| WebP | 30-50% smaller |
| High-quality JPEG | 20-40% smaller |
Smart scaling to 480Γ800 is the biggest factor β large source images become dramatically smaller while looking identical on e-ink screens.
- No server uploads: All processing happens in your browser
- No data collection: Files never leave your device
- Works offline: After initial page load, no internet required
- JSZip 3.10.1 - ZIP file handling
- Noto Sans - UI font (with CJK, Arabic, Hebrew support)
- DOMParser for all XHTML manipulation: Replaced regex-based approach with proper DOM parsing for:
- Split image block duplication (fixes tag mismatch errors with nested HTML)
- SVG cover fix (handles all namespace variants)
- SVG-wrapped image unwrapping (preserves dimensions)
- SVG namespace prefix support: Handles
<svg:svg>,<svg:image>, and standard<svg>variants. - Safe container detection: Automatically finds the closest safe container (div/p/figure/aside) for each image, regardless of nesting depth.
- Canvas clearing: Added white background fill before each split part to prevent image artifacts.
- Precise edge positions: Split parts now have mathematically exact edge alignment (first and last parts forced to image boundaries).
- Root folder handling: Images in EPUB root folders (OPS/OEBPS) now correctly matched even without path in src attribute.
- Path collision prevention: Full path verification prevents wrong image replacement when same-named files exist in different folders.
- Noto Sans font: Replaced Atkinson Hyperlegible with Noto Sans family for full international support (CJK, Arabic, Hebrew).
- User Guide: Built-in documentation page (
guide.html) - Help button (π) in header and footer link
- Dark/Light theme toggle: Remembers preference in localStorage
- Professional neutral color scheme (black/gray for dark, white/gray for light)
- Three processing modes: CW (blue), CCW (orange), Vertical (green)
- Per-image mode selection: Choose different modes for different images
- Separate overlap settings: Configure rotation and vertical overlap independently
- Smart selection blocking: Images β€480Γ800 are locked (no processing needed)
- Vertical split disabled for images with width β€480px
- Advanced Mode toggle: Simple mode by default (just drop & convert), Advanced mode for full control
- Export log: Download detailed conversion report as text file
- Split image logging shows detailed part info (dimensions, sizes)
- Fixed collision bug when EPUBs contain same-named images in different folders
- Split images now keyed by full path instead of basename
- Renamed "Light Novel Mode" to "Rotate & Split" for clarity
- Manual image selection: Thumbnail grid to select which images to rotate & split
- Reading order: Images displayed in OPF spine order
- Quick selection buttons: Select Landscape, Select All, Clear Selection
- Image picker grid for manual Rotate & Split selection
- Removed automatic landscape detection
- Enhanced logging system with timestamps and colored tags
- Per-image logging with dimensions, format, and compression stats
- Visual summary table at end of conversion
- Batch processing summary with total stats
- NCX
dtb:uidsyncs with OPFdc:identifier - Fixed duplicate ID issue when splitting images (part suffix appended)
- EPUB OCF compliance:
mimetypewritten first as uncompressed entry - OPF manifest uses correct relative paths for subdirectories
Issues and pull requests welcome! Please test with various EPUB sources before submitting.
Made by Megabit & pablohc
Optimized for CrossPoint Reader and XTEink X4 e-readers.