• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cloud service for image storage and delivery

Сapella

Cloud service for image storage and delivery. Upload files and accept image-filters on the fly with the simple API.

Made with ❤️ by CodeX

⚠️ Warning

https://capella.pics is currently in beta.

Capella requires a project's token for image uploading. We are testing the service for a fast, stable and secure work.

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.

Content

Usage

  1. Use capella.pics site, SDK or API to upload an image.

  2. Add filters to uploaded image's URL and get processed image.

File requirements

Maximum size for the image file is 15MB.

Capella supports these types of images:

  • jpg
  • jpeg
  • png
  • gif
  • bmp
  • tiff

Please note that each uploaded file will be converted to JPG with a white background and quality 90.

Capella SDKs

Upload API

Request

You 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:

  • file in file field or image url in link field
  • project's token in token field

You will get a JSON response from server.

Response

Each response will have at least success and message fields.

Field Type Description
success Boolean Request validness
message String Result message

Success

Field Type Description or value
success Boolean true
message String Image uploaded
id String Image id
url String Full link to the uploaded image
mime String Mime type of the uploaded image
width Integer Image's width
height Integer Image's height
color String Average hex color of the image
size Integer Image's size in bytes
{
    "success": true,
    "message": "Image uploaded",
    "id": "69256e83-66e1-449a-b0c2-5414d332e3a6",
    "url": "https:\/\/capella.pics\/69256e83-66e1-449a-b0c2-5414d332e3a6.jpg",
    "mime": "image\/jpg",
    "width": 1080,
    "height": 700,
    "color": "#9d908d",
    "size": "176769"
}

Failure

Field Type Description or value
success Boolean false
message String Reason why request was failed
{
    "success": false,
    "message": "Wrong source mime-type"
}

List of messages for failed requests

Code Message Description
400 File or link is missing No expected data was found
400 File is missing Filename is missing
400 Link is missing Field link is empty
400 Wrong source mime-type No support file with this mime-type
400 Source is too big File size exceeds the limit
400 Source is damaged Source has no data, size or mime-type
400 Can't get headers for this URL Wrong url was passed
403 Project token is bad or missing Request method is not POST
405 Method not allowed Request method is not POST
429 Too Many Requests Client has exceed plan limit. Retry later

Example

CURL

# Upload file

curl -X POST https://capella.pics/upload -F "file=@/path/to/image.png" -F "token=aaaa-bbbb-cccc-dddd"
# Upload image by link

curl -X POST https://capella.pics/upload -d "link=https://path.to/image.png" -d "token=aaaa-bbbb-cccc-dddd"

Python

# Upload file

import requests
import json

files = {
    'file': open('./image.png','rb')
}

data = {
    'token': 'aaaa-bbbb-cccc-dddd'
}

r = requests.post('https://capella.pics/upload', files=files, data=data)
response = json.loads(r.content.decode('utf-8'))

print(response)
# Upload image by link

import requests
import json

data = {
    'link': 'https://path.to/image.png',
    'token': 'aaaa-bbbb-cccc-dddd'
}

r = requests.post('https://capella.pics/upload', data=data)
response = json.loads(r.content.decode('utf-8'))

print(response)

Getting image

You can get each uploaded image by the following URL scheme with or without extension.

https://capella.pics/<image_id> or https://capella.pics/<image_id>.jpg

Filters

Apply filter by adding it at the end of the image URL.

https://capella.pics/<image_id>/<filter>/<params>

You can use as many filters as you want.

/<filter_1>/<params_1>/<filter_2>/<params_2>...

Note that the order of filters affects the result:

Filter Result
/resize/100/crop/200
/crop/200/resize/100

Resize

Scale the image to the largest size such that both its width and its height can fit inside the target rectangle.

Param Type Description
width Integer Maximum images width or maximum target squares size if no height was given
height Integer (optional) Maximum image's height

Example: https://capella.pics/<image_id>/resize/300x400

Filter Result
/resize/300x400
/resize/150

Crop

Cover the target rectangle by the image. Nice tool for creating covers or profile pics.

Param Type Description
width Integer Target rectangles width or target squares size if no height was given
height Integer (optional) Target rectangle height

Example: https://capella.pics/<image_id>/crop/150

Filter Result
/crop/150
/crop/200x400
/crop/400x200
Additional params

If you need to crop an area from specified point then pass these params.

Note that this way width and height will be size params for the cropped area.

