Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Apr 15, 2024
1 parent 9ee4a83 commit a7f22bb
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,8 @@ Imagecast
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/
Imagecast is like ImageMagick but for Pythonistas. It is based on Pillow_,
and optionally provides its features via HTTP API.


*******
Expand All @@ -73,7 +65,9 @@ Features
- Cropping with negative right/bottom offsets
- Resizing while keeping aspect ratio
- Output format: Any image formats from Pillow or raw bytes
- HTTP API
- HTML DOM capturing using Playwright
- HTTP API, effectively implementing an image
acquisition and conversion service


********
Expand All @@ -91,14 +85,19 @@ Synopsis
# Colorspace reduction, cropping, resizing and format conversion
imagecast --uri="$IMGURL" --grayscale --crop=40,50,-50,-40 --width=200 --save=test.png

# HTML DOM capturing
imagecast --uri="$HTMLURL" --element="#logo"

Example::
Examples::

# Image manipulation
imagecast --uri="https://unsplash.com/photos/WvdKljW55rM/download?force=true" --monochrome=80 --crop=850,1925,-950,-900 --width=640 --display

# HTML DOM capturing
imagecast --uri="https://www.iana.org/help/example-domains" --element="#logo"

HTML Capturing
==============
HTML DOM capturing
==================

Imagecast can also capture screenshots of webpages, or elements thereof. It uses
`Playwright`_ and `Firefox`_ to convert full pages or specific DOM elements
Expand All @@ -121,13 +120,20 @@ to express a DOM selector to apply::
HTTP API
========

``imagecast`` also provides its features using an HTTP API.

Start the Imagecast service as daemon::

imagecast service

Example::
Examples::

# Image manipulation
http "http://localhost:9999/?uri=https%3A%2F%2Funsplash.com%2Fphotos%2FWvdKljW55rM%2Fdownload%3Fforce%3Dtrue&monochrome=80&crop=850,1925,-950,-900&width=640"

# HTML DOM capturing
http "http://localhost:9999/?uri=https://www.iana.org/help/example-domains&element=%23logo"

http "localhost:9999/?uri=https%3A%2F%2Funsplash.com%2Fphotos%2FWvdKljW55rM%2Fdownload%3Fforce%3Dtrue&monochrome=80&crop=850,1925,-950,-900&width=640"

.. note::

Expand All @@ -153,4 +159,5 @@ Other projects


.. _Firefox: https://www.mozilla.org/firefox/
.. _Pillow: https://pillow.readthedocs.io/
.. _Playwright: https://playwright.dev/

0 comments on commit a7f22bb

Please sign in to comment.