{"id":18888074,"url":"https://github.com/codex-team/capella","last_synced_at":"2025-04-14T23:11:10.281Z","repository":{"id":53083141,"uuid":"106433135","full_name":"codex-team/capella","owner":"codex-team","description":"Cloud service for image storage and delivery","archived":false,"fork":false,"pushed_at":"2021-08-26T22:42:10.000Z","size":47862,"stargazers_count":129,"open_issues_count":15,"forks_count":24,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-28T11:11:45.038Z","etag":null,"topics":["api","capella","cloud-service","codex","crop-image","filter","image-storage","open-source","pictures","resize-images"],"latest_commit_sha":null,"homepage":"https://capella.pics/","language":"PHP","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/codex-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2017-10-10T15:07:23.000Z","updated_at":"2025-01-21T20:01:26.000Z","dependencies_parsed_at":"2022-09-12T11:14:38.653Z","dependency_job_id":null,"html_url":"https://github.com/codex-team/capella","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcapella","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcapella/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcapella/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcapella/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-team","download_url":"https://codeload.github.com/codex-team/capella/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975316,"owners_count":21192210,"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","capella","cloud-service","codex","crop-image","filter","image-storage","open-source","pictures","resize-images"],"created_at":"2024-11-08T07:42:03.036Z","updated_at":"2025-04-14T23:11:10.257Z","avatar_url":"https://github.com/codex-team.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Сapella](https://capella.pics)\n\nCloud service for image storage and delivery. Upload files and accept image-filters on the fly with the simple API.\n\nMade with :heart: by [CodeX](https://codex.so)\n\n[![](docs/assets/drag-n-drop.gif)](https://capella.pics/image/0351d892-44ba-4c5f-9d34-0af0f9e33651)\n\n\u003e :warning: **Warning**\n\u003e\n\u003e https://capella.pics is currently in beta.\n\u003e \n\u003e Capella requires a project's token for image uploading. We are testing the service for a fast, stable and secure work.\n\u003e \n\u003e You will be able to enroll your project to get a token later. Keep track of Capella's updates on https://github.com/codex-team/capella.\n\n## Content\n\n* [Usage](#usage)\n* [Capella SDKs](#capella-sdks)\n* [Upload API](#upload-api)\n    * [Request](#request)\n    * [Response](#response)\n    * [Example](#example)\n* [Get image](#get-image)\n    * [Filters](#filters)\n* [Development and deployment](#development-and-deployment)\n* [Issues and improvements](#issues-and-improvements)\n\n## Usage\n\n1. Use [capella.pics](https://capella.pics) site, [SDK](#capella-sdks) or [API](#upload-api) to upload an image.\n\n2. Add filters to uploaded image's URL and get processed image.\n\n### File requirements\n\nMaximum size for the image file is `15MB`.\n\nCapella supports these types of images:\n\n- jpg\n- jpeg\n- png\n- gif\n- bmp\n- tiff\n\nPlease note that each uploaded file will be converted to JPG with a white background and quality 90.\n\n## Capella SDKs\n\n- [PHP](https://github.com/codex-team/capella.php)\n- [Node.js](https://github.com/codex-team/capella.nodejs)\n- [Go](https://github.com/codex-team/capella.go)\n- [Python](https://github.com/codex-team/pycapella)\n- [Scala](https://github.com/codex-team/capella.scala)\n\n## Upload API\n\n### Request\n\nYou can upload image file or send link to the image from your app by making a `POST` request to `https://capella.pics/upload` with the following data:\n\n- file in `file` field or image url in `link` field\n- project's token in `token` field\n\nYou will get a JSON response from server.\n\n### Response\n\nEach response will have at least `success` and `message` fields.\n\n| Field     | Type    | Description       |\n|-----------|---------|-------------------|\n| `success` | Boolean | Request validness |\n| `message` | String  | Result message    |\n\n#### Success\n\n| Field     | Type    | Description or value            |\n|-----------|---------|---------------------------------|\n| `success` | Boolean | `true`                          |\n| `message` | String  | `Image uploaded`                |\n| `id`      | String  | Image id                        |\n| `url`     | String  | Full link to the uploaded image |\n| `mime`    | String  | Mime type of the uploaded image |\n| `width`   | Integer | Image's width                   |\n| `height`  | Integer | Image's height                  |\n| `color`   | String  | Average hex color of the image  |\n| `size`    | Integer | Image's size in bytes           |\n\n```json\n{\n    \"success\": true,\n    \"message\": \"Image uploaded\",\n    \"id\": \"69256e83-66e1-449a-b0c2-5414d332e3a6\",\n    \"url\": \"https:\\/\\/capella.pics\\/69256e83-66e1-449a-b0c2-5414d332e3a6.jpg\",\n    \"mime\": \"image\\/jpg\",\n    \"width\": 1080,\n    \"height\": 700,\n    \"color\": \"#9d908d\",\n    \"size\": \"176769\"\n}\n```\n\n#### Failure\n\n| Field     | Type    | Description or value          |\n|-----------|---------|-------------------------------|\n| `success` | Boolean | `false`                       |\n| `message` | String  | Reason why request was failed |\n\n```json\n{\n    \"success\": false,\n    \"message\": \"Wrong source mime-type\"\n}\n```\n\n#### List of messages for failed requests\n\n| Code      | Message                           |  Description                              |\n|-----------|-----------------------------------|-------------------------------------------|\n| **`400`** | `File or link is missing`         | No expected data was found                |\n| **`400`** | `File is missing`                 | Filename is missing                       |\n| **`400`** | `Link is missing`                 | Field link is empty                       |\n| **`400`** | `Wrong source mime-type`          | No support file with this mime-type       |\n| **`400`** | `Source is too big`               | File size exceeds the limit               |\n| **`400`** | `Source is damaged`               | Source has no data, size or mime-type     |\n| **`400`** | `Can't get headers for this URL`  | Wrong url was passed                      |\n| **`403`** | `Project token is bad or missing` | Request method is not POST                |\n| **`405`** | `Method not allowed`              | Request method is not POST                |\n| **`429`** | `Too Many Requests`               | Client has exceed plan limit. Retry later |\n\n### Example\n\n#### CURL\n\n```bash\n# Upload file\n\ncurl -X POST https://capella.pics/upload -F \"file=@/path/to/image.png\" -F \"token=aaaa-bbbb-cccc-dddd\"\n```\n\n```bash\n# Upload image by link\n\ncurl -X POST https://capella.pics/upload -d \"link=https://path.to/image.png\" -d \"token=aaaa-bbbb-cccc-dddd\"\n```\n\n#### Python\n\n```python\n# Upload file\n\nimport requests\nimport json\n\nfiles = {\n    'file': open('./image.png','rb')\n}\n\ndata = {\n    'token': 'aaaa-bbbb-cccc-dddd'\n}\n\nr = requests.post('https://capella.pics/upload', files=files, data=data)\nresponse = json.loads(r.content.decode('utf-8'))\n\nprint(response)\n```\n\n```python\n# Upload image by link\n\nimport requests\nimport json\n\ndata = {\n    'link': 'https://path.to/image.png',\n    'token': 'aaaa-bbbb-cccc-dddd'\n}\n\nr = requests.post('https://capella.pics/upload', data=data)\nresponse = json.loads(r.content.decode('utf-8'))\n\nprint(response)\n```\n\n## Getting image\n\nYou can get each uploaded image by the following URL scheme with or without extension.\n\n`https://capella.pics/\u003cimage_id\u003e` or `https://capella.pics/\u003cimage_id\u003e.jpg`\n\n[![](https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6)](https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6)\n\n### Filters\n\nApply filter by adding it at the end of the image URL.\n\n`https://capella.pics/\u003cimage_id\u003e/\u003cfilter\u003e/\u003cparams\u003e`\n\nYou can use as many filters as you want.\n\n`/\u003cfilter_1\u003e/\u003cparams_1\u003e/\u003cfilter_2\u003e/\u003cparams_2\u003e...`\n\nNote that the order of filters affects the result:\n\n| Filter                 | Result                                                                        |\n|------------------------|-------------------------------------------------------------------------------|\n| `/resize/100/crop/200` | [![][codex-stickers-resize-100-crop-200]][codex-stickers-resize-100-crop-200] |\n| `/crop/200/resize/100` | [![][codex-stickers-crop-200-resize-100]][codex-stickers-crop-200-resize-100] |\n\n[codex-stickers-resize-100-crop-200]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/resize/100/crop/200\n[codex-stickers-crop-200-resize-100]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/crop/200/resize/100\n\n#### Resize\n\nScale the image to the largest size such that both its width and its height can fit inside the target rectangle.\n\n| Param    | Type    | Description                                                                  |\n|----------|---------|------------------------------------------------------------------------------|\n| `width`  | Integer | Maximum image`s width or maximum target square`s size if no height was given |\n| `height` | Integer | (optional) Maximum image's height                                            |\n\nExample: `https://capella.pics/\u003cimage_id\u003e/resize/300x400`\n\n| Filter                | Result                                                              |\n|-----------------------|---------------------------------------------------------------------|\n| `/resize/300x400`     | [![][codex-stickers-resize-300-400]][codex-stickers-resize-300-400] |\n| `/resize/150`         | [![][codex-stickers-resize-150]][codex-stickers-resize-150]         |\n\n[codex-stickers-resize-150]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/resize/150\n[codex-stickers-resize-300-400]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/resize/300x400\n\n\n#### Crop\n\nCover the target rectangle by the image. Nice tool for creating covers or profile pics.\n\n| Param    | Type    | Description                                                             |\n|----------|---------|-------------------------------------------------------------------------|\n| `width`  | Integer | Target rectangle`s width or target square`s size if no height was given |\n| `height` | Integer | (optional) Target rectangle height                                      |\n\nExample: `https://capella.pics/\u003cimage_id\u003e/crop/150`\n\n| Filter              | Result                                                          |\n|---------------------|-----------------------------------------------------------------|\n| `/crop/150`         | [![][codex-stickers-crop-150]][codex-stickers-crop-150]         |\n| `/crop/200x400`     | [![][codex-stickers-crop-200-400]][codex-stickers-crop-200-400] |\n| `/crop/400x200`     | [![][codex-stickers-crop-400-200]][codex-stickers-crop-400-200] |\n\n[codex-stickers-crop-150]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/crop/150\n[codex-stickers-crop-200-400]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/crop/200x400\n[codex-stickers-crop-400-200]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/crop/400x200\n\n\n##### Additional params\n\nIf you need to crop an area from specified point then pass these params.\n\nNote that this way `width` and `height` will be size params for the cropped area.\n\n| Param    | Type    | Description |\n|----------|---------|-------------|\n| `x`      | Integer | Left indent |\n| `y`      | Integer | Top indent  |\n\nExample: `https://capella.pics/\u003cimage_id\u003e/crop/400x300\u0026500,150`\n\n| Filter                  | Result                                                                          |\n|-------------------------|---------------------------------------------------------------------------------|\n| `/crop/400x300\u0026500,150` | [![][codex-stickers-crop-400-300-500-150]][codex-stickers-crop-400-300-500-150] |\n| `/crop/300x400\u0026200,150` | [![][codex-stickers-crop-300-400-200-150]][codex-stickers-crop-300-400-200-150] |\n\n[codex-stickers-crop-400-300-500-150]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/crop/400x300\u0026500,150\n[codex-stickers-crop-300-400-200-150]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/crop/300x400\u0026200,150\n\n#### Pixelize\n\nRender image using large colored blocks.\n\n| Param     | Type    | Description                          |\n|-----------|---------|--------------------------------------|\n| `pixels`  | Integer | Number of pixels on the largest side |\n\nExample: `https://capella.pics/\u003cimage_id\u003e/pixelize/20`\n\n| Filter         | Result                                                        |\n|----------------|---------------------------------------------------------------|\n| `/pixelize/20` | [![][codex-stickers-pixelize-20]][codex-stickers-pixelize-20] |\n| `/pixelize/50` | [![][codex-stickers-pixelize-50]][codex-stickers-pixelize-50] |\n\n[codex-stickers-pixelize-20]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/pixelize/20\n[codex-stickers-pixelize-50]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/pixelize/50\n\n#### Cover\n\nPlace image to cover.\n\n| Param   | Type   | Description                                   |\n|---------|--------|-----------------------------------------------|\n| `color` | String | Hex code of cover's color without hash symbol | \n\nExample: `https://capella.pics/\u003cimage_id\u003e/cover/eff2f5`\n\n| Filter                | Result                                                                      |\n|-----------------------|-----------------------------------------------------------------------------|\n| `/cover/eff2f5`       | [![][codex-stickers-cover-eff2f5]][codex-stickers-cover-eff2f5]             |\n| `/crop/150/cover/fee` | [![][codex-stickers-crop-150-cover-fee]][codex-stickers-crop-150-cover-fee] |\n\n[codex-stickers-cover-eff2f5]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/cover/eff2f5\n[codex-stickers-crop-150-cover-fee]: https://capella.pics/69256e83-66e1-449a-b0c2-5414d332e3a6/crop/150/cover/fee\n\n## Development and deployment\n\nYou can run your own Capella for usage or development. Follow our [development](docs/development.md) and [deployment](docs/deployment.md) guides.\n\n## Issues and improvements\n\nAsk a question or report a bug on the [create issue page](https://github.com/codex-team/capella/issues/new).\n\nKnow how to improve Capella? [Fork it](https://github.com/codex-team/capella) and send pull request.\n\nYou can also drop a few lines to [CodeX Team's email](mailto:team@codex.so).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fcapella","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-team%2Fcapella","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fcapella/lists"}