#########
Imagecast
#########
|
.. start-badges
|ci-tests| |ci-coverage| |license| |pypi-downloads|
|python-versions| |status| |pypi-version|
.. |ci-tests| image:: https://github.com/panodata/imagecast/actions/workflows/tests.yml/badge.svg
:target: https://github.com/panodata/imagecast/actions/workflows/tests.yml
.. |ci-coverage| image:: https://codecov.io/gh/panodata/imagecast/branch/main/graph/badge.svg
:target: https://codecov.io/gh/panodata/imagecast
:alt: Test suite code coverage
.. |python-versions| image:: https://img.shields.io/pypi/pyversions/imagecast.svg
:target: https://python.org
.. |pypi-version| image:: https://img.shields.io/pypi/v/imagecast.svg
:target: https://pypi.org/project/imagecast/
.. |status| image:: https://img.shields.io/pypi/status/imagecast.svg
:target: https://pypi.org/project/imagecast/
.. |license| image:: https://img.shields.io/pypi/l/imagecast.svg
:target: https://pypi.org/project/imagecast/
.. |pypi-downloads| image:: https://static.pepy.tech/badge/imagecast/month
:target: https://pepy.tech/project/imagecast
.. end-badges
*****
About
*****
Imagecast is like ImageMagick but for Pythonistas. Optionally provides its
features via HTTP API.
Currently, this is based on Pillow_. However, it might be based on Wand_ in
the future.
There might still be dragons.
.. _Pillow: https://pillow.readthedocs.io/
.. _Wand: http://wand-py.org/
*******
Install
*******
Prerequisites
=============
::
pip install imagecast
With service API::
pip install imagecast[service]
********
Features
********
- Colorspace conversion: monochrome, grayscale
- Cropping with negative right/bottom offsets
- Resizing while keeping aspect ratio
- Output format: Any image formats from Pillow or raw bytes
- HTTP API
********
Synopsis
********
::
# Display on screen
imagecast --uri="$IMGURL" --display
# Colorspace reduction to bi-level with threshold, output as bytes
imagecast --uri="$IMGURL" --monochrome=200 --format=bytes
# Colorspace reduction, cropping, resizing and format conversion
imagecast --uri="$IMGURL" --grayscale --crop=40,50,-50,-40 --width=200 --save=test.png
Example::
imagecast --uri="https://unsplash.com/photos/WvdKljW55rM/download?force=true" --monochrome=80 --crop=850,1925,-950,-900 --width=640 --display
HTML Capturing
==============
Imagecast can also capture screenshots of webpages, or elements thereof. It uses
`Playwright`_ and `Firefox`_ to convert full pages or specific DOM elements
to bitmaps.
After installing Imagecast, run::
playwright install firefox
Then, invoke Imagecast like::
imagecast --uri="${URL}" --display
In order to select specific elements for capturing, use the ``--element`` option
to express a DOM selector to apply::
imagecast --uri="${URL}" --element="#panel-1" --display
HTTP API
========
Start the Imagecast service as daemon::
imagecast service
Example::
http "localhost:9999/?uri=https%3A%2F%2Funsplash.com%2Fphotos%2FWvdKljW55rM%2Fdownload%3Fforce%3Dtrue&monochrome=80&crop=850,1925,-950,-900&width=640"
.. note::
You should not run the service without restricting the
list of allowed remote hosts on the public internet.
To do that, invoke the service like::
imagecast service --allowed-hosts=unsplash.com,media.example.org
By default, no host will be allowed. If you really need to enable access
to all upstream hosts, use ``--allowed-hosts=*``. All host names must be
listed explicitly, wildcard notations like ``*.iana.org`` are not permitted.
**************
Other projects
**************
- https://github.com/DictGet/ecce-homo
- https://github.com/agschwender/pilbox
- https://github.com/francescortiz/image
.. _Firefox: https://www.mozilla.org/firefox/
.. _Playwright: https://playwright.dev/
Raw data
{
"_id": null,
"home_page": "https://github.com/panodata/imagecast",
"name": "imagecast",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "image conversion http api proxy",
"author": "Andreas Motl",
"author_email": "andreas.motl@panodata.org",
"download_url": "https://files.pythonhosted.org/packages/5b/3c/8093c5de29b27807ff8051cffd33b11fed5f5b88f286ba8be2c6d656320d/imagecast-0.7.0.tar.gz",
"platform": null,
"description": "#########\nImagecast\n#########\n\n|\n\n.. start-badges\n\n|ci-tests| |ci-coverage| |license| |pypi-downloads|\n|python-versions| |status| |pypi-version|\n\n.. |ci-tests| image:: https://github.com/panodata/imagecast/actions/workflows/tests.yml/badge.svg\n :target: https://github.com/panodata/imagecast/actions/workflows/tests.yml\n\n.. |ci-coverage| image:: https://codecov.io/gh/panodata/imagecast/branch/main/graph/badge.svg\n :target: https://codecov.io/gh/panodata/imagecast\n :alt: Test suite code coverage\n\n.. |python-versions| image:: https://img.shields.io/pypi/pyversions/imagecast.svg\n :target: https://python.org\n\n.. |pypi-version| image:: https://img.shields.io/pypi/v/imagecast.svg\n :target: https://pypi.org/project/imagecast/\n\n.. |status| image:: https://img.shields.io/pypi/status/imagecast.svg\n :target: https://pypi.org/project/imagecast/\n\n.. |license| image:: https://img.shields.io/pypi/l/imagecast.svg\n :target: https://pypi.org/project/imagecast/\n\n.. |pypi-downloads| image:: https://static.pepy.tech/badge/imagecast/month\n :target: https://pepy.tech/project/imagecast\n\n.. end-badges\n\n\n*****\nAbout\n*****\n\nImagecast is like ImageMagick but for Pythonistas. Optionally provides its\nfeatures via HTTP API.\n\nCurrently, this is based on Pillow_. However, it might be based on Wand_ in\nthe future.\n\nThere might still be dragons.\n\n.. _Pillow: https://pillow.readthedocs.io/\n.. _Wand: http://wand-py.org/\n\n\n*******\nInstall\n*******\n\nPrerequisites\n=============\n::\n\n pip install imagecast\n\nWith service API::\n\n pip install imagecast[service]\n\n\n********\nFeatures\n********\n\n- Colorspace conversion: monochrome, grayscale\n- Cropping with negative right/bottom offsets\n- Resizing while keeping aspect ratio\n- Output format: Any image formats from Pillow or raw bytes\n- HTTP API\n\n\n********\nSynopsis\n********\n\n::\n\n # Display on screen\n imagecast --uri=\"$IMGURL\" --display\n\n # Colorspace reduction to bi-level with threshold, output as bytes\n imagecast --uri=\"$IMGURL\" --monochrome=200 --format=bytes\n\n # Colorspace reduction, cropping, resizing and format conversion\n imagecast --uri=\"$IMGURL\" --grayscale --crop=40,50,-50,-40 --width=200 --save=test.png\n\n\nExample::\n\n imagecast --uri=\"https://unsplash.com/photos/WvdKljW55rM/download?force=true\" --monochrome=80 --crop=850,1925,-950,-900 --width=640 --display\n\n\nHTML Capturing\n==============\n\nImagecast can also capture screenshots of webpages, or elements thereof. It uses\n`Playwright`_ and `Firefox`_ to convert full pages or specific DOM elements\nto bitmaps.\n\nAfter installing Imagecast, run::\n\n playwright install firefox\n\nThen, invoke Imagecast like::\n\n imagecast --uri=\"${URL}\" --display\n\nIn order to select specific elements for capturing, use the ``--element`` option\nto express a DOM selector to apply::\n\n imagecast --uri=\"${URL}\" --element=\"#panel-1\" --display\n\n\nHTTP API\n========\n\nStart the Imagecast service as daemon::\n\n imagecast service\n\nExample::\n\n http \"localhost:9999/?uri=https%3A%2F%2Funsplash.com%2Fphotos%2FWvdKljW55rM%2Fdownload%3Fforce%3Dtrue&monochrome=80&crop=850,1925,-950,-900&width=640\"\n\n.. note::\n\n You should not run the service without restricting the\n list of allowed remote hosts on the public internet.\n\n To do that, invoke the service like::\n\n imagecast service --allowed-hosts=unsplash.com,media.example.org\n\n By default, no host will be allowed. If you really need to enable access\n to all upstream hosts, use ``--allowed-hosts=*``. All host names must be\n listed explicitly, wildcard notations like ``*.iana.org`` are not permitted.\n\n\n**************\nOther projects\n**************\n\n- https://github.com/DictGet/ecce-homo\n- https://github.com/agschwender/pilbox\n- https://github.com/francescortiz/image\n\n\n.. _Firefox: https://www.mozilla.org/firefox/\n.. _Playwright: https://playwright.dev/\n",
"bugtrack_url": null,
"license": "AGPL 3, EUPL 1.2",
"summary": "Imagecast is like ImageMagick but for Pythonistas. Optionally provides its features via HTTP API.",
"version": "0.7.0",
"project_urls": {
"Homepage": "https://github.com/panodata/imagecast"
},
"split_keywords": [
"image",
"conversion",
"http",
"api",
"proxy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c81f8e43235439dd836019f01c742e2bcf9378dc45e373b6c77684466704643a",
"md5": "e3059f43492ae7367e47aa418dea31a3",
"sha256": "5a8ee60a6c868262fc56866fdf4f0ef8744e9c222866e8a592cb24b38775984d"
},
"downloads": -1,
"filename": "imagecast-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e3059f43492ae7367e47aa418dea31a3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 20265,
"upload_time": "2024-04-15T21:01:28",
"upload_time_iso_8601": "2024-04-15T21:01:28.592248Z",
"url": "https://files.pythonhosted.org/packages/c8/1f/8e43235439dd836019f01c742e2bcf9378dc45e373b6c77684466704643a/imagecast-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5b3c8093c5de29b27807ff8051cffd33b11fed5f5b88f286ba8be2c6d656320d",
"md5": "b35aa405d42003ceb262df4a0832725b",
"sha256": "ec48b5e01166338cdb838db9f0cbf8408117e4521209f72b82beafb6ba618a6f"
},
"downloads": -1,
"filename": "imagecast-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "b35aa405d42003ceb262df4a0832725b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22527,
"upload_time": "2024-04-15T21:01:30",
"upload_time_iso_8601": "2024-04-15T21:01:30.210902Z",
"url": "https://files.pythonhosted.org/packages/5b/3c/8093c5de29b27807ff8051cffd33b11fed5f5b88f286ba8be2c6d656320d/imagecast-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-15 21:01:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "panodata",
"github_project": "imagecast",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "imagecast"
}