{"id":26190172,"url":"https://github.com/0xataru/ascii-rs","last_synced_at":"2026-04-25T13:03:06.587Z","repository":{"id":278937793,"uuid":"937224743","full_name":"0xataru/ascii-rs","owner":"0xataru","description":"simple ascii converter written in rust","archived":false,"fork":false,"pushed_at":"2025-08-13T21:29:52.000Z","size":204787,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T02:32:17.350Z","etag":null,"topics":["ascii-art","rust","webapp"],"latest_commit_sha":null,"homepage":"https://ascii-rs.onrender.com","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xataru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-22T16:24:49.000Z","updated_at":"2025-08-17T23:10:41.000Z","dependencies_parsed_at":"2025-08-11T23:33:37.146Z","dependency_job_id":null,"html_url":"https://github.com/0xataru/ascii-rs","commit_stats":null,"previous_names":["0xataru/ascii-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xataru/ascii-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xataru%2Fascii-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xataru%2Fascii-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xataru%2Fascii-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xataru%2Fascii-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xataru","download_url":"https://codeload.github.com/0xataru/ascii-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xataru%2Fascii-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32262801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ascii-art","rust","webapp"],"created_at":"2025-03-12T00:52:50.312Z","updated_at":"2026-04-25T13:03:06.581Z","avatar_url":"https://github.com/0xataru.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASCII Art Converter 🎨\n![language](https://img.shields.io/badge/language-Rust-blue)\n![license](https://img.shields.io/badge/license-MIT-green)\n![build](https://img.shields.io/badge/build-passing-brightgreen)\n![logo](./akame_nobg.png)\n\nA modern web service for converting images to ASCII art with enhanced image processing algorithms and Clean Architecture, featuring a Rust WebAssembly frontend.\n\n## ✨ Features\n\n- 🖼️ **Image Upload** - Support for major formats (JPEG, PNG, GIF, WebP, BMP)\n- 🎯 **Enhanced Algorithms** - Advanced image processing for sharper ASCII results\n- ⚙️ **Customizable Parameters** - Width, detail level, contrast, blur adjustment\n- 🌐 **REST API** - Full-featured web API with documented endpoints\n- 🦀 **Rust WASM Frontend** - Modern web interface built with Yew framework\n- 🏗️ **Clean Architecture** - Clear separation of layers with dependency injection\n- 🚀 **Performance** - Asynchronous processing with Tokio\n- 📊 **Monitoring** - Structured logging and health check endpoints\n\n## 🔧 Tech Stack\n\n### Backend\n- **Rust** - Systems programming language\n- **Axum** - Modern web framework\n- **Tokio** - Async runtime\n- **Image** - Image processing library\n- **Serde** - Data serialization/deserialization\n- **Thiserror** - Error handling\n- **Tracing** - Structured logging\n\n### Frontend\n- **Rust + WebAssembly** - Frontend compiled to WASM\n- **Yew** - Modern web framework for Rust\n- **Trunk** - WASM web application bundler\n- **Gloo** - Web APIs and utilities for WASM\n\n## 🏗️ Architecture\n\nThe project follows Clean Architecture principles:\n\n```\nsrc/\n├── domain/              # Business logic\n│   ├── entities/        # Domain entities (ImageData, AsciiArt)\n│   ├── repositories/    # Repository interfaces\n│   └── value_objects/   # Value objects (ConversionConfig, ImageFormat)\n├── application/         # Application logic\n│   ├── use_cases/       # Use cases (business operations)\n│   └── services/        # Domain services\n├── infrastructure/     # Infrastructure\n│   ├── repositories/   # Repository implementations\n│   └── web/           # Web infrastructure\n└── presentation/      # Presentation layer\n    └── handlers/      # HTTP handlers\n\nfrontend/\n├── src/\n│   └── lib.rs         # Yew WASM application\n├── index.html         # HTML template\n├── Cargo.toml         # Frontend dependencies\n└── Trunk.toml         # Build configuration\n```\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- **Rust** (latest stable version)\n- **Trunk** (for frontend building)\n- **WASM target** for Rust\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd ascii-converter\n   ```\n\n2. **Install Trunk and WASM target**\n   ```bash\n   cargo install trunk wasm-bindgen-cli\n   rustup target add wasm32-unknown-unknown\n   ```\n\n3. **Build the frontend**\n   ```bash\n   cd frontend\n   trunk build --release\n   cd ..\n   ```\n\n4. **Run the server**\n   ```bash\n   cargo run\n   ```\n\n5. **Open in browser**\n   ```\n   http://localhost:3000\n   ```\n\n### Alternative: Development Mode\n\nFor development with auto-reload:\n\n```bash\n# Terminal 1: Run backend\ncargo run\n\n# Terminal 2: Run frontend with hot reload\ncd frontend\ntrunk serve --port 8080\n```\n\nThen open `http://localhost:8080` for frontend with hot reload.\n\n## 📚 API Documentation\n\n### Base URL\n```\nhttp://localhost:3000\n```\n\n### Endpoints\n\n#### Health Check\n```http\nGET /health\n```\n\n**Response:**\n```json\n{\n  \"status\": \"healthy\",\n  \"service\": \"ascii-converter\",\n  \"version\": \"0.1.0\"\n}\n```\n\n#### Upload Image\n```http\nPOST /api/upload\nContent-Type: multipart/form-data\n```\n\n**Parameters:**\n- `image` - Image file (form field)\n\n**Response:**\n```json\n{\n  \"image_id\": \"uuid-string\",\n  \"format\": \"PNG\",\n  \"width\": 840,\n  \"height\": 859,\n  \"message\": \"Image uploaded successfully\"\n}\n```\n\n#### Convert to ASCII\n```http\nPOST /api/convert/{image_id}?width=100\u0026detail=high\u0026contrast=1.2\u0026blur=0.5\n```\n\n**Query Parameters:**\n- `width` (optional) - ASCII art width in characters (default: 100)\n- `detail` (optional) - Detail level: \"high\" or \"low\" (default: \"high\")\n- `contrast` (optional) - Contrast factor (0.1-3.0, default: 1.2)\n- `blur` (optional) - Blur sigma (0.0-5.0, default: 0.5)\n\n**Response:**\n```json\n{\n  \"ascii_art_id\": \"uuid-string\",\n  \"ascii_art\": \"ASCII art content...\",\n  \"width\": 100,\n  \"height\": 43\n}\n```\n\n## 🎨 Algorithm Improvements\n\n### 1. Enhanced Filtering\n- **Catmull-Rom** filter for resampling instead of Lanczos3\n- Better detail preservation during resizing\n\n### 2. Improved Contrast Processing\n- Adaptive contrast enhancement before conversion\n- Configurable contrast factor\n\n### 3. Gaussian Blur\n- Edge-preserving noise reduction\n- Configurable sigma parameter\n\n### 4. Adaptive Thresholding\n- Histogram equalization for better brightness distribution\n- Quantization to specified levels\n\n### 5. Perceptual Mapping\n- Gamma correction for better visual perception\n- Optimized ASCII character sets\n\n## 🧪 Testing\n\n```bash\n# Run backend tests\ncargo test\n\n# Check code formatting\ncargo fmt\n\n# Run linting\ncargo clippy\n\n# Test API endpoints\ncurl http://localhost:3000/health\n\n# Upload test image\ncurl -X POST -F \"image=@test.jpg\" http://localhost:3000/api/upload\n\n# Convert to ASCII\ncurl -X POST \"http://localhost:3000/api/convert/{image_id}?width=80\u0026detail=high\"\n```\n\n## 🛠️ Development\n\n### Project Structure\n\n- `src/domain/` - Pure business logic, framework-independent\n- `src/application/` - Use cases and application services\n- `src/infrastructure/` - Interface implementations (repositories, web)\n- `src/presentation/` - HTTP handlers and routes\n- `frontend/` - Rust WASM web application\n\n### Development Principles\n\n1. **Dependency Inversion** - High-level modules don't depend on low-level ones\n2. **Single Responsibility** - Each module has one reason to change\n3. **Open/Closed** - Open for extension, closed for modification\n4. **Interface Segregation** - Interfaces are client-specific\n\n### Adding New Features\n\n1. **Domain entities** - Add to `src/domain/entities/`\n2. **Use cases** - Implement in `src/application/use_cases/`\n3. **Repository interfaces** - Define in `src/domain/repositories/`\n4. **Repository implementations** - Add to `src/infrastructure/repositories/`\n5. **HTTP handlers** - Create in `src/presentation/handlers/`\n\n## 📦 Deployment\n\n### Docker (optional)\n\n```dockerfile\nFROM rust:1.70 as builder\nWORKDIR /app\nCOPY . .\nRUN cargo install trunk wasm-bindgen-cli\nRUN rustup target add wasm32-unknown-unknown\nRUN cd frontend \u0026\u0026 trunk build --release\nRUN cargo build --release\n\nFROM debian:bookworm-slim\nRUN apt-get update \u0026\u0026 apt-get install -y ca-certificates \u0026\u0026 rm -rf /var/lib/apt/lists/*\nCOPY --from=builder /app/target/release/ascii-converter /usr/local/bin/\nCOPY --from=builder /app/frontend/dist /app/frontend/dist\nWORKDIR /app\nEXPOSE 3000\nCMD [\"ascii-converter\"]\n```\n\n### Environment Variables\n\n- `PORT` - Server port (default: 3000)\n- `RUST_LOG` - Logging level (default: info)\n\n## 🤝 Contributing\n\n1. Fork the project\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'feat: add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n### Commit Convention\n\nThis project follows [Conventional Commits](https://www.conventionalcommits.org/):\n\n- `feat:` - New features\n- `fix:` - Bug fixes\n- `docs:` - Documentation changes\n- `style:` - Code style changes\n- `refactor:` - Code refactoring\n- `test:` - Adding tests\n- `chore:` - Maintenance tasks\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 📞 Support\n\nIf you have questions or suggestions:\n\n- Create an [Issue](https://github.com/0xataru/ascii-converter/issues)\n- Check [Discussions](https://github.com/0xataru/ascii-converter/discussions)\n\n## 🎯 Roadmap\n\n- [ ] Database persistence (PostgreSQL/SQLite)\n- [ ] User authentication and saved conversions\n- [ ] Batch processing for multiple images\n- [ ] Additional output formats (SVG, HTML)\n- [ ] Advanced image filters and effects\n- [ ] Docker containerization\n- [ ] CI/CD pipeline\n\n---\n\nMade with ❤️ and 🦀 by [Ataru](https://github.com/0xataru)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xataru%2Fascii-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xataru%2Fascii-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xataru%2Fascii-rs/lists"}