Python wrapper for FreeImage and LCMS2 libraries
Project description
=======================================================
smc.freeimage - Semantics' FreeImage wrapper for Python
=======================================================
smc.freeimage is a Python interface to the FreeImage and LCMS2 libraries.
Features of FreeImage
=====================
FreeImage wraps mature and widely-used libraries like LibJPEG, LibOpenJPEG,
LibPNG, LibRaw, LibTIFF4, OpenEXR and zlib in a consistent, well documented
and powerful API.
http://freeimage.sourceforge.net/
* Reading of 35 file formats and writing of more than 19 file formats as of
FreeImage 3.15.3, including JPEG 2000, multiple subformats of TIFF
with G3/G4 fax compression and JPEG subsampling.
* pixel depths from 1-32 bpp standard images up to formats like
RGBAF and 2x64complex.
* multi page images
* Metadata (e.g. EXIF, IPTC/NAA, GeoTIFF, XMP) and ICC
* Color adjustment, conversion and channel processing
* Image resizing and rotation
* High Dynamic Range (HDR) image processing and tone mapping
* RAW camera files
Contrary to PIL it doesn't contain advanced image filters or drawing
functions. FreeImage focuses on file formats
Features of LCMS2
=================
LCMS2 is a color management engine that implements V2 and V4 ICC profiles up
to V4.3. It supports transformation, proofing and introspection of profiles
for a large variety of color formats and targets.
http://www.littlecms.com/
Features of smc.freeimage
=========================
smc.freeimage is developed as part of the closed source Visual Library
framework.
* mostly written with Cython with some lines of handwritten C Code and some
Python helpers.
* fast, it avoids copying large amounts of data and releases the GIL whenever
possible.
* 64bit safe, tested on i386/X86 and AMD64/X86_64 systems
* thread safe
* wraps a large subset of FreeImage features
* compatible with Python 2.6 to 3.3.
Performance
===========
smc.freeimage with libjpeg-turbo read JPEGs about three to six times faster
than PIL and writes JPEGs more than five times faster.
JPEG's restart markers are not compatible with libjpeg-turbo's Huffman
decoder optimization and reduce performance a lot. Please read the section
"Restart Makers" on the page http://www.libjpeg-turbo.org/About/Performance
for more information.
Python:
2.7.3
read / write cycles::
300
test image:
1210x1778 24bpp JPEG (pon.jpg)
platform:
Ubuntu 12.04 X86_64
hardware:
Intel Xeon hexacore W3680@3.33GHz with 24 GB RAM
smc.freeimage, FreeImage 3.15.3 standard
----------------------------------------
- read JPEG 12.857 sec
- read JPEG 6.629 sec (resaved)
- write JPEG 21.817 sec
smc.freeimage, FreeImage 3.15.3 with jpeg turbo
-----------------------------------------------
- read JPEG 9.297 sec
- read JPEG 3.909 sec (resaved)
- write JPEG 5.857 sec
- read LZW TIFF 17.947 sec
- read biton G4 TIFF 2.068 sec
- resize 3.850 sec (box)
- resize 5.022 sec (bilinear)
- resize 7.942 sec (bspline)
- resize 7.222 sec (bicubic)
- resize 7.941 sec (catmull rom spline)
- resize 10.232 sec (lanczos3)
- tiff numpy.asarray() with bytescale() 0.006 sec
- tiff load + numpy.asarray() with bytescale() 18.043 sec
PIL 1.1.7
---------
- read JPEG 30.389 sec
- read JPEG 23.118 sec (resaved)
- write JPEG 34.405 sec
- read LZW TIFF 21.596 sec
- read biton G4 TIFF: decoder group4 not available
- resize 0.032 sec (nearest)
- resize 1.074 sec (bilinear)
- resize 2.924 sec (bicubic)
- resize 8.056 sec (antialias)
- tiff scipy fromimage() with bytescale() 1.165 sec
- tiff scipy imread() with bytescale() 22.939 sec
Comparison to PIL (Pros and Cons)
=================================
Pros of smc.freeimage
---------------------
* Faster! JPEG performance is about 3 to 6 times faster than PIL, numpy buffer
access is more than 100 times faster and consumes less memory due to zero
copy design.
* Modern file formats! smc.freeimage supports JPEG 2000, HDR and EXR high
dynamic range images and raw camera data (RAW).
* Full baseline TIFF support! Contrary to PIL smc.freeimage supports all
flavors of baseline TIFF like G3 and G4 compression and multipage TIFFs.
* PEP 3118 buffer interface that exports images as 2d or 3d non-contiguous
buffer.
* Correct and optimized integration of a color management system (LittleCMS2)
instead of lcms1 integration including caching of optimized
transformations, in-place transformation and introspection of profiles.
* Structured metadata access to EXIF, XMP and IPTC information, also supports
fast loading of metadata without loading pixel data.
* Lot's of color types! Bitmap (8bit) with 1, 4, 8, 16, 24 and 32 bits per
pixel, (unsigned) int 16 and 32, float, double gray scale, complex, RGBA
16bit and RGBA floats.
* Static build support, no need for "make install". You just need a C99
compatible C/C++ compiler, make and nasm (for FreeImage-Turob).
Cons of smc.freeimage
----------------------
* Few image filters, no support for complex image filters in FreeImage
* Low quality resize filters are slower than PIL's filters
* No drawing API for primitives (lines, circles, boxes)
* No text drawing support and libfreetype integration.
* Still not feature complete and under development.
FreeImage + libjpeg-turbo
=========================
An experimental fork of FreeImage with libjpeg-turbo is available at
https://bitbucket.org/tiran/freeimageturbo
Testdata and Windows build files
================================
Neither the Windows build files nor the test images are included in the
source distribution. All files can be downloaded from
https://bitbucket.org/tiran/smc.freeimage .
Authors
=======
Christian Heimes
Dirk Rothe (testing and proposals)
Copyright
=========
Copyright (C) 2008-2012 semantics GmbH. All Rights Reserved.::
semantics
Kommunikationsmanagement GmbH
Viktoriaallee 45
D-52066 Aachen
Germany
Tel.: +49 241 89 49 89 29
eMail: info(at)semantics.de
http://www.semantics.de/
=========
Changelog
=========
smc.freeimage 0.2
-----------------
*Release date: 17-Aug-2012*
- implemented simple and read-only multipage image support
- added support for static linking of libfreeimage and liblcms2
- added binary and errors arguments to getMetadata()
- implemented PEP-3118 buffer interface for all image types. The buffer
is either 2d (for grey, i16bit, int, uint, float and double) images or
3d for all colored images.
- added getColor* functions to get shift, mask and order of RGBA
and 16bit image pixel data.
- implemented getRaw() to get a copy of the raw pixel data.
- support building smc.freeimage without Cython and just from _freeimage.c
- added experimental FreeImageTurbo.dll for 32bit Windows
- added --without-turbo
- enhanced FormatInfo class and fixed a possible segfault
- fixed icc_cmyk property handling of missing ICC profile
- added ImageDataRepresentation as central information place for mapping
of image and color type to buffer layout, LCMS types and PIL modes.
smc.freeimage 0.1
-----------------
*Release date: 13-Jul-2012*
- project moved to https://bitbucket.org/tiran/smc.freeimage
- experimental support for Python 3
- support for Windows X86_64 builds
- updated code base to LCMS 2.3, FreeImage 3.15.3 and Cython 0.16
- modernized and cleaned up Cython code to use recent features like pxd files
smc.freeimage - Semantics' FreeImage wrapper for Python
=======================================================
smc.freeimage is a Python interface to the FreeImage and LCMS2 libraries.
Features of FreeImage
=====================
FreeImage wraps mature and widely-used libraries like LibJPEG, LibOpenJPEG,
LibPNG, LibRaw, LibTIFF4, OpenEXR and zlib in a consistent, well documented
and powerful API.
http://freeimage.sourceforge.net/
* Reading of 35 file formats and writing of more than 19 file formats as of
FreeImage 3.15.3, including JPEG 2000, multiple subformats of TIFF
with G3/G4 fax compression and JPEG subsampling.
* pixel depths from 1-32 bpp standard images up to formats like
RGBAF and 2x64complex.
* multi page images
* Metadata (e.g. EXIF, IPTC/NAA, GeoTIFF, XMP) and ICC
* Color adjustment, conversion and channel processing
* Image resizing and rotation
* High Dynamic Range (HDR) image processing and tone mapping
* RAW camera files
Contrary to PIL it doesn't contain advanced image filters or drawing
functions. FreeImage focuses on file formats
Features of LCMS2
=================
LCMS2 is a color management engine that implements V2 and V4 ICC profiles up
to V4.3. It supports transformation, proofing and introspection of profiles
for a large variety of color formats and targets.
http://www.littlecms.com/
Features of smc.freeimage
=========================
smc.freeimage is developed as part of the closed source Visual Library
framework.
* mostly written with Cython with some lines of handwritten C Code and some
Python helpers.
* fast, it avoids copying large amounts of data and releases the GIL whenever
possible.
* 64bit safe, tested on i386/X86 and AMD64/X86_64 systems
* thread safe
* wraps a large subset of FreeImage features
* compatible with Python 2.6 to 3.3.
Performance
===========
smc.freeimage with libjpeg-turbo read JPEGs about three to six times faster
than PIL and writes JPEGs more than five times faster.
JPEG's restart markers are not compatible with libjpeg-turbo's Huffman
decoder optimization and reduce performance a lot. Please read the section
"Restart Makers" on the page http://www.libjpeg-turbo.org/About/Performance
for more information.
Python:
2.7.3
read / write cycles::
300
test image:
1210x1778 24bpp JPEG (pon.jpg)
platform:
Ubuntu 12.04 X86_64
hardware:
Intel Xeon hexacore W3680@3.33GHz with 24 GB RAM
smc.freeimage, FreeImage 3.15.3 standard
----------------------------------------
- read JPEG 12.857 sec
- read JPEG 6.629 sec (resaved)
- write JPEG 21.817 sec
smc.freeimage, FreeImage 3.15.3 with jpeg turbo
-----------------------------------------------
- read JPEG 9.297 sec
- read JPEG 3.909 sec (resaved)
- write JPEG 5.857 sec
- read LZW TIFF 17.947 sec
- read biton G4 TIFF 2.068 sec
- resize 3.850 sec (box)
- resize 5.022 sec (bilinear)
- resize 7.942 sec (bspline)
- resize 7.222 sec (bicubic)
- resize 7.941 sec (catmull rom spline)
- resize 10.232 sec (lanczos3)
- tiff numpy.asarray() with bytescale() 0.006 sec
- tiff load + numpy.asarray() with bytescale() 18.043 sec
PIL 1.1.7
---------
- read JPEG 30.389 sec
- read JPEG 23.118 sec (resaved)
- write JPEG 34.405 sec
- read LZW TIFF 21.596 sec
- read biton G4 TIFF: decoder group4 not available
- resize 0.032 sec (nearest)
- resize 1.074 sec (bilinear)
- resize 2.924 sec (bicubic)
- resize 8.056 sec (antialias)
- tiff scipy fromimage() with bytescale() 1.165 sec
- tiff scipy imread() with bytescale() 22.939 sec
Comparison to PIL (Pros and Cons)
=================================
Pros of smc.freeimage
---------------------
* Faster! JPEG performance is about 3 to 6 times faster than PIL, numpy buffer
access is more than 100 times faster and consumes less memory due to zero
copy design.
* Modern file formats! smc.freeimage supports JPEG 2000, HDR and EXR high
dynamic range images and raw camera data (RAW).
* Full baseline TIFF support! Contrary to PIL smc.freeimage supports all
flavors of baseline TIFF like G3 and G4 compression and multipage TIFFs.
* PEP 3118 buffer interface that exports images as 2d or 3d non-contiguous
buffer.
* Correct and optimized integration of a color management system (LittleCMS2)
instead of lcms1 integration including caching of optimized
transformations, in-place transformation and introspection of profiles.
* Structured metadata access to EXIF, XMP and IPTC information, also supports
fast loading of metadata without loading pixel data.
* Lot's of color types! Bitmap (8bit) with 1, 4, 8, 16, 24 and 32 bits per
pixel, (unsigned) int 16 and 32, float, double gray scale, complex, RGBA
16bit and RGBA floats.
* Static build support, no need for "make install". You just need a C99
compatible C/C++ compiler, make and nasm (for FreeImage-Turob).
Cons of smc.freeimage
----------------------
* Few image filters, no support for complex image filters in FreeImage
* Low quality resize filters are slower than PIL's filters
* No drawing API for primitives (lines, circles, boxes)
* No text drawing support and libfreetype integration.
* Still not feature complete and under development.
FreeImage + libjpeg-turbo
=========================
An experimental fork of FreeImage with libjpeg-turbo is available at
https://bitbucket.org/tiran/freeimageturbo
Testdata and Windows build files
================================
Neither the Windows build files nor the test images are included in the
source distribution. All files can be downloaded from
https://bitbucket.org/tiran/smc.freeimage .
Authors
=======
Christian Heimes
Dirk Rothe (testing and proposals)
Copyright
=========
Copyright (C) 2008-2012 semantics GmbH. All Rights Reserved.::
semantics
Kommunikationsmanagement GmbH
Viktoriaallee 45
D-52066 Aachen
Germany
Tel.: +49 241 89 49 89 29
eMail: info(at)semantics.de
http://www.semantics.de/
=========
Changelog
=========
smc.freeimage 0.2
-----------------
*Release date: 17-Aug-2012*
- implemented simple and read-only multipage image support
- added support for static linking of libfreeimage and liblcms2
- added binary and errors arguments to getMetadata()
- implemented PEP-3118 buffer interface for all image types. The buffer
is either 2d (for grey, i16bit, int, uint, float and double) images or
3d for all colored images.
- added getColor* functions to get shift, mask and order of RGBA
and 16bit image pixel data.
- implemented getRaw() to get a copy of the raw pixel data.
- support building smc.freeimage without Cython and just from _freeimage.c
- added experimental FreeImageTurbo.dll for 32bit Windows
- added --without-turbo
- enhanced FormatInfo class and fixed a possible segfault
- fixed icc_cmyk property handling of missing ICC profile
- added ImageDataRepresentation as central information place for mapping
of image and color type to buffer layout, LCMS types and PIL modes.
smc.freeimage 0.1
-----------------
*Release date: 13-Jul-2012*
- project moved to https://bitbucket.org/tiran/smc.freeimage
- experimental support for Python 3
- support for Windows X86_64 builds
- updated code base to LCMS 2.3, FreeImage 3.15.3 and Cython 0.16
- modernized and cleaned up Cython code to use recent features like pxd files
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
smc.freeimage-0.2.zip
(319.5 kB
view hashes)
smc.freeimage-0.2.tar.gz
(285.4 kB
view hashes)
smc.freeimage-0.2.full.tar.gz
(21.8 MB
view hashes)
Built Distributions
Close
Hashes for smc.freeimage-0.2.win-amd64-py3.2.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91f73a521464aef19b812d5e410457f18e25b75edd885aba68c53fce140d6d66 |
|
MD5 | 6c6cc3c7598acea6f2d7d964ad0b5c68 |
|
BLAKE2b-256 | d0a24428a5bc4e35cb248e24802db74d6c04a5bd9aee832fedb11d0a527f0cf5 |
Close
Hashes for smc.freeimage-0.2.win-amd64-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | a84ba40e57139fc36e94b36646c8e2359323a0613d9adf1ff4ae87787347ac80 |
|
MD5 | d363752a974fec13dc197c21aee7cecf |
|
BLAKE2b-256 | 2505c74a0523164ef1eb1a44e6fe8bf12757ec327c0a07439e5fd8c57f47af15 |
Close
Hashes for smc.freeimage-0.2.win-amd64-py2.6.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f8841b7747ad3fc1b9cfad39fc7d881eafa5122d09c29a3cab568262941f333 |
|
MD5 | 29c1adafe5b5eb8fcbdd3c6ab93a5158 |
|
BLAKE2b-256 | 3b968492dc54d0b834477265037e479ac195ef1e187e29b4a61f4d3897893f39 |
Close
Hashes for smc.freeimage-0.2.win32-py3.2.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3f5168be570fd46c4d2c39ab4f3b55090a5c691927bc0605fc713e31617356f |
|
MD5 | f8326ab539a085f3e119b74492575f53 |
|
BLAKE2b-256 | 83831e76ec9f28ea81551fedb342ea960424f7b5da2a033abf50a8059e0b2c94 |
Close
Hashes for smc.freeimage-0.2.win32-py2.7.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd44e041abec3573ee204252daf8c16751048c0eae2a3d3327429f9454636381 |
|
MD5 | 7b1a451264c7f4a3d070a7010a5cf0ab |
|
BLAKE2b-256 | 798a0a6b1512c0ad4c53175a5521d691db8e840a921ecbea049d98d0a41017d7 |
Close
Hashes for smc.freeimage-0.2.win32-py2.6.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad6bdaf5d4a8dfe7d3afef7b85e8bea5b14f7914b585539783a5e0708b4341c2 |
|
MD5 | 85dfa10e6443137eeb87e7013b905f65 |
|
BLAKE2b-256 | 36783ca38cfdcf8cd278f870929de3130acbeb08d1e2ae4c8da52bd766b07d9d |
Close
Hashes for smc.freeimage-0.2-py3.2-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6aaeb5e8d64439983caab3402b1404e41a090f2d58007515e1c2a7ee67dcc88b |
|
MD5 | eea6f9a3943fe5c8e8030236be501e04 |
|
BLAKE2b-256 | e6d28bc7394aaa48e3a1e5d6db9a4b91d5f16b6046942ef169506bee236001bb |
Close
Hashes for smc.freeimage-0.2-py3.2-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be4dedcca8992aa7bac5517c2cdcf5897b5cc7bca2f02774a7d692145327e19 |
|
MD5 | 582806838e46d3710631ef5ede4d8bed |
|
BLAKE2b-256 | ff0ac037c8ab32b8dd38ca24a8ff3e4ed88a7aa401904e091d6b9e813d7d3222 |
Close
Hashes for smc.freeimage-0.2-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | daf482906ea95be116468c691e103886ffde116b84712f85c933682eba33c0c7 |
|
MD5 | da1b7f6475f3d06c0559407a7a37422d |
|
BLAKE2b-256 | cca608db0428553ce9da2c96e93ba8b6613d4a639f078675cb9b7e22c93209da |
Close
Hashes for smc.freeimage-0.2-py2.7-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0519b6c0bf6f6fcc75226060be934ac3c5f4329273c04f6a4b9ed9db114e2152 |
|
MD5 | 7d8414cf89d0e0ff01b6be7773aa9207 |
|
BLAKE2b-256 | 07537192a5dc954366f0015b93adfaf0816b77468fe46b7f24174d6cf235c82f |
Close
Hashes for smc.freeimage-0.2-py2.6-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | b90f8bdabc0a32dfd83e36b2d64c39f033055590cd9fc01957a1c070a6727336 |
|
MD5 | 5e79c331ae90377ba5ce28720af9704f |
|
BLAKE2b-256 | 223c09ed567d004c276421f24b679ba3cffe37086c55878bff2994f95fa27d60 |
Close
Hashes for smc.freeimage-0.2-py2.6-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d3d508e9bc55497ca78e64d626731cc9e981a925a5e966ddc92365a5b14ef3 |
|
MD5 | ebb87c245a6b6504de06128c00140ad9 |
|
BLAKE2b-256 | e9894dc76cccbb892418075cabf8606b7e170d9265e004104f752b9ff2475ad1 |