Python Imaging Library

Last updated
Python Imaging Library
Original author(s) Fredrik Lundh
Developer(s) Secret Labs AB
Initial release1995;29 years ago (1995) [1]
Stable release
1.1.7 / November 15, 2009;14 years ago (2009-11-15) [2]
Preview release
1.2a0 [3] / 2011;13 years ago (2011)
Written in Python, C
Type Library for image processing
License Historical Permission Notice and Disclaimer [1]
Website python-pillow.org   OOjs UI icon edit-ltr-progressive.svg
Pillow
Original author(s) Jeffrey A. Clark (Alex)
Initial release31 July 2010;14 years ago (2010-07-31) [1]
Stable release
10.1.0 / October 15, 2023;12 months ago (2023-10-15)
Written in Python, C
Type Library for image processing
License Historical Permission Notice and Disclaimer [1]
Website python-pillow.org

Python Imaging Library is a free and open-source additional library for the Python programming language that adds support for opening, manipulating, and saving many different image file formats. It is available for Windows, Mac OS X and Linux. The latest version of PIL is 1.1.7, was released in September 2009 and supports Python 1.5.2–2.7. [2]

Contents

Development of the original project, known as PIL, was discontinued in 2011. [3] Subsequently, a successor project named Pillow forked the PIL repository and added Python 3.x support. [4] This fork has been adopted as a replacement for the original PIL in Linux distributions including Debian [5] and Ubuntu (since 13.04). [6]

Capabilities

PIL offers several standard procedures for image manipulation. These include:

File formats

Supported file formats include PPM, PNG, JPEG, GIF, TIFF, and BMP. PIL is extensible, allowing users to create custom decoders for any file format. [10]

Programming examples

importosfromPILimportImagedefconvert_jpegs_to_pngs(folder_path):# Checks if the provided path is a folderifnotos.path.isdir(folder_path):print(f"Error: {folder_path} is not a valid folder.")return# Iterates over all files in the folderforfilenameinos.listdir(folder_path):# Checks if the file has a .jpg or .jpeg extensioniffilename.lower().endswith('.jpg')orfilename.lower().endswith('.jpeg'):# Full path of the filejpeg_path=os.path.join(folder_path,filename)# Path for the converted filepng_path=os.path.join(folder_path,os.path.splitext(filename)[0]+'.png')try:# Opens the JPEG imagewithImage.open(jpeg_path)asimg:# Converts and saves as PNGimg.save(png_path,'PNG')print(f"Converted {jpeg_path} to {png_path}")exceptExceptionase:print(f"Error converting {jpeg_path}: {e}")

Related Research Articles

<span class="mw-page-title-main">Shell script</span> Script written for the shell, or command line interpreter, of an operating system

A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be command languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper.

<span class="mw-page-title-main">GNU GRUB</span> Boot loader package

GNU GRUB is a boot loader package from the GNU Project. GRUB is the reference implementation of the Free Software Foundation's Multiboot Specification, which provides a user the choice to boot one of multiple operating systems installed on a computer or select a specific kernel configuration available on a particular operating system's partitions.

<span class="mw-page-title-main">Preview (macOS)</span> Image and PDF viewer software by Apple

Preview is the built-in image viewer and PDF viewer of the macOS operating system. In addition to viewing and printing digital images and Portable Document Format (PDF) files, it can also edit these media types. It employs the Aqua graphical user interface, the Quartz graphics layer, and the ImageIO and Core Image frameworks.

deb is the format, as well as filename extension of the software package format for the Debian Linux distribution and its derivatives.

DOT is a graph description language, developed as a part of the Graphviz project. DOT graphs are typically stored as files with the .gv or .dot filename extension — .gv is preferred, to avoid confusion with the .dot extension used by versions of Microsoft Word before 2007. dot is also the name of the main program to process DOT files in the Graphviz package.

HFS Plus or HFS+ is a journaling file system developed by Apple Inc. It replaced the Hierarchical File System (HFS) as the primary file system of Apple computers with the 1998 release of Mac OS 8.1. HFS+ continued as the primary Mac OS X file system until it was itself replaced with the Apple File System (APFS), released with macOS High Sierra in 2017. HFS+ is also one of the formats supported by the iPod digital music player.

Alien is a computer program that converts between different Linux package formats, created by Joey Hess and presently maintained by Kyle Barry.

<span class="mw-page-title-main">GNU Data Language</span>