Param Type Description
x Integer Left indent
y Integer Top indent

Example: https://capella.pics/<image_id>/crop/400x300&500,150

Filter Result
/crop/400x300&500,150
/crop/300x400&200,150

Pixelize

Render image using large colored blocks.

Param Type Description
pixels Integer Number of pixels on the largest side

Example: https://capella.pics/<image_id>/pixelize/20

Filter Result
/pixelize/20
/pixelize/50

Cover

Place image to cover.

Param Type Description
color String Hex code of cover's color without hash symbol

Example: https://capella.pics/<image_id>/cover/eff2f5

Filter Result
/cover/eff2f5
/crop/150/cover/fee

Development and deployment

You can run your own Capella for usage or development. Follow our development and deployment guides.

Issues and improvements

Ask a question or report a bug on the create issue page.

Know how to improve Capella? Fork it and send pull request.

You can also drop a few lines to CodeX Team's email.

More Repositories

1

editor.js

A block-style editor with clean JSON output
TypeScript
28,095
star
2

codex.docs

Free Docs app powered by Editor.js ecosystem
TypeScript
681
star
3

codex.notes

WIP: crossplatform desktop notes application based on Electron and Editor.js
JavaScript
137
star
4

hawk

Fast and lightweight errors tracking service
JavaScript
90
star
5

codex.media

A platform for building a modern UGC media
PHP
90
star
6

deeplinker

Use one link to open installed apps or web pages
JavaScript
63
star
7

js-notifier

Notifications for websites
JavaScript
50
star
8

codex.shortcuts

Micro-library for dispatching keyboard shortcuts in Javascript
JavaScript
49
star
9

email-provider

Detect email provider by address
JavaScript
45
star
10

icons

Dozens of cute svg icons made with love by CodeX for your projects. No dependencies required. Free to use and share.
TypeScript
39
star
11

codex.bot

Working team assistant
Python
38
star
12

action-check-domain

Watch SSL certs and registry date expiring for your domains
JavaScript
37
star
13

ajax

Just another AJAX requests helper
JavaScript
32
star
14

deployserver

Deploy your project automatically when git branch was updated.
Python
28
star
15

check-ssl-cert-expire-date

Checks SSL certificates expire date and sends alerts to the Slack or Telegram when date X is coming
Python
27
star
16

capella-tray

Upload screenshots instantly to Capella and get link directly to clipboard
JavaScript
25
star
17

codex.tooltips

JavaScript module to add custom tooltips to any element
TypeScript
22
star
18

hawk.javascript

JavaScript errors tracker
TypeScript
21
star
19

codex

Codex Team website
PHP
21
star
20

hawk.php

PHP Errors catching and monitoring
PHP
19
star
21

html-slacker

Converts HTML to Slack formatted markdown
Python
17
star
22

hawk.desktop

Hawk.so desktop client
JavaScript
16
star
23

hawk.mono

Open-source errors tracker
Shell
14
star
24

stimagebot

Get images of your favourite stickers ⭐
JavaScript
14
star
25

hawk.garage

Hawk 2.0 web client
Vue
13
star
26

codex.special

Module for making high-contrast version of websites. Simple usage.
JavaScript
10
star
27

webpack-build-config

JavaScript
10
star
28

python-queue

Python
9
star
29

hawk.nodejs

Node.js catcher for Hawk
TypeScript
9
star
30

html-css-practice

Making Facebook for several minutes
HTML
9
star
31

kohana-aliases

Module which allows you to create beautiful URL's
PHP
8
star
32

AR-Tester

Test your site's layout on the virtual devices at Augmented Reality
Swift
8
star
33

moduleDispatcher

CodeX Module Dispatcher
JavaScript
8
star
34

hawk.workers

Hawk workers system
TypeScript
7
star
35

action-codexbot-notify

This action sends a notification message to Telegram or Slack chat
JavaScript
7
star
36

notes.web

TypeScript
7
star
37

eslint-config

CodeX basic eslint configuration
JavaScript
7
star
38

transport

One click file uploader
JavaScript
6
star
39

pycapella

Python SDK for capella.pics
Python
5
star
40

reactions

Light-weight reactions module
TypeScript
5
star
41

docker

Simple container with Nginx, PHP, MySQL
PHP
5
star
42

tinkoff-api

NodeJS SDK for Tinkoff Acquiring API
TypeScript
5
star
43

