{"id":21354370,"url":"https://github.com/samestrin/image-manipulation-api-digitalocean","last_synced_at":"2026-04-13T03:35:23.566Z","repository":{"id":236685718,"uuid":"792976472","full_name":"samestrin/image-manipulation-api-digitalocean","owner":"samestrin","description":"A Python DigitalOcean App Platform based REST image manipulation API using Flask, NumPy, and OpenCV that runs in a Docker container.","archived":false,"fork":false,"pushed_at":"2024-05-08T19:19:12.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T17:46:52.242Z","etag":null,"topics":["api","docker","flask","image","image-processing","numpy","python","python3","rest","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Python","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/samestrin.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}},"created_at":"2024-04-28T04:38:02.000Z","updated_at":"2024-05-08T21:51:02.000Z","dependencies_parsed_at":"2024-05-08T20:32:30.110Z","dependency_job_id":"79977d88-83c3-4db9-b1f6-00d637399f07","html_url":"https://github.com/samestrin/image-manipulation-api-digitalocean","commit_stats":null,"previous_names":["samestrin/image-manipulation-api","samestrin/image-manipulation-api-digitalocean"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samestrin%2Fimage-manipulation-api-digitalocean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samestrin%2Fimage-manipulation-api-digitalocean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samestrin%2Fimage-manipulation-api-digitalocean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samestrin%2Fimage-manipulation-api-digitalocean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samestrin","download_url":"https://codeload.github.com/samestrin/image-manipulation-api-digitalocean/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243828098,"owners_count":20354433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","docker","flask","image","image-processing","numpy","python","python3","rest","rest-api"],"created_at":"2024-11-22T04:13:14.683Z","updated_at":"2025-10-11T14:03:05.057Z","avatar_url":"https://github.com/samestrin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image-manipulation-api-digitalocean\n\n[![Star on GitHub](https://img.shields.io/github/stars/samestrin/image-manipulation-api-digitalocean?style=social)](https://github.com/samestrin/image-manipulation-api-digitalocean/stargazers) [![Fork on GitHub](https://img.shields.io/github/forks/samestrin/image-manipulation-api-digitalocean?style=social)](https://github.com/samestrin/image-manipulation-api-digitalocean/network/members) [![Watch on GitHub](https://img.shields.io/github/watchers/samestrin/image-manipulation-api-digitalocean?style=social)](https://github.com/samestrin/image-manipulation-api-digitalocean/watchers)\n\n![Version 0.0.2](https://img.shields.io/badge/Version-0.0.2-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Built with Python](https://img.shields.io/badge/Built%20with-Python-green)](https://www.python.org/)\n\n**image-manipulation-api-digitalocean** is a Flask-based web service designed to perform various image processing tasks. It provides endpoints for resizing, cropping, rotating, converting to grayscale, adjusting brightness and contrast, flipping, applying filters, converting formats, adding text, and listing available fonts. This API deploys to DigitalOcean within a Docker container.\n\n## Dependencies\n\n- **Python**: The script runs in a Python3 environment.\n- **Flask**: This is used for creating the web server and handling the REST API HTTP requests.\n- **Flask-CORS**: Handles Cross-Origin Resource Sharing (CORS).\n- **gunicorn**: An extension that provides a Python WSGI HTTP Server for UNIX.\n- **NumPy**: Used for handling numerical data, particularly arrays.\n- **OpenCV**: Utilized for image processing tasks like reading, resizing, cropping, rotating, converting color spaces, applying filters, and encoding images.\n\n## Deploy to DigitalOcean App Platform\n\nClick this button to deploy the project to your Digital Ocean account:\n\n[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/samestrin/image-manipulation-api-digitalocean/tree/main\u0026refcode=2d3f5d7c5fbe)\n\n### Installation\n\nTo install image-manipulation-api-digitalocean, follow these steps:\n\nBegin by cloning the repository containing the image-manipulation-api-digitalocean to your local machine.\n\n```bash\ngit clone https://github.com/samestrin/image-manipulation-api-digitalocean/\n```\n\nNavigate to the project directory:\n\n```bash\ncd image-manipulation-api-digitalocean\n```\n\nInstall the required dependencies using pip:\n\n```bash\npip install -r src/requirements.txt\n```\n\n## **Endpoints**\n\n### **Resize Image**\n\n**Endpoint:** `/api/resize` **Method:** POST\n\nResize an image to the specified width and height.\n\n#### **Parameters**\n\n- `image`: Image file\n- `width`: Target width (integer)\n- `height`: Target height (integer)\n\n### **Crop Image**\n\n**Endpoint:** `/api/crop` **Method:** POST\n\nCrop an image to the specified coordinates.\n\n#### **Parameters**\n\n- `image`: Image file\n- `x1`: Starting x-coordinate of the crop area (integer)\n- `y1`: Starting y-coordinate of the crop area (integer)\n- `x2`: Ending x-coordinate of the crop area (integer)\n- `y2`: Ending y-coordinate of the crop area (integer)\n\n### **Rotate Image**\n\n**Endpoint:** `/api/rotate` **Method:** POST\n\nRotate an image by the specified angle.\n\n#### **Parameters**\n\n- `image`: Image file\n- `angle`: Rotation angle in degrees (float)\n\n### **Convert to Grayscale**\n\n**Endpoint:** `/api/grayscale` **Method:** POST\n\nConvert an image to grayscale.\n\n#### **Parameters**\n\n- `image`: Image file\n\n### **Adjust Brightness**\n\n**Endpoint:** `/api/brightness` **Method:** POST\n\nAdjust the brightness of an image.\n\n#### **Parameters**\n\n- `image`: Image file\n- `factor`: Brightness adjustment factor (float)\n\n### **Adjust Contrast**\n\n**Endpoint:** `/api/contrast` **Method:** POST\n\nAdjust the contrast of an image.\n\n#### **Parameters**\n\n- `image`: Image file\n- `factor`: Contrast adjustment factor (float)\n\n### **Flip Image**\n\n**Endpoint:** `/api/flip` **Method:** POST\n\nFlip an image horizontally or vertically.\n\n#### **Parameters**\n\n- `image`: Image file\n- `axis`: Flip axis (`horizontal` or `vertical`)\n\n### **Apply Filter**\n\n**Endpoint:** `/api/filter` **Method:** POST\n\nApply a filter to an image.\n\n#### **Parameters**\n\n- `image`: Image file\n- `filter_type`: Filter type (`blur`, `sharpen`, or `edge_detect`)\n\n### **Convert Image Format**\n\n**Endpoint:** `/api/convert` **Method:** POST\n\nConvert the format of an image.\n\n#### **Parameters**\n\n- `image`: Image file\n- `output_format`: Output format (e.g., `png`, `jpeg`)\n\n### **List Fonts**\n\n**Endpoint:** `/api/list_fonts` **Method:** GET\n\nList available fonts for adding text to images.\n\n### **Add Text to Image**\n\n**Endpoint:** `/api/add_text` **Method:** POST\n\nAdd text to an image.\n\n#### **Parameters**\n\n- `image`: Image file\n- `text`: Text to add\n- `font`: Font type (integer)\n- `font_size`: Font size (integer)\n- `left`: Left position of the text (integer)\n- `top`: Top position of the text (integer)\n- `color`: Text color in RGB format (optional)\n\n## **Error Handling**\n\nThe API handles errors gracefully and returns appropriate error responses.\n\n- **400 Bad Request**: Invalid request parameters.\n- **500 Internal Server Error**: Unexpected server error.\n\n## Frontend/Testing Interface\n\nThe [image-manipulation-api-demo](https://github.com/samestrin/image-manipulation-api-demo) project is a simple testing interface that utilizes Bootstrap and jQuery for AJAX-based interactions with the image-manipulation-api-digitalocean.\n\n## Contribute\n\nContributions to this project are welcome. Please fork the repository and submit a pull request with your changes or improvements.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Share\n\n[![Twitter](https://img.shields.io/badge/X-Tweet-blue)](https://twitter.com/intent/tweet?text=Check%20out%20this%20awesome%20project!\u0026url=https://github.com/samestrin/image-manipulation-api-digitalocean) [![Facebook](https://img.shields.io/badge/Facebook-Share-blue)](https://www.facebook.com/sharer/sharer.php?u=https://github.com/samestrin/image-manipulation-api-digitalocean) [![LinkedIn](https://img.shields.io/badge/LinkedIn-Share-blue)](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/samestrin/image-manipulation-api-digitalocean)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamestrin%2Fimage-manipulation-api-digitalocean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamestrin%2Fimage-manipulation-api-digitalocean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamestrin%2Fimage-manipulation-api-digitalocean/lists"}