Thank you for your interest in contributing to PixelateR! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Standards
- Testing
- Submitting Changes
- Project Structure
By participating in this project, you agree to:
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what's best for the community
- Show empathy towards other community members
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/yourusername/pixelateR.git cd pixelateR - Add upstream remote:
git remote add upstream https://github.com/muhammad1438/pixelateR.git
- Create a branch for your changes:
git checkout -b feature/your-feature-name
- Rust 1.70+ (install via rustup)
- Node.js 16+ and npm
- FFmpeg (for video processing)
- wasm-pack (for WebAssembly builds)
# Build CLI tool
cargo build
# Run tests
cargo test
# Build WASM module
cd wasm
wasm-pack build --target web
cd ..
# Build web interface
cd web
npm install
npm run build
cd ..# Terminal 1: Build WASM in watch mode
cd wasm
cargo watch -i pkg -s "wasm-pack build --target web"
# Terminal 2: Run web dev server
cd web-serve
npm install
npm startOpen http://localhost:8080 to see the web interface.
Before creating a bug report:
- Check existing issues to avoid duplicates
- Collect information about your environment (OS, Rust version, browser)
- Create a minimal reproducible example if possible
Include in your bug report:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Screenshots or error messages
- System information
Enhancement suggestions are welcome! Please:
- Use a clear and descriptive title
- Provide detailed description of the proposed feature
- Explain why this enhancement would be useful
- Include examples or mockups if applicable
Good pull requests include:
- Clear description of changes
- Reference to related issues
- Tests for new functionality
- Documentation updates
- No unrelated changes
- Formatting: Use
cargo fmtbefore committing - Linting: Run
cargo clippyand fix warnings - Naming:
snake_casefor functions and variablesPascalCasefor types and traitsSCREAMING_SNAKE_CASEfor constants
- Comments:
- Use
///for public API documentation - Use
//for implementation comments
- Use
- Error Handling: Prefer
Result<T, E>over panics
Example:
/// Applies Bayer dithering to an image.
///
/// # Arguments
/// * `img` - The input image
/// * `palette` - The color palette to use
///
/// # Returns
/// The dithered image or an error
pub fn apply_bayer_dither(
img: &Image,
palette: &Palette,
) -> Result<Image, DitherError> {
// Implementation
}- Formatting: Use Prettier (configured in web/)
- Linting: Run ESLint
- Types: Prefer explicit types over
any - Naming:
camelCasefor variables and functionsPascalCasefor classes and interfaces
- Comments: Use JSDoc for public APIs
Example:
/**
* Transforms an image using the specified settings.
* @param imageData - The input image data
* @param settings - Transformation settings
* @returns The transformed image data
*/
async function transformImage(
imageData: ImageData,
settings: TransformSettings
): Promise<ImageData> {
// Implementation
}- Keep README.md up to date
- Document new features in relevant docs/
- Add code examples for new functionality
- Update CHANGELOG.md for significant changes
# Run all tests
cargo test
# Run specific test
cargo test test_bayer_dithering
# Run with output
cargo test -- --nocaptureWrite tests for:
- New dithering algorithms
- Color quantization logic
- Edge detection filters
- CLI argument parsing
Example test:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_bayer_threshold() {
let threshold = bayer_threshold(0, 0);
assert_eq!(threshold, 0.0 / 16.0);
}
}Place integration tests in tests/:
cargo test --test integration_tests# Run benchmarks
cargo bench
# Specific benchmark
cargo bench floyd_steinberg-
Commit your changes:
git add . git commit -m "feat: add new dithering algorithm"
-
Follow commit message conventions:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Formatting, no code changerefactor:Code restructuringtest:Adding testschore:Maintenance tasks
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Go to GitHub and click "New Pull Request"
- Fill out the PR template
- Link related issues
- Request review
-
Respond to feedback:
- Address reviewer comments
- Push additional commits if needed
- Mark conversations as resolved
PixelateR/
├── src/
│ ├── cli/ # Command-line interface
│ ├── color/ # Color quantization and palettes
│ │ ├── palette.rs # Palette definitions (Pico8, etc.)
│ │ └── quantize.rs
│ ├── dither/ # Dithering algorithms
│ │ ├── bayer.rs # Ordered dithering
│ │ ├── floyd.rs # Error diffusion
│ │ └── riemersma.rs
│ ├── filter/ # Image filters
│ │ ├── brightness.rs
│ │ ├── contrast.rs
│ │ └── halftone.rs
│ ├── image/ # Core image types
│ └── video/ # Video processing (future)
├── wasm/ # WebAssembly bindings
│ └── src/lib.rs
├── web/ # TypeScript frontend
│ ├── src/
│ │ └── main.ts
│ └── index.html
├── tests/ # Integration tests
├── benches/ # Benchmarks
├── docs/ # Documentation
└── examples/ # Sample inputs/outputs
- src/lib.rs: Library entry point, exports public API
- src/cli/main.rs: CLI tool entry point
- wasm/src/lib.rs: WASM bindings for web interface
- web/src/main.ts: Web application logic
- Cargo.toml: Rust dependencies and metadata
- GPU acceleration via wgpu
- Additional color palettes (Gameboy, NES, C64)
- Multithreaded batch processing
- Pure Rust video encoding (rav1e)
- Python bindings via PyO3
- Web interface: video upload support
- Web interface: custom palette editor
- Advanced filters (CRT scan lines, bloom)
- More dithering algorithms (Atkinson, Sierra)
- Color space conversions (LAB, LCH)
- Video tutorial for web interface
- Algorithm comparison guide
- Performance optimization guide
- API documentation improvements
- Increase test coverage to 80%+
- Add visual regression tests
- Benchmark suite for all algorithms
- Cross-platform CI/CD
- Questions: Open a GitHub Discussion
- Bugs: Create an Issue with the bug template
- Chat: Join our Discord (link in README)
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to PixelateR! Your efforts help make pixel art processing accessible to everyone.