Skip to content

Repository files navigation

Pillow-Plugins - 10 simple plugins for Pillow (Python)

Read support for various camera RAW file formats based on dcraw.

Requires dcraw (binary for Windows is included, in Debian-based Linux distros install it with sudo apt install dcraw).

Usage:

from PIL import Image
import DcrawImagePlugin

img = Image.open("test.nef")
img.show()

Allows Pillow to load arbitrary video files as (virtual) multi-frame images.
Requires FFmpeg.

Usage:

from PIL import Image
import FfmpegImagePlugin

img = Image.open("test.mp4")
img.seek(123)  # load frame 124 (seek starts counting with 0)
img.show()

Read support for additional image file formats/image modes based on FreeImage.

  • MNG (first frame, i.e. not animated)
  • Apple PICT
  • PSD/TIFF with 16 and 32 bits (floating point) per channel.

Requires FreeImage (DLL for Windows is included, in Debian-based Linux distros install it with sudo apt install libfreeimage3).

Usage:

from PIL import Image
import FreeImagePlugin

img = Image.open("test.pct")
img.show()

Allows Pillow to load PDF and Adobe Illustrator (AI) files as (virtual) multi-frame images.
Requires Ghostscript (binary for Windows is included, in Debian-based Linux distros install it with sudo apt install ghostscript).

Usage:

from PIL import Image
import GhostImagePlugin

img = Image.open("test.pdf")
img.seek(2)  # load page 3 (seek starts counting with 0)
img.show()

Allows Pillow to load CorelDraw (CDR), Macromedia FreeHand (FH/FHx) and OpenDocument Graphic (ODG) files as images via headless LibreOffice Draw.
Requires LibreOffice Draw (or OpenOffice Draw, not tested).

Usage:

from PIL import Image
import LibreImagePlugin

img = Image.open("test.cdr")
img.show()

Allows Pillow to load SVG vector graphic files as images.
Depends on pycairo (pip install pycairo, also available for Windows).

Usage:

from PIL import Image
import SvgImagePlugin

img = Image.open("test.svg", output_width = 800)
img.show()

Simple image plugin that allows Pillow to read and write image files with a custom image file format called "PIL" (.pil).

The PIL image file format supports any image mode that Pillow supports - that's the idea of the format and the reason why I invented it. So it can be used to save and load images also with rather exotic modes like e.g. "PA" (palette + alpha channel) or "LA" (grayscale + alpha channel), or 1-bit images with 2 custom colors instead of b/w (rawmode "P:1").

The format supports DEFLATE compression of the image data, which is the same compression that PNG uses. Therefor a compressed RGB PIL file has roughly the same filesize as the same image stored as PNG.

Usage:

from PIL import Image
import PilImagePlugin

img = Image.open("test.pil")
img.show()

There is also a Thumbnail Handler Shell Extension for Windows that allows Windows Explorer to show thumbnails for PIL files (15 modes supported).

Windows 11 Explorer showing thumbnails for PIL files with various image modes

A better and way faster Image.show() implementation for Python 3.x x64 in Windows 10/11.

Images are shown in a native resizable viewer window, without creating any temporary files.
While the window is displayed, other (Pillow compatible) image files can be dropped into it from Explorer to view them.
In addition to Pillow the plugin only uses ctypes and the Windows API, no 3rd-party modules involved.

Usage:

from PIL import Image
import WinImageShowPlugin  # import overwrites Image.show() method

img = Image.open("test.tif")
img.show()  # Blocks code execution until viewer window is closed

The result in Windows 11

Read and write support for the Better Portable Graphics (BPG) file format.

Requires bpgdec and bpgenc (binaries for Windows are included).

Usage:

from PIL import Image
import BpgImagePlugin

img = Image.open("test.bpg")
img.show()

This simple plugin only makes sense for users that have ImageMagick (magick.exe) already installed on the local computer anyway. It adds read and write support for some additional image file formats:

  • EXR (read + write)
  • HEIF/HEIC (read + write)
  • JNG (read + write)
  • MNG (read + write; no animation)
  • PCD (write only - read support already provided by Pillow)
  • PICT (read + write)
  • PSB (read + write)
  • PSD (write only - read support already provided by Pillow)
  • SVG (read + write; saved SVG files contain image as embedded PNG)
  • WPG (Word Perfect Graphics; read only)

Usage:

from PIL import Image
import MagickImagePlugin

# If not in PATH:
# MagickImagePlugin.MAGICK_BIN = "D:\\ImageMagick\\magick.exe"

img = Image.open("test.heif")
img.show()

Releases

Packages

Contributors

Languages