Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

To simplify exif manipulations with python. Writing, reading, and more...

Project description

Build Status Windows Build Coverage Status docs

To simplify exif manipulations with Python. Writing, reading, and more… Piexif is pure Python. To everywhere with Python.


Online demo:



$ easy_install piexif

or ‘pip’:

$ pip install piexif

or download .zip, extract it. Put ‘piexif’ directory into your environment.

Why Choose Piexif

How to Use

There are only just five functions.

  • load(filename) - Get exif data as dict.
  • dump(exif_dict) - Get exif as bytes.
  • insert(exif_bytes, filename) - Insert exif into JPEG, or WebP.
  • remove(filename) - Remove exif from JPEG, or WebP.
  • transplant(filename, filename) - Transplant exif from JPEG to JPEG.


exif_dict = piexif.load("foo1.jpg")
for ifd in ("0th", "Exif", "GPS", "1st"):
    for tag in exif_dict[ifd]:
        print(piexif.TAGS[ifd][tag]["name"], exif_dict[ifd][tag])

With PIL(Pillow)

from PIL import Image
import piexif

im =
exif_dict = piexif.load(["exif"])
# process im and exif_dict...
w, h = im.size
exif_dict["0th"][piexif.ImageIFD.XResolution] = (w, 1)
exif_dict["0th"][piexif.ImageIFD.YResolution] = (h, 1)
exif_bytes = piexif.dump(exif_dict), "jpeg", exif=exif_bytes)


Tested on Python 2.7, 3.3, 3.4, 3.5, 3.6 and pypy3. Piexif would run even on IronPython. Piexif is OS independent and can run on Google App Engine.


This software is released under the MIT license, see LICENSE.txt.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
piexif-1.1.2-py2.py3-none-any.whl (21.8 kB) Copy SHA256 hash SHA256 Wheel py2.py3 (1.0 MB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page