Commit Graph
23 Commits
Author SHA1 Message Date
Esa Kataja 00ea1dbd17 Bump version to 0.9rc3 and add tag. 2024-12-04 00:23:50 +02:00
Esa Kataja b0c4810344 Clean up unused imports and variables, remove redundant code, and add ruff as a dev dependency. v0.9rc3 2024-12-04 00:22:25 +02:00
Esa Kataja 6e083f39e8 Implement parallel processing for optimization steps using ThreadPoolExecutor. 2024-12-03 23:45:35 +02:00
Esa Kataja 825338a2a3 Swap optimization steps: convert to monochrome before trimming whitespace. Include uv.lock in the commit. 2024-12-03 23:41:40 +02:00
Esa Kataja a2f88923ab Bump version to 0.9rc2
- Improved documentation with optimization levels
- Updated version history
- Fixed aspect ratio in PDF output
v0.9rc2
2024-12-03 23:02:44 +02:00
Esa Kataja 4c9cad58ec Bump version to 0.9rc1 v0.9rc1 2024-12-03 22:58:47 +02:00
Esa Kataja 721bbeb70d Merge branch 'feature/music-score-cleanup-v2' 2024-12-03 22:54:46 +02:00
Esa Kataja a78b9c25d1 Improve PDF generation with proper A4 sizing and borders
- Move PDF border size to settings.py
- Use standard A4 dimensions (210x297mm)
- Fix aspect ratio preservation in layout function
- Use img2pdf's built-in layout function with proper border specification
2024-12-03 22:53:23 +02:00
Esa Kataja 0f105880e6 fix: improve content detection in trim_whitespace
- Add thresholding to better separate content from background
- Invert image so content becomes white for getbbox detection
- Fix issue where white and transparent areas weren't being trimmed
2024-12-03 22:32:19 +02:00
Esa Kataja a979712c8c perf: optimize PNG compression only on final operations
- Add is_final parameter to trim_whitespace and convert_to_monochrome
- Only optimize PNGs on the final operation of each level
- Remove optimization from extract command
- Level 1: optimize in trim_whitespace
- Level 2: optimize in convert_to_monochrome
- Level 3: defer to optipng
2024-12-03 22:23:54 +02:00
Esa Kataja 75dc1c3e2c fix: properly handle transparency in trim_whitespace
Simplify transparency handling by flattening image with white
background for bounds detection while preserving original
transparency in the final crop. This fixes the issue where
transparent areas were being treated as black during trimming.
2024-12-03 22:06:51 +02:00
Esa Kataja 84e1a6a82e refactor: consolidate image trimming and standardize processing
- Replace OpenCV-based trim_whitespace with PIL implementation
- Remove redundant trim_whitespace_pil function
- Add initial trim step to extract command
- Standardize image processing to 2048px wide grayscale using Lanczos
2024-12-03 21:47:03 +02:00
Esa Kataja 682a1f13ee fix: Improve transparency handling and optimization levels
- Handle transparency in whitespace trimming
- Use IntEnum for optimization levels
- Add proper level comparisons
- Treat transparent pixels as white for boundary detection
- Preserve transparency in output
- Fix black artifacts in transparent areas
2024-12-03 21:38:55 +02:00
Esa Kataja 6e1d90de2f feat: Add settings module
- Add configuration for parallel processing
- Add optimization settings (optipng level, trim padding)
- Support environment variable overrides
- Add temporary directory prefix setting
2024-12-03 21:15:34 +02:00
Esa Kataja 3d143ce5a2 feat: Add optimize command
- Add whitespace trimming functionality
- Add optional PNG optimization with optipng
- Add progress tracking and error handling
- Improve imports organization
- Add proper docstrings and return values
2024-12-03 21:10:38 +02:00
Esa Kataja 7ef31b4876 docs: Add comprehensive README
- Add project description and features
- Include installation instructions with uv sync
- Add usage examples for all commands
- Document how each processing step works
- Add package installation instructions for different distros
2024-12-03 21:07:39 +02:00
Esa Kataja bad7612027 feat: Add cleanup of temporary files in finalize command
- Remove all temporary PNG files after PDF creation
- Remove temporary directory
- Update command feedback messages
2024-12-03 20:55:56 +02:00
Esa Kataja 9bacbb0dcf feat: Improved deskew to focus on horizontal lines
- Modified deskew function to better detect staff lines
- Added morphological operations to enhance horizontal lines
- Used probabilistic Hough transform for more precise line detection
- Added .png to gitignore
2024-12-03 20:53:17 +02:00
Esa Kataja 0709f93226 Add Ignore png files 2024-12-03 20:52:22 +02:00
Esa Kataja e909445f70 Add pdfs to git ignore v0.1.0-base 2024-12-03 19:25:30 +02:00
Esa Kataja eb11d95764 feat: Add PDF cleaner with deskew and image enhancement
Features:
- Page deskewing using contour detection
- Image enhancement with edge preservation
- High-resolution output (min 2048px width)
- Black and white conversion with proper contrast
2024-12-03 19:25:02 +02:00
Esa Kataja f5d35b499f feat: Add project structure with README and I/O directories 2024-12-03 19:24:47 +02:00
Esa Kataja fc9d33c3c2 chore: Initial project setup with dependencies 2024-12-03 19:23:58 +02:00