1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2014, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
9 ;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
13 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
15 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
16 ;;; Copyright © 2016, 2017 Kei Kebreau <kei@openmailbox.org>
17 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
18 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
20 ;;; This file is part of GNU Guix.
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35 (define-module (gnu packages image)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages algebra)
38 #:use-module (gnu packages assembly)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages documentation)
43 #:use-module (gnu packages fontutils)
44 ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
45 #:use-module (gnu packages gcc)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages ghostscript)
48 #:use-module (gnu packages gl)
49 #:use-module (gnu packages glib)
50 #:use-module (gnu packages graphics)
51 #:use-module (gnu packages maths)
52 #:use-module (gnu packages mcrypt)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages xml)
57 #:use-module (gnu packages xorg)
58 #:use-module (gnu packages zip)
59 #:use-module ((guix licenses) #:prefix license:)
60 #:use-module (guix packages)
61 #:use-module (guix download)
62 #:use-module (guix git-download)
63 #:use-module (guix build-system gnu)
64 #:use-module (guix build-system cmake)
65 #:use-module (srfi srfi-1))
73 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
74 version "/libpng-" version ".tar.xz")
76 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
77 "/libpng16/libpng-" version ".tar.xz")
79 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
80 "/libpng16/libpng-" version ".tar.xz")))
83 "0fgjqp7x6jynacmqh6dj72cn6nnf6yxjfqqqfsxrx0pyx22bcia2"))))
84 (build-system gnu-build-system)
86 ;; libpng.la says "-lz", so propagate it.
87 (propagated-inputs `(("zlib" ,zlib)))
89 (synopsis "Library for handling PNG files")
91 "Libpng is the official PNG (Portable Network Graphics) reference
92 library. It supports almost all PNG features and is extensible.")
93 (license license:zlib)
94 (home-page "http://www.libpng.org/pub/png/libpng.html")))
96 (define-public libpng-apng
99 (replacement #f) ;libpng's replacement doesn't apply here
101 (version (package-version libpng))
104 (modify-phases %standard-phases
105 (add-after 'unpack 'patch-apng
106 (lambda* (#:key inputs #:allow-other-keys)
107 (define (apply-patch file)
108 (zero? (system* "patch" "-p1" "--force"
110 (let ((apng.gz (assoc-ref inputs "apng")))
111 (format #t "Applying APNG patch '~a'...~%"
113 (system (string-append "gunzip < " apng.gz " > the-patch"))
114 (and (apply-patch "the-patch")
115 (for-each apply-patch
116 (find-files "\\.patch"))))
118 (add-before 'configure 'no-checks
120 (substitute* "Makefile.in"
121 (("^scripts/symbols.chk") "")
122 (("check: scripts/symbols.chk") ""))
128 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
129 version "/libpng-" version "-apng.patch.gz"))
132 "026r0gbkf6d6v54wca02cdxln8sj4m2c1yk62sj2aasv2ki2ffh5"))))))
134 `(("libtool" ,libtool)))
135 (synopsis "APNG patch for libpng")
137 "APNG (Animated Portable Network Graphics) is an unofficial
138 extension of the APNG (Portable Network Graphics) format.
139 APNG patch provides APNG support to libpng.")
140 (home-page "https://sourceforge.net/projects/libpng-apng/")))
142 (define-public libpng-1.2
149 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
150 version "/libpng-" version ".tar.xz")
152 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
153 "/libpng12/libpng-" version ".tar.xz")
155 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
156 "/libpng12/libpng-" version ".tar.xz")))
158 (base32 "1n2lrzjkm5jhfg2bs10q398lkwbbx742fi27zgdgx0x23zhj0ihg"))))))
160 (define-public pngcrunch
166 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
167 version "/pngcrush-" version ".tar.xz"))
169 "1c7m316i91jp3h1dj1ppppdv6zilm2njk1wrpqy2zj0fcll06lwd"))))
170 (build-system gnu-build-system)
172 '(#:make-flags '("-f" "Makefile-nolib")
173 #:tests? #f ; no check target
175 (modify-phases %standard-phases
177 (lambda* (#:key inputs outputs #:allow-other-keys)
178 (substitute* "Makefile-nolib"
179 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
180 (string-append vardef (assoc-ref inputs "libpng") "/"))
181 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
182 (string-append vardef (assoc-ref inputs "zlib") "/"))
183 ;; The Makefile is written by hand and not using $PREFIX
184 (("\\$\\(DESTDIR\\)/usr/")
185 (string-append (assoc-ref outputs "out") "/"))))))))
189 (home-page "https://pmt.sourceforge.net/pngcrush")
190 (synopsis "Utility to compress PNG files")
191 (description "pngcrusqh is an optimizer for PNG (Portable Network Graphics)
192 files. It can compress them as much as 40% losslessly.")
193 (license license:zlib)))
195 (define-public libjpeg
201 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
204 "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
205 (build-system gnu-build-system)
206 (synopsis "Library for handling JPEG files")
208 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
209 JPEG is a standardized compression method for full-color and gray-scale
211 The included programs provide conversion between the JPEG format and
212 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
213 (license license:ijg)
214 (home-page "http://www.ijg.org/")))
216 (define-public libjpeg-8
217 (package (inherit libjpeg)
221 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
224 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
226 (define-public libjxr
231 ;; We are using the Debian source because CodePlex does not
232 ;; deliver an easily downloadable tarball.
234 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
235 version ".orig.tar.gz"))
238 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
239 (patch-flags '("-p1" "--binary"))
240 (patches (search-patches "libjxr-fix-function-signature.patch"
241 "libjxr-fix-typos.patch"))))
242 (build-system gnu-build-system)
243 (arguments '(#:make-flags '("CC=gcc")
244 #:tests? #f ; no check target
246 (modify-phases %standard-phases
247 (delete 'configure) ; no configure script
248 ;; The upstream makefile does not include an install phase.
250 (lambda* (#:key outputs #:allow-other-keys)
251 (let* ((out (assoc-ref outputs "out"))
252 (bin (string-append out "/bin"))
253 (lib (string-append out "/lib"))
254 (include (string-append out "/include/jxrlib")))
255 (for-each (lambda (file)
256 (install-file file include)
259 '("jxrgluelib/JXRGlue.h"
260 "jxrgluelib/JXRMeta.h"
261 "jxrtestlib/JXRTest.h"
262 "image/sys/windowsmediaphoto.h")
263 (find-files "common/include" "\\.h$")))
264 (for-each (lambda (file)
265 (install-file file lib)
267 (find-files "." "\\.a$"))
268 (for-each (lambda (file)
269 (install-file file bin)
271 '("JxrDecApp" "JxrEncApp")))
273 (synopsis "Implementation of the JPEG XR standard")
274 (description "JPEG XR is an approved ISO/IEC International standard (its
275 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
277 (license:non-copyleft
279 "See the header of the Makefile in the distribution."))
280 (home-page "https://jxrlib.codeplex.com/")))
282 (define-public jpegoptim
288 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
291 "1cn1i0g1xjdwa12w0ifbnzgb1vqbpr8ji6h05vxksj79vyi3x849"))))
292 (build-system gnu-build-system)
293 (inputs `(("libjpeg" ,libjpeg)))
297 (synopsis "Optimize JPEG images")
299 "jpegoptim provides lossless optimization (based on optimizing
300 the Huffman tables) and \"lossy\" optimization based on setting
301 maximum quality factor.")
302 (license license:gpl2+)
303 (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
305 (define-public libicns
312 "mirror://sourceforge/icns/"
313 "libicns-" version ".tar.gz"))
316 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
317 (build-system gnu-build-system)
322 `(#:tests? #t)) ; No tests.
323 (home-page "http://icns.sourceforge.net/")
324 (synopsis "Library for handling Mac OS icns resource files")
326 "Libicns is a library for the manipulation of Mac OS IconFamily resource
327 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
328 convert between PNG and ICNS. @command{icns2png} will extract image files from
329 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
330 with .desktop files. Additionally, @command{icontainer2png} is provided for
331 extracting icontainer icon files.")
332 (license (list license:lgpl2.1+ ; libicns
333 license:lgpl2.0+ ; src/apidocs.*
334 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
336 (define-public libtiff
342 (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
344 (patches (search-patches "libtiff-tiffgetfield-bugs.patch"))
347 "0419mh6kkhz5fkyl77gv0in8x4d2jpdpfs147y8mj86rrjlabmsr"))))
348 (build-system gnu-build-system)
350 "doc")) ;1.3 MiB of HTML documentation
352 ;; Instead of using --docdir, this package has its own --with-docdir.
353 `(#:configure-flags (list (string-append "--with-docdir="
354 (assoc-ref %outputs "doc")
356 ,name "-" ,version))))
357 (inputs `(("zlib" ,zlib)
358 ("libjpeg" ,libjpeg)))
359 (synopsis "Library for handling TIFF files")
361 "Libtiff provides support for the Tag Image File Format (TIFF), a format
362 used for storing image data.
363 Included are a library, libtiff, for reading and writing TIFF and a small
364 collection of tools for doing simple manipulations of TIFF images.")
365 (license (license:non-copyleft "file://COPYRIGHT"
366 "See COPYRIGHT in the distribution."))
367 (home-page "http://www.simplesystems.org/libtiff/")))
369 (define-public libwmf
376 (uri (string-append "mirror://sourceforge/wvware/"
378 "/" name "-" version ".tar.gz"))
380 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v"))
382 (search-patches "libwmf-CAN-2004-0941.patch"
383 "libwmf-CVE-2006-3376.patch"
384 "libwmf-CVE-2007-0455.patch"
385 "libwmf-CVE-2007-2756.patch"
386 "libwmf-CVE-2007-3472.patch"
387 "libwmf-CVE-2007-3473.patch"
388 "libwmf-CVE-2007-3477.patch"
389 "libwmf-CVE-2009-1364.patch"
390 "libwmf-CVE-2009-3546.patch"
391 "libwmf-CVE-2015-0848+CVE-2015-4588.patch"
392 "libwmf-CVE-2015-4695.patch"
393 "libwmf-CVE-2015-4696.patch"))))
395 (build-system gnu-build-system)
397 `(("freetype" ,freetype)
403 `(("pkg-config" ,pkg-config)))
404 (synopsis "Library for reading images in the Microsoft WMF format")
406 "libwmf is a library for reading vector images in Microsoft's native
407 Windows Metafile Format (WMF) and for either (a) displaying them in, e.g., an X
408 window; or (b) converting them to more standard/free file formats such as, e.g.,
409 the W3C's XML-based Scaleable Vector Graphic (SVG) format.")
410 (home-page "http://wvware.sourceforge.net/libwmf.html")
412 ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+.
413 (license license:lgpl2.0+)))
415 (define-public leptonica
423 "https://github.com/DanBloomberg/leptonica/archive/" version
425 (file-name (string-append "leptonica-" version ".tar.gz"))
427 (base32 "10pw7pwccd0m0fc9rlrr2m41s7j1qvba2wcrav17pw1gclkf34i0"))))
428 (build-system gnu-build-system)
430 `(("gnuplot" ,gnuplot) ;needed for test suite
431 ("autoconf" ,autoconf)
432 ("automake" ,automake)
434 ("pkg-config" ,pkg-config)))
440 ("libwebp" ,libwebp)))
442 ;; Linking a program with leptonica also requires these.
443 `(("openjpeg" ,openjpeg)
447 (modify-phases %standard-phases
448 (add-after 'unpack 'autogen
450 (zero? (system* "sh" "autobuild"))))
451 (add-after 'unpack 'patch-reg-wrapper
453 (substitute* "prog/reg_wrapper.sh"
455 (string-append " " (which "sh") " "))
458 (home-page "http://www.leptonica.com/")
459 (synopsis "Library and tools for image processing and analysis")
461 "Leptonica is a C library and set of command-line tools for efficient
462 image processing and image analysis operations. It supports rasterop, affine
463 transformations, binary and grayscale morphology, rank order, and convolution,
464 seedfill and connected components, image transformations combining changes in
465 scale and pixel depth, and pixelwise masking, blending, enhancement, and
467 (license license:bsd-2)))
469 (define-public jbig2dec
476 (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
477 name "-" version ".tar.gz"))
479 (base32 "04akiwab8iy5iy34razcvh9mcja9wy737civ3sbjxk4j143s1b2s"))
480 (patches (search-patches "jbig2dec-ignore-testtest.patch"
481 "jbig2dec-CVE-2016-9601.patch"
482 "jbig2dec-CVE-2017-7885.patch"
483 "jbig2dec-CVE-2017-7975.patch"
484 "jbig2dec-CVE-2017-7976.patch"))))
486 (build-system gnu-build-system)
487 (synopsis "Decoder of the JBIG2 image compression format")
489 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
490 monochrome) images at moderately high resolution, and in particular scanned
491 paper documents. In this domain it is very efficient, offering compression
492 ratios on the order of 100:1.
494 This is a decoder only implementation, and currently is in the alpha
495 stage, meaning it doesn't completely work yet. However, it is
496 maintaining parity with available encoders, so it is useful for real
498 (home-page "http://www.ghostscript.com/jbig2dec.html")
499 (license license:gpl2+)))
501 (define-public openjpeg
509 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
511 (file-name (string-append name "-" version ".tar.gz"))
514 "19yz4g0c45sm8y1z01j9djsrl1mkz3pmw7fykc6hkvrqymp7prsc"))
515 (patches (search-patches "openjpeg-CVE-2016-9850-CVE-2016-9851.patch"
516 "openjpeg-CVE-2016-9572-CVE-2016-9573.patch"))))
517 (build-system cmake-build-system)
519 ;; Trying to run `$ make check' results in a no rule fault.
526 (synopsis "JPEG 2000 codec")
528 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
529 been developed in order to promote the use of JPEG 2000, the new
530 still-image compression standard from the Joint Photographic Experts
533 In addition to the basic codec, various other features are under
534 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
535 an indexing tool useful for the JPIP protocol, JPWL-tools for
536 error-resilience, a Java-viewer for j2k-images, ...")
537 (home-page "https://github.com/uclouvain/openjpeg")
538 (license license:bsd-2)))
540 (define-public openjpeg-1
541 (package (inherit openjpeg)
548 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
549 name "-" version ".tar.gz"))
551 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
553 (define-public giflib
559 (uri (string-append "mirror://sourceforge/giflib/giflib-"
563 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
564 (build-system gnu-build-system)
565 (outputs '("bin" ; utility programs
567 (inputs `(("libx11" ,libx11)
573 (modify-phases %standard-phases
574 (add-after 'unpack 'disable-html-doc-gen
576 (substitute* "doc/Makefile.in"
577 (("^all: allhtml manpages") ""))))
578 (add-after 'install 'install-manpages
579 (lambda* (#:key outputs #:allow-other-keys)
580 (let* ((bin (assoc-ref outputs "bin"))
581 (man1dir (string-append bin "/share/man/man1")))
583 (for-each (lambda (file)
584 (let ((base (basename file)))
585 (format #t "installing `~a' to `~a'~%"
590 (find-files "doc" "\\.1"))))))))
591 (synopsis "Tools and library for working with GIF images")
593 "GIFLIB is a library for reading and writing GIF images. It is API and
594 ABI compatible with libungif which was in wide use while the LZW compression
595 algorithm was patented. Tools are also included to convert, manipulate,
596 compose, and analyze GIF images.")
597 (home-page "http://giflib.sourceforge.net/")
598 (license license:x11)))
600 (define-public libungif
606 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
607 "libungif-" version "/libungif-"
611 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
612 (build-system gnu-build-system)
613 (inputs `(("perl" ,perl))) ;package ships some perl tools
614 (home-page "http://giflib.sourceforge.net/")
615 (synopsis "GIF decompression library")
617 "libungif is the old GIF decompression library by the GIFLIB project.")
618 (license license:expat)))
620 (define-public imlib2
627 "mirror://sourceforge/enlightenment/imlib2-src/" version
628 "/imlib2-" version ".tar.bz2"))
631 "0wm2q2xlkbm71k7mw2jyzbxgzylrkcj5yh6nq58w5gybhp98qs9z"))))
632 (build-system gnu-build-system)
634 `(("pkgconfig" ,pkg-config)))
638 ("freetype" ,freetype)
644 (home-page "https://sourceforge.net/projects/enlightenment/")
646 "Loading, saving, rendering and manipulating image files")
648 "Imlib2 is a library that does image file loading and saving as well as
649 rendering, manipulation, arbitrary polygon support, etc.
651 It does ALL of these operations FAST. Imlib2 also tries to be highly
652 intelligent about doing them, so writing naive programs can be done easily,
653 without sacrificing speed.
655 This is a complete rewrite over the Imlib 1.x series. The architecture is
656 more modular, simple, and flexible.")
657 (license license:imlib2)))
659 (define-public giblib
667 "http://linuxbrit.co.uk/downloads/giblib-"
670 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
671 "files/giblib/giblib-" version ".tar.gz")))
674 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
675 (build-system gnu-build-system)
679 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
680 (synopsis "Wrapper library for imlib2")
682 "Giblib is a simple library which wraps imlib2's context API, avoiding
683 all the context_get/set calls, adds fontstyles to the truetype renderer and
684 supplies a generic doubly-linked list and some string functions.")
685 ;; This license removes a clause about X Consortium from the original
687 (license (license:x11-style "file://COPYING"
688 "See 'COPYING' in the distribution."))))
690 (define-public freeimage
697 "mirror://sourceforge/freeimage/Source%20Distribution/"
699 (string-concatenate (string-split version #\.))
703 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
704 (patches (search-patches "freeimage-CVE-2015-0852.patch"
705 "freeimage-CVE-2016-5684.patch"
706 "freeimage-fix-build-with-gcc-5.patch"))))
707 (build-system gnu-build-system)
710 (modify-phases %standard-phases
712 (add-before 'build 'patch-makefile
713 (lambda* (#:key outputs #:allow-other-keys)
714 (substitute* "Makefile.gnu"
715 (("/usr") (assoc-ref outputs "out"))
716 (("-o root -g root") ""))
718 #:make-flags '("CC=gcc")
719 #:tests? #f)) ; no check target
722 ;; Fails to build on MIPS due to assembly code in the source.
723 (supported-systems (delete "mips64el-linux" %supported-systems))
724 (synopsis "Library for handling popular graphics image formats")
726 "FreeImage is a library for developers who would like to support popular
727 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
728 (license license:gpl2+)
729 (home-page "http://freeimage.sourceforge.net")))
738 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
739 "Version-1-11-0/vigra-"
740 version "-src.tar.gz"))
742 "1jzm79kqiiilvys3b8mlzy9cvmiirrcwsrlg19qd9rza8zipsqb8"))))
743 (build-system cmake-build-system)
749 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
750 ; to create a configure-flag
755 ("python" ,python-2) ; print syntax
756 ("python2-numpy" ,python2-numpy)
759 `(("doxygen" ,doxygen)
760 ("python2-nose" ,python2-nose)
761 ("python2-sphinx" ,python2-sphinx)))
763 `(#:test-target "check"
764 #:parallel-build? #f ; parallel builds trigger an ICE
766 (list "-Wno-dev" ; suppress developer mode with lots of warnings
767 (string-append "-DVIGRANUMPY_INSTALL_DIR="
768 (assoc-ref %outputs "out")
769 "/lib/python2.7/site-packages")
770 ;; OpenEXR is not enabled by default.
772 ;; Fix rounding error on 32-bit machines
773 "-DCMAKE_C_FLAGS=-ffloat-store"
774 ;; The header files of ilmbase are not found when included
775 ;; by the header files of openexr, and an explicit flag
777 (string-append "-DCMAKE_CXX_FLAGS=-I"
778 (assoc-ref %build-inputs "ilmbase")
781 (synopsis "Computer vision library")
783 "VIGRA stands for Vision with Generic Algorithms. It is an image
784 processing and analysis library that puts its main emphasis on customizable
785 algorithms and data structures. It is particularly strong for
786 multi-dimensional image processing.")
787 (license license:expat)
788 (home-page "https://hci.iwr.uni-heidelberg.de/vigra")))
790 (define-public libwebp
798 "http://downloads.webmproject.org/releases/webp/libwebp-" version
802 "0h1brwkyxc7lb8lc53aacdks5vc1y9hzngqi41gg7y6l56912a69"))))
803 (build-system gnu-build-system)
805 `(("freeglut" ,freeglut)
809 ("libtiff" ,libtiff)))
811 '(#:configure-flags '("--enable-libwebpmux"
812 "--enable-libwebpdemux"
813 "--enable-libwebpdecoder")))
814 (home-page "https://developers.google.com/speed/webp/")
815 (synopsis "Lossless and lossy image compression")
817 "WebP is a new image format that provides lossless and lossy compression
818 for images. WebP lossless images are 26% smaller in size compared to
819 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
820 equivalent SSIM index. WebP supports lossless transparency (also known as
821 alpha channel) with just 22% additional bytes. Transparency is also supported
822 with lossy compression and typically provides 3x smaller file sizes compared
823 to PNG when lossy compression is acceptable for the red/green/blue color
825 (license license:bsd-3)))
827 (define-public libmng
833 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
834 version "/" name "-" version ".tar.xz"))
837 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
838 (build-system gnu-build-system)
840 ;; These are all in the 'Libs.private' field of libmng.pc.
844 (home-page "http://www.libmng.com/")
845 (synopsis "Library for handling MNG files")
847 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
848 (license license:bsd-3)))
856 (uri (list (string-append "http://www.exiv2.org/builds/exiv2-"
857 version "-trunk.tar.gz")
858 (string-append "http://www.exiv2.org/exiv2-"
860 (string-append "https://fossies.org/linux/misc/exiv2-"
864 "1hsdzlzgkipprqh93yj81mrckl2l7c2mn2i84691pallnjz5qqhc"))))
865 (build-system gnu-build-system)
866 (arguments '(#:tests? #f)) ; no `check' target
871 `(("intltool" ,intltool)))
872 (home-page "http://www.exiv2.org/")
873 (synopsis "Library and command-line utility to manage image metadata")
875 "Exiv2 is a C++ library and a command line utility to manage image
876 metadata. It provides fast and easy read and write access to the Exif, IPTC
877 and XMP metadata of images in various formats.")
879 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
880 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
881 ;; The core is GPLv2+:
882 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
883 (license license:gpl2+)))
891 (uri (string-append "http://downloads.sourceforge.net/openil/"
892 "DevIL-" version ".tar.gz"))
895 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
896 (build-system cmake-build-system)
898 '(;; XXX: Not supported in the released CMakeLists.txt.
899 ;; Enable this for > 1.8.0.
902 (modify-phases %standard-phases
903 (add-before 'configure 'change-directory
904 (lambda _ (chdir "DevIL") #t)))))
906 `(("pkg-config" ,pkg-config)))
909 ("libjpeg" ,libjpeg-turbo)
915 (synopsis "Library for manipulating many image formats")
916 (description "Developer's Image Library (DevIL) is a library to develop
917 applications with support for many types of images. DevIL can load, save,
918 convert, manipulate, filter and display a wide variety of image formats.")
919 (home-page "http://openil.sourceforge.net")
920 (license license:lgpl2.1+)))
922 (define-public jasper
928 (uri (string-append "https://github.com/mdadams/jasper/archive/"
929 "version-" version ".tar.gz"))
930 (file-name (string-append name "-" version ".tar.gz"))
933 "090cyqcvqp4y12nc57gvcbrk3ap1rnnixd4qj90sx0pw3fs1615m"))))
934 (build-system cmake-build-system)
935 (inputs `(("libjpeg" ,libjpeg)))
936 (synopsis "JPEG-2000 library")
937 (description "The JasPer Project is an initiative to provide a reference
938 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
940 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
941 (license (license:x11-style "file://LICENSE"))))
950 (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
951 "release-" version ".tar.gz"))
952 (file-name (string-append name "-" version ".tar.gz"))
955 "0kbq2dy659645fmgxpzg38b6y6x82kwkydhc380kdkaikv2brcjh"))))
956 (build-system gnu-build-system)
958 `(("autoconf" ,autoconf)
959 ("automake" ,automake)
960 ("libtool" ,libtool)))
963 (modify-phases %standard-phases
964 (add-after 'unpack 'autogen
966 (zero? (system* "sh" "autogen.sh")))))))
967 (synopsis "Scaling, colorspace conversion, and dithering library")
968 (description "Zimg implements the commonly required image processing basics
969 of scaling, colorspace conversion, and depth conversion. A simple API enables
970 conversion between any supported formats to operate with minimal knowledge from
972 (home-page "https://github.com/sekrit-twc/zimg")
973 ;; test/extra/ contains musl-libm,
974 ;; which is MIT/expat licensed, but only used for tests
975 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
977 (define-public perceptualdiff
979 (name "perceptualdiff")
984 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
986 (file-name (string-append name "-" version ".tar.gz"))
989 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
990 (build-system cmake-build-system)
991 (inputs `(("freeimage" ,freeimage)))
993 '(#:phases (modify-phases %standard-phases
994 (add-after 'unpack 'fix-tests
995 ;; cmake-build-system uses a build/ directory outside
996 ;; of the source tree, one level higher than expected
998 (substitute* "test/run_tests.bash"
999 (("../build") "../../build")))))))
1000 (home-page "https://github.com/myint/perceptualdiff")
1001 (synopsis "Perceptual image comparison utility")
1002 (description "PerceptualDiff visually compares two images to determine
1003 whether they look alike. It uses a computational model of the human visual
1004 system to detect similarities. This allows it too see beyond irrelevant
1005 differences in file encoding, image quality, and other small variations.")
1006 (license license:gpl2+)))
1008 (define-public steghide
1014 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1015 version "/steghide-" version ".tar.bz2"))
1018 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1019 (patches (list (search-patch "steghide-fixes.patch")))))
1020 (build-system gnu-build-system)
1022 `(("gettext" ,gettext-minimal)
1023 ("libtool" ,libtool)
1024 ("perl" ,perl))) ;for tests
1026 `(("libmhash" ,libmhash)
1027 ("libmcrypt" ,libmcrypt)
1028 ("libjpeg" ,libjpeg)
1031 `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc
1032 (home-page "http://steghide.sourceforge.net")
1033 (synopsis "Image and audio steganography")
1035 "Steghide is a steganography program that is able to hide data in various
1036 kinds of image- and audio-files. The color- respectivly sample-frequencies
1037 are not changed thus making the embedding resistant against first-order
1038 statistical tests.")
1039 (license license:gpl2+)))
1041 (define-public stb-image-for-extempore
1042 (let ((revision "1")
1043 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1045 (name "stb-image-for-extempore")
1046 (version (string-append "0-" revision "." (string-take commit 9)))
1048 (origin (method git-fetch)
1050 (url "https://github.com/extemporelang/stb.git")
1054 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1055 (file-name (string-append name "-" version "-checkout"))))
1056 (build-system cmake-build-system)
1057 (arguments `(#:tests? #f)) ; no tests included
1058 ;; Extempore refuses to build on architectures other than x86_64
1059 (supported-systems '("x86_64-linux"))
1060 (home-page "https://github.com/extemporelang/stb")
1061 (synopsis "Image library for Extempore")
1063 "This package is a collection of assorted single-file libraries. Of
1064 all included libraries only the image loading and decoding library is
1065 installed as @code{stb_image}.")
1066 (license license:public-domain))))
1068 (define-public optipng
1075 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1079 "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
1080 (build-system gnu-build-system)
1085 (modify-phases %standard-phases
1086 ;; configure script does not accept arguments CONFIG_SHELL and SHELL
1088 (lambda* (#:key outputs #:allow-other-keys)
1089 (zero? (system* "sh" "configure"
1090 (string-append "--prefix=" (assoc-ref outputs "out")))))))))
1091 (synopsis "Optimizer that recompresses PNG image files to a
1093 (description "OptiPNG is a PNG optimizer that recompresses image
1094 files to a smaller size, without losing any information. This program
1095 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1096 PNG, and performs PNG integrity checks and corrections.")
1097 (home-page "http://optipng.sourceforge.net/")
1098 (license license:zlib)))
1100 (define-public libjpeg-turbo
1102 (name "libjpeg-turbo")
1106 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1107 name "-" version ".tar.gz"))
1110 "0v365hm6z6lddcqagjj15wflk66rqyw75m73cqzl65rh4lyrshj1"))))
1111 (build-system gnu-build-system)
1115 '(#:test-target "test"
1117 (modify-phases %standard-phases
1118 (add-after 'unpack 'set-env-on-MIPS
1119 ;; This is borrowed from Debian's patchset for libjpeg
1120 ;; https://sources.debian.net/data/main/libj/libjpeg-turbo/1:1.5.1-2/debian/patches/0001-Declare-env-on-MIPS-on-first-use-Courtesy-of-Aurelie.patch
1122 (substitute* "simd/jsimd_mips.c"
1123 (("env = getenv\\(\"JSIMD_FORCEDSPR2")
1124 "char *env = getenv(\"JSIMD_FORCEDSPR2"))
1126 (home-page "http://www.libjpeg-turbo.org/")
1127 (synopsis "SIMD-accelerated JPEG image handling library")
1128 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1129 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1130 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1131 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1132 a significant amount.
1133 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1134 but more straightforward TurboJPEG API, and provides a full-featured Java
1135 interface. It supports color space extensions that allow it to compress from
1136 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1137 (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/
1138 license:ijg)))) ; the rest
1140 (define-public niftilib
1146 (uri (list (string-append "mirror://sourceforge/niftilib/"
1147 "nifticlib/nifticlib_"
1148 (string-join (string-split version #\.) "_")
1149 "/nifticlib-" version ".tar.gz")))
1151 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1152 (build-system gnu-build-system)
1154 '(#:tests? #f ; there is no test target
1155 #:parallel-build? #f ; not supported
1158 (string-append "ZLIB_INC="
1159 (assoc-ref %build-inputs "zlib") "/include")
1160 ;; Append "-fPIC" to CFLAGS.
1161 (string-append "CFLAGS="
1162 "-Wall -ansi -pedantic -fPIC"))
1164 (modify-phases %standard-phases
1166 (lambda* (#:key outputs #:allow-other-keys)
1167 (let ((out (assoc-ref outputs "out")))
1170 (copy-recursively dir (string-append out "/" dir)))
1171 '("bin" "lib" "include")))
1173 (delete 'configure))))
1176 (synopsis "Library for reading and writing files in the nifti-1 format")
1177 (description "Niftilib is a set of i/o libraries for reading and writing
1178 files in the nifti-1 data format - a binary file format for storing
1179 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1180 (fMRI) brain images.")
1181 (home-page "http://niftilib.sourceforge.net")
1182 (license license:public-domain)))