{"id":33091513,"url":"https://github.com/kritihq/kriti-images","last_synced_at":"2026-01-12T01:58:35.323Z","repository":{"id":317071023,"uuid":"1065868975","full_name":"kritihq/kriti-images","owner":"kritihq","description":"Transform \u0026 Optimise images (Cloudflare Images alternative)","archived":false,"fork":false,"pushed_at":"2025-12-28T16:22:51.000Z","size":11133,"stargazers_count":179,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-29T00:53:11.871Z","etag":null,"topics":["go","golang","image-processing"],"latest_commit_sha":null,"homepage":"https://kritiimages.com","language":"Go","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/kritihq.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-09-28T15:37:10.000Z","updated_at":"2025-12-29T00:24:17.000Z","dependencies_parsed_at":"2025-09-28T17:44:13.185Z","dependency_job_id":null,"html_url":"https://github.com/kritihq/kriti-images","commit_stats":null,"previous_names":["kritihq/kriti-images"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/kritihq/kriti-images","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritihq%2Fkriti-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritihq%2Fkriti-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritihq%2Fkriti-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritihq%2Fkriti-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kritihq","download_url":"https://codeload.github.com/kritihq/kriti-images/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kritihq%2Fkriti-images/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["go","golang","image-processing"],"created_at":"2025-11-14T18:00:27.866Z","updated_at":"2026-01-12T01:58:35.316Z","avatar_url":"https://github.com/kritihq.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Kriti Images\n\nA high-performance image transformation service built in Go, providing a URL-based API for real-time image processing. An open-source alternative to Cloudflare Images and ImageKit.\n\n**[Website](https://kritiimages.com) | [Demo](https://kritiimages.com/docs/transformations)**\n\n### Celebrating 150+ stars. Thank You!\n\n![Star History Chart](https://api.star-history.com/svg?repos=kritihq/kriti-images\u0026type=date\u0026legend=bottom-right)\n\n## 🚀 Features\n\n- **URL-based transformations** - Transform images through simple URL parameters\n- **Multiple formats** - Support for JPEG, PNG, and WebP\n- **Rich transformations** - Resize, crop, rotate, blur, adjust brightness/contrast, and more\n- **Smart resizing modes** - Contains, cover, crop, pad, squeeze, and scale-down options\n- **Color adjustments** - Brightness, contrast, saturation, gamma correction\n- **Background colors** - Support for hex, RGB, and named colors\n- **High performance** - Built with Go and optimized for speed\n- **CDN-friendly** - Proper caching headers for optimal CDN integration\n- **AWS S3 support** - Store images in AWS S3 and serve them through Kriti Images\n- **Use URL for image source** - No need to upload images to storage, provide URL instead\n\n## 📖 Quick Example\n\nTransform an image by modifying the URL:\n\n```bash\n# Original image\nGET /cgi/images/tr:quality=100/image1.jpg\n\n# Resize to 300px width, auto height\nGET /cgi/images/tr:width=300/image1.jpg\n\n# Resize with specific fit mode and background\nGET /cgi/images/tr:width=400,height=300,fit=pad,background=blue/image1.jpg\n\n# Multiple transformations\nGET /cgi/images/tr:width=500,brightness=20,contrast=30,format=webp/image1.jpg\n\n# Blur with rotation\nGET /cgi/images/tr:blur=10,rotate=45,background=white/image1.jpg\n\n# URL based image source, always escape image path\nGET /cgi/images/tr:flip=hv/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1764782979306-1e489462d895\n```\n\n## 🛠 Supported Transformations\n\n### Resize \u0026 Cropping\n- `width` - Set image width (1-10000px)\n- `height` - Set image height (1-10000px)\n- `fit` - Resize behavior: `contain`, `cover`, `crop`, `pad`, `squeeze`, `scaledown`\n\n### Image Adjustments\n- `brightness` - Adjust brightness (-100 to 100)\n- `contrast` - Adjust contrast (-100 to 100)\n- `saturation` - Adjust color saturation (-100 to 500)\n- `gamma` - Gamma correction (0.1 to 2.0)\n- `blur` - Gaussian blur (1 to 250)\n- `sharpen` - Unsharp mask sharpening (0.5 to 1.5)\n\n### Rotation \u0026 Flipping\n- `rotate` - Rotate image (0-360° or shortcuts: `90`, `cw`, `180`, `270`, `ccw`)\n- `flip` - Flip image (`h` for horizontal, `v` for vertical, `hv` for both)\n\n### Visual Effects\n- `radius` - Border radius for rounded corners (pixels: `10`, `20px` or percentage: `15%`, `25%`)\n\n### Format \u0026 Quality\n- `format` - Output format (`jpeg`, `png`, `webp`)\n- `quality` - JPEG/WebP quality (1-100, higher = better quality)\n- `background` - Background color (hex: `#ff0000`, named: `red`, rgb: `rgb(255,0,0)`)\n\n## 🔧 Upload Images\n\n\u003e **Note**: This functionality is still experimental and _could be removed or moved (api route)_ in future updates. It is disabled by default and must be enabled using configs.\n\n### Enabling Upload APIs\n\n**YAML Configuration:**\n```yaml\nexperimental:\n  enable_upload_api: true\n```\n\n**TOML Configuration:**\n```toml\n[experimental]\nenable_upload_api = true\n```\n\n### New Image\n\n**Endpoint:** `POST /api/v0/images`\n\n**Content-Type:** `multipart/form-data`\n\n**Parameters:**\n- `image` (required): The image file to upload\n- `filename` (optional): Custom filename for the uploaded image. If not provided, uses the original filename.\n\n**Supported Formats:**\n- JPEG (`.jpg`, `.jpeg`)\n- PNG (`.png`)\n- WebP (`.webp`)\n\n**Example using cURL:**\n```bash\ncurl -X POST http://localhost:8080/api/v0/images \\\n  -F \"image=@/path/to/your/image.jpg\" \\\n  -F \"filename=my-custom-name.jpg\"\n```\n\n### Update Existing Image\n\n**Endpoint:** `PUT /api/v0/images`\n\n**Content-Type:** `multipart/form-data`\n\n**Parameters:**\n- `image` (required): The image file to upload\n- `filename` (required): The filename of the existing image to update\n\n**Example using cURL:**\n```bash\ncurl -X PUT http://localhost:8080/api/v0/images \\\n  -F \"image=@/path/to/your/new-image.jpg\" \\\n  -F \"filename=existing-image.jpg\"\n```\n\n## 🏗 Build \u0026 Run\n\n### Prerequisites\n- Go 1.24.6 or later\n- Git\n- AWS credentials (Optional)\n\n### Development Setup\n\n1. **Prepare sample images**\n   ```bash\n   mkdir -p web/static/assets\n   # Add your test images to web/static/assets/\n   ```\n\n2. **Run the server**\n   ```bash\n   go run main.go\n   ```\n\n3. **Access the service**\n   - API: `http://localhost:8080/cgi/images/tr:\u003ctransformations\u003e/\u003cimage-name\u003e`\n   - Demo page: `http://localhost:8080/demo`\n\n   \u003e Always URL escape \u003cimage-name\u003e path\n\n### Production Build\n\n```bash\n# Build binary\ngo build -o kriti-images main.go\n\n# Run with production settings\n./kriti-images\n```\n\n### Docker\n\nCheck out [Docker README](docker/README.md) for details.\n\n## 🔧 Configuration\n\nThe service uses external configuration files with the [Viper](https://github.com/spf13/viper) library. Configuration can be provided in YAML or TOML format.\n\n### Configuration Files\n\nCreate a `config.yaml` or `config.toml` file in the project root.\n\n### Configuration Options\n\n- **server.port** - Server port (default: 8080)\n- **server.enable_print_routes** - Enable route debugging (default: false)\n- **server.read_timeout** - Request read timeout (default: 30s)\n- **server.write_timeout** - Response write timeout (default: 30s)\n- **images.source** - Network source, `local` or `awss3` (default: local)\n- **images.local.base_path** - Image source directory (default: \"\")\n- **images.aws.s3.bucket** - AWS S3 bucket name (default: \"\")\n- **images.max_image_dimension** - Maximum image dimension, any source image beyond will not be processed (default: 8192 (8K))\n- **images.max_file_size_in_bytes** - Maximum image file size, any source image beyond will not be processed (default: 52428800 (50MB))\n- **server.limiter.max** - Rate limit per minute (default: 100)\n- **server.limiter.expiration** - Rate limit window (default: 1m)\n- **experimental.enable_upload_api** - Enable/disable upload APIs (POST/PUT /api/v0/images) (default: false)\n\n\u003e to use `awss3` as `images.source` you must have AWS CLI installed and configured\n\n\u003e configs under `experimental` are temporary and so are the features they relate to. These configs \u0026 and the related features could be removed/moved in future releases\n\n## 🌐 API Reference\n\n### Base URL Structure\n```\n/cgi/images/tr:\u003ctransformations\u003e/\u003cimage-path\u003e\n```\n\n### Transformation Syntax\nMultiple transformations are separated by commas:\n```\ntr:width=300,height=200,format=webp,quality=80\n```\n\n## 🚦 Health \u0026 Monitoring\n\n- **Health Check**: `GET /health/ready` - Returns 200 when service is ready\n- **Liveness Check**: `GET /health/live` - Returns 200 when service is alive\n- **Metrics**: `GET /metrics` - Prometheus-compatible metrics\n\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkritihq%2Fkriti-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkritihq%2Fkriti-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkritihq%2Fkriti-images/lists"}