Extension which provides easy image manipulation support in Flask applications.
$ pip install Flask-Imagine
from flask import Flask
from flask.ext.imagine import Imagine
app = Flask(__name__)
app.config['IMAGINE_ADAPTER'] = {
'name': 'fs',
'source_folder': 'images', # Relative to 'static' folder
'cache_folder': 'cache' # Not required. Default: 'cache'
}
app.config['IMAGINE_FILTER_SETS'] = {
'filter_set_name': {
'cache': True,
'filters': {
# Filters initialization parameters
}
}
}
# ... Another configuration options
# Init extension
imagine = Imagine(app)
# or
imagine = Imagine()
imagine.init_app(app)