codex.notes.server

Cloud for the CodeX Notes
PHP
5
star
44

capella.php

PHP SDK for CodeX Capella project
PHP
5
star
45

capella.nodejs

Capella SDK for Node.js
JavaScript
4
star
46

editorjs.io

Source code of the Editor.js homepage
Vue
4
star
47

hawk.python

Codex Hawk python catcher
Python
4
star
48

hawk.api.nodejs

GraphQL API for Hawk Garage
TypeScript
4
star
49

action-nodejs-package-info

Action for getting information from package.json file
JavaScript
4
star
50

codex.notes.android

CodeX Notes for Android
Kotlin
4
star
51

codex.music

WIP: Dehumanised engine for generating Chillout music 🎶
TypeScript
4
star
52

culture-of-art

Dummy page for «Culture of Art» project
CSS
3
star
53

codex.notes.ios

Codex Notes for iOS
Swift
3
star
54

task-manager

TypeScript
3
star
55

hawk.kotlin

Kotlin Catcher for Hawk.so
Kotlin
3
star
56

codex.tunnel

Expose your project via codex.tunnel
Go
3
star
57

capella.go

Capella SDK for Golang
Go
3
star
58

logs-checker

Script for checking server's log-files updates.
PHP
3
star
59

node-playground

Sources from CodeX Meetup about making real-time application with Nodejs, Express, Socket.io
JavaScript
3
star
60

vue-tutorial

Vue
3
star
61

hawk.android.catcher

Android errors Catcher module for Hawk.so
Kotlin
3
star
62

codex.backup

Simple shell script for server backups to the cloud
PHP
3
star
63

hawk.workers.go

Experimental Golang worker implementation
Go
2
star
64

capella.scala

Capella SDK for Scala
Scala
2
star
65

codex.smm

SMM assistant. Reminds you to write something to you followers.
JavaScript
2
star
66

hawk.go

Hawk catcher for Golang
Go
2
star
67

cover-generator

JavaScript
2
star
68

codex-orion

News analysis project
Scala
2
star
69

codex.editor.sandbox

Dockerized CodeX Editor backend with example application.
HTML
2
star
70

opencollective-webhook

Service that checks opencollective API and informs you about new donations via Telegram and CodeX.Bot
Go
2
star
71

ctproto

CodeX Transport Protocol
TypeScript
2
star
72

announcer-landing

Admin page for @itmoabitbot announcements
CSS
2
star
73

codex.bot.chart

Smarty
2
star
74

domain-checker

JavaScript
2
star
75

hawk.so

Vue
2
star
76

article-ci

Demo code for CI article on ifmo.su
Python
2
star
77

notes.api

TypeScript
2
star
78

flux-webhook-autoreconciler

Go
2
star
79

brand-watcher

Python
1
star
80

dev

Repository for development needs
1
star
81

hawk.webpack.plugin

Webpack plugin for sending source maps to the Hawk
JavaScript
1
star
82

codex.meetup.bot

Python
1
star
83

codex.notes.server-nodejs

JavaScript
1
star
84

hawk.scala

Hawk catcher for Scala
Scala
1
star
85

typescript-lib-template

A quick start template for a new TypeScript library
TypeScript
1
star
86

mongodb-changes-notifier

With this tool you'll be able to be notified of any data changes in MongoDB
Go
1
star
87

codex.docs.chart

Helm chart for deploying CodeX Docs
Smarty
1
star
88

fastDeployServer

Service that will stop and restart your docker-compose services on the fly based on images
Go
1
star
89

whocame

Bot that knows who come to the office
Go
1
star
90

codex-surveys

TypeScript
1
star
91

codex.langbot

Bot that automatically translate any Russian message to English in Telegram chat
Python
1
star
92

codex.bot.v3

Bot that let you to control everything from Telegram and Slack.
Python
1
star
93

devops-monitor

Shell
1
star
94

hawk.collector

High-performance messages collector for the Hawk project
Go
1
star
95

uptime-monitor.workers

JavaScript
1
star
96

codex-surveys-proxy

Proxy to access Notion API via CodeX Surveys
1
star
97

codex.misprints

Module for sendings misprints to Slack and Telegram
TypeScript
1
star
98

codex-accounting

Microservice for accounting
TypeScript
1
star
99

codex-accounting-sdk

Simple SDK for communicating with CodeX Accounting
TypeScript
1
star