Titanium is a high-performance web service that converts web pages to PNG images using Rust and Dioxus. It provides a simple HTTP API for rendering web pages as screenshots.
- Fast and efficient web page rendering
- Base64 URL encoding for safe URL transmission
- Configurable image dimensions
- Health check endpoint
- Docker support
- Comprehensive test suite
Before running the service, ensure you have the following installed:
- Rust (nightly toolchain)
- Docker (optional)
- The following system dependencies:
- pkg-config
- libssl-dev
- libgtk-3-dev
- libwebkit2gtk-4.0-dev
- libayatana-appindicator3-dev
- librsvg2-dev
- cmake
docker-compose up -d
- Clone the repository:
git clone https://github.com/developerfred/titanium.git
cd titanium
- Install dependencies:
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install pkg-config libssl-dev libgtk-3-dev libwebkit2gtk-4.0-dev \
libayatana-appindicator3-dev librsvg2-dev cmake
- Build and run:
cargo build --release
./target/release/titanium
The service exposes two main endpoints:
GET /render.png?url={base64_encoded_url}&w={width}&h={height}
Parameters:
url
: Base64-encoded URL of the webpage to renderw
: Width of the output imageh
: Height of the output image
Example:
# Convert https://example.com to base64 first
curl "http://localhost:3000/render.png?url=aHR0cHM6Ly9leGFtcGxlLmNvbQ==&w=800&h=600" > screenshot.png
GET /health
Returns "OK" if the service is running properly.
Using Docker:
./test.sh
Manually:
cargo test --all-features
cargo run
The service will start on http://localhost:3000
Titanium is a high-performance web service that converts web pages to PNG images using Rust and Dioxus. It provides a simple HTTP API for rendering web pages as screenshots.
- Fast and efficient web page rendering
- Base64 URL encoding for safe URL transmission
- Configurable image dimensions
- Health check endpoint
- Docker support
- Comprehensive test suite
Before running the service, ensure you have the following installed:
- Rust (nightly toolchain)
- Docker (optional)
- The following system dependencies:
- pkg-config
- libssl-dev
- libgtk-3-dev
- libwebkit2gtk-4.0-dev
- libayatana-appindicator3-dev
- librsvg2-dev
- cmake
docker-compose up -d
- Clone the repository:
git clone https://github.com/developerfred/titanium.git
cd titanium
- Install dependencies:
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install pkg-config libssl-dev libgtk-3-dev libwebkit2gtk-4.0-dev \
libayatana-appindicator3-dev librsvg2-dev cmake
- Build and run:
cargo build --release
./target/release/titanium
The service exposes two main endpoints:
GET /render.png?url={base64_encoded_url}&w={width}&h={height}
Parameters:
url
: Base64-encoded URL of the webpage to renderw
: Width of the output imageh
: Height of the output image
Example:
# Convert https://example.com to base64 first
curl "http://localhost:3000/render.png?url=aHR0cHM6Ly9leGFtcGxlLmNvbQ==&w=800&h=600" > screenshot.png
GET /health
Returns "OK" if the service is running properly.
Using Docker:
./test.sh
Manually:
cargo test --all-features
cargo run
The service will start on http://localhost:3000
- Fork the repository
- Create your feature branch (
git checkout -b feat/TitaniumFeature
) - Run the tests (
cargo test
) - Commit your changes (
git commit -m 'Add some TitaniumFeature'
) - Push to the branch (
git push origin feature/TitaniumFeature
) - Open a Pull Request