The GNU Data Language (GDL) is a free alternative to IDL, achieving full compatibility with IDL 7 and partial compatibility with IDL 8. Together with its library routines, GDL is developed to serve as a tool for data analysis and visualization in such disciplines as astronomy, geosciences, and medical imaging. GDL is licensed under the GPL. Other open-source numerical data analysis tools similar to GDL include Julia, Jupyter Notebook, GNU Octave, NCAR Command Language (NCL), Perl Data Language (PDL), R, Scilab, SciPy, and Yorick.

<span class="mw-page-title-main">Geeqie</span>

Geeqie is a free software image viewer and image organiser program for Unix-like operating systems, which includes Linux-based systems and Apple's OS X. It was first released in March 2010, having been created as a fork of GQview, which appeared to have ceased development. It uses the GTK toolkit. In September 2015, development was moved from SourceForge to GitHub.

Design rule for Camera File system (DCF) is a JEITA specification which defines a file system for digital cameras, including the directory structure, file naming method, character set, file format, and metadata format. It is currently the de facto industry standard for digital still cameras. The file format of DCF conforms to the Exif specification, but the DCF specification also allows use of any other file formats. As of 2021, the latest version of the standard was 2.0, issued in 2010.

The Apple Icon Image format (.icns) is an icon format used in Apple Inc.'s macOS. It supports icons of 16 × 16, 32 × 32, 48 × 48, 128 × 128, 256 × 256, 512 × 512 points at 1x and 2x scale, with both 1- and 8-bit alpha channels and multiple image states. The fixed-size icons can be scaled by the operating system and displayed at any intermediate size.

A file format is a standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary or free.

<span class="mw-page-title-main">AcetoneISO</span> Open source virtual drive software

AcetoneISO is a free and open-source virtual drive software to mount and manage image files. Its goals are to be simple, intuitive and stable. Written in Qt, this software is meant for all those people looking for a "Daemon Tools for Linux". However, AcetoneISO does not emulate any copy protection while mounting.

<span class="mw-page-title-main">Zim (software)</span> Personal wiki software written in Python

Zim is a graphical text editor designed to maintain a collection of locally stored wiki-pages, a personal wiki. It works as a personal knowledge base and note-taking software application that operates on text files using markdown. Each wiki-page can contain things like text with simple formatting, links to other pages, attachments, and images. Additional plugins, such as an equation editor and spell-checker, are also available. The wiki-pages are stored in a folder structure in plain text files with wiki formatting. Zim can be used with the Getting Things Done method.

Orthanc is a standalone DICOM server. It is designed to improve the DICOM flows in hospitals and to support research about the automated analysis of medical images. Orthanc lets its users focus on the content of the DICOM files, hiding the complexity of the DICOM format and of the DICOM protocol. It is licensed under the GPLv3.

<span class="mw-page-title-main">Ginkgo CADx</span> Medical imaging software and DICOM viewer

Ginkgo CADx is an abandoned multi platform DICOM viewer (*.dcm) and dicomizer. Ginkgo CADx is licensed under LGPL license, being an open source project with an open core approach. The goal of Ginkgo CADx project was to develop an open source professional DICOM workstation.

<span class="mw-page-title-main">Guvcview</span> Free and open source webcam application

Guvcview is a webcam application, i.e. software to handle UVC streams, for the Linux desktop, started by Paulo Assis in 2008. The application is written in C and is free and open-source software released under GPL-2.0-or-later.

<span class="mw-page-title-main">GNOME SoundConverter</span>

GNOME SoundConverter is an unofficial GNOME-based free and open-source transcoder for digital audio files. It uses GStreamer for input and output files. It has multi threaded design and can also extract the audio from video files.

References

  1. 1 2 3 4 "Software License". Secret Labs AB. Archived from the original on 20 July 2020. Retrieved December 8, 2013.
  2. 1 2 "Python Imaging Library". Secret Labs AB. Archived from the original on 21 November 2020. Retrieved December 8, 2013.
  3. 1 2 "effbot / pil-2009-raclette". Archived from the original on 15 March 2015. Retrieved December 8, 2013.
  4. "Pillow: a modern fork of PIL" . Retrieved December 8, 2013.
  5. "Details of package python-imaging in sid". packages.debian.org. Software in the Public Interest . Retrieved December 8, 2013.
  6. "Details of package python-imaging in raring". ubuntu.com. Canonical Ltd. Retrieved December 8, 2013.
  7. "PyAccess Module". readthedocs.io. Retrieved September 20, 2024.
  8. "ImageFilter Module". readthedocs.io. Retrieved September 20, 2024.
  9. "ImageColor Module". readthedocs.io. Retrieved September 20, 2024.
  10. "D. Writing Your Own File Decoder". Effbot.org. Retrieved 2014-01-28.