1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 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 Kei Kebreau <kei@openmailbox.org>
17 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
19 ;;; This file is part of GNU Guix.
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34 (define-module (gnu packages image)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages assembly)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages boost)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages documentation)
42 #:use-module (gnu packages fontutils)
43 ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
44 #:use-module (gnu packages gcc)
45 #:use-module (gnu packages gettext)
46 #:use-module (gnu packages ghostscript)
47 #:use-module (gnu packages gl)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages graphics)
50 #:use-module (gnu packages maths)
51 #:use-module (gnu packages mcrypt)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages python)
55 #:use-module (gnu packages xml)
56 #:use-module (gnu packages xorg)
57 #:use-module (gnu packages zip)
58 #:use-module ((guix licenses) #:prefix license:)
59 #:use-module (guix packages)
60 #:use-module (guix download)
61 #:use-module (guix git-download)
62 #:use-module (guix build-system gnu)
63 #:use-module (guix build-system cmake)
64 #:use-module (srfi srfi-1))
72 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
73 version "/libpng-" version ".tar.xz")
75 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
76 "/libpng16/libpng-" version ".tar.xz")
78 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
79 "/libpng16/libpng-" version ".tar.xz")))
81 (base32 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
82 (build-system gnu-build-system)
84 ;; libpng.la says "-lz", so propagate it.
85 (propagated-inputs `(("zlib" ,zlib)))
87 (synopsis "Library for handling PNG files")
89 "Libpng is the official PNG (Portable Network Graphics) reference
90 library. It supports almost all PNG features and is extensible.")
91 (license license:zlib)
92 (home-page "http://www.libpng.org/pub/png/libpng.html")))
94 (define-public libpng-apng
97 (replacement #f) ;libpng's replacement doesn't apply here
99 (version (package-version libpng))
102 (modify-phases %standard-phases
103 (add-after 'unpack 'patch-apng
104 (lambda* (#:key inputs #:allow-other-keys)
105 (define (apply-patch file)
106 (zero? (system* "patch" "-p1" "--force"
108 (let ((apng.gz (assoc-ref inputs "apng")))
109 (format #t "Applying APNG patch '~a'...~%"
111 (system (string-append "gunzip < " apng.gz " > the-patch"))
112 (and (apply-patch "the-patch")
113 (for-each apply-patch
114 (find-files "\\.patch"))))
116 (add-before 'configure 'no-checks
118 (substitute* "Makefile.in"
119 (("^scripts/symbols.chk") "")
120 (("check: scripts/symbols.chk") ""))
126 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
127 version "/libpng-" version "-apng.patch.gz"))
130 "026r0gbkf6d6v54wca02cdxln8sj4m2c1yk62sj2aasv2ki2ffh5"))))))
132 `(("libtool" ,libtool)))
133 (synopsis "APNG patch for libpng")
135 "APNG (Animated Portable Network Graphics) is an unofficial
136 extension of the APNG (Portable Network Graphics) format.
137 APNG patch provides APNG support to libpng.")
138 (home-page "https://sourceforge.net/projects/libpng-apng/")))
140 (define-public libpng-1.2
147 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
148 version "/libpng-" version ".tar.xz")
150 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
151 "/libpng12/libpng-" version ".tar.xz")
153 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
154 "/libpng12/libpng-" version ".tar.xz")))
156 (base32 "1n2lrzjkm5jhfg2bs10q398lkwbbx742fi27zgdgx0x23zhj0ihg"))))))
158 (define-public libjpeg
164 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
167 "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
168 (build-system gnu-build-system)
169 (synopsis "Library for handling JPEG files")
171 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
172 JPEG is a standardized compression method for full-color and gray-scale
174 The included programs provide conversion between the JPEG format and
175 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
176 (license license:ijg)
177 (home-page "http://www.ijg.org/")))
179 (define-public libjpeg-8
180 (package (inherit libjpeg)
184 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
187 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
189 (define-public libjxr
194 ;; We are using the Debian source because CodePlex does not
195 ;; deliver an easily downloadable tarball.
197 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
198 version ".orig.tar.gz"))
201 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
202 (patch-flags '("-p1" "--binary"))
203 (patches (search-patches "libjxr-fix-function-signature.patch"
204 "libjxr-fix-typos.patch"))))
205 (build-system gnu-build-system)
206 (arguments '(#:make-flags '("CC=gcc")
207 #:tests? #f ; no check target
209 (modify-phases %standard-phases
210 (delete 'configure) ; no configure script
211 ;; The upstream makefile does not include an install phase.
213 (lambda* (#:key outputs #:allow-other-keys)
214 (let* ((out (assoc-ref outputs "out"))
215 (bin (string-append out "/bin"))
216 (lib (string-append out "/lib"))
217 (include (string-append out "/include/jxrlib")))
218 (for-each (lambda (file)
219 (install-file file include)
222 '("jxrgluelib/JXRGlue.h"
223 "jxrgluelib/JXRMeta.h"
224 "jxrtestlib/JXRTest.h"
225 "image/sys/windowsmediaphoto.h")
226 (find-files "common/include" "\\.h$")))
227 (for-each (lambda (file)
228 (install-file file lib)
230 (find-files "." "\\.a$"))
231 (for-each (lambda (file)
232 (install-file file bin)
234 '("JxrDecApp" "JxrEncApp")))
236 (synopsis "Implementation of the JPEG XR standard")
237 (description "JPEG XR is an approved ISO/IEC International standard (its
238 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
240 (license:non-copyleft
242 "See the header of the Makefile in the distribution."))
243 (home-page "https://jxrlib.codeplex.com/")))
245 (define-public jpegoptim
251 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
254 "1cn1i0g1xjdwa12w0ifbnzgb1vqbpr8ji6h05vxksj79vyi3x849"))))
255 (build-system gnu-build-system)
256 (inputs `(("libjpeg" ,libjpeg)))
260 (synopsis "Optimize JPEG images")
262 "jpegoptim provides lossless optimization (based on optimizing
263 the Huffman tables) and \"lossy\" optimization based on setting
264 maximum quality factor.")
265 (license license:gpl2+)
266 (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
268 (define-public libicns
275 "mirror://sourceforge/icns/"
276 "libicns-" version ".tar.gz"))
279 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
280 (build-system gnu-build-system)
285 `(#:tests? #t)) ; No tests.
286 (home-page "http://icns.sourceforge.net/")
287 (synopsis "Library for handling Mac OS icns resource files")
289 "Libicns is a library for the manipulation of Mac OS IconFamily resource
290 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
291 convert between PNG and ICNS. @command{icns2png} will extract image files from
292 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
293 with .desktop files. Additionally, @command{icontainer2png} is provided for
294 extracting icontainer icon files.")
295 (license (list license:lgpl2.1+ ; libicns
296 license:lgpl2.0+ ; src/apidocs.*
297 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
299 (define-public libtiff
305 (uri (string-append "ftp://download.osgeo.org/libtiff/tiff-"
307 (patches (search-patches "libtiff-heap-overflow-tiffcp.patch"
308 "libtiff-null-dereference.patch"
309 "libtiff-heap-overflow-tif-dirread.patch"
310 "libtiff-heap-overflow-pixarlog-luv.patch"
311 "libtiff-divide-by-zero.patch"
312 "libtiff-divide-by-zero-ojpeg.patch"
313 "libtiff-tiffcp-underflow.patch"
314 "libtiff-invalid-read.patch"
315 "libtiff-CVE-2016-10092.patch"
316 "libtiff-heap-overflow-tiffcrop.patch"
317 "libtiff-divide-by-zero-tiffcrop.patch"
318 "libtiff-CVE-2016-10093.patch"
319 "libtiff-divide-by-zero-tiffcp.patch"
320 "libtiff-assertion-failure.patch"
321 "libtiff-CVE-2016-10094.patch"
322 "libtiff-CVE-2017-5225.patch"))
325 "06ghqhr4db1ssq0acyyz49gr8k41gzw6pqb6mbn5r7jqp77s4hwz"))))
326 (build-system gnu-build-system)
328 "doc")) ;1.3 MiB of HTML documentation
330 ;; Instead of using --docdir, this package has its own --with-docdir.
331 `(#:configure-flags (list (string-append "--with-docdir="
332 (assoc-ref %outputs "doc")
334 ,name "-" ,version))))
335 ;; Build with a patched GCC to work around <http://bugs.gnu.org/24703>.
338 (inputs `(("zlib" ,zlib)
339 ("libjpeg" ,libjpeg)))
340 (synopsis "Library for handling TIFF files")
342 "Libtiff provides support for the Tag Image File Format (TIFF), a format
343 used for storing image data.
344 Included are a library, libtiff, for reading and writing TIFF and a small
345 collection of tools for doing simple manipulations of TIFF images.")
346 (license (license:non-copyleft "file://COPYRIGHT"
347 "See COPYRIGHT in the distribution."))
348 (home-page "http://www.simplesystems.org/libtiff/")))
350 (define-public libwmf
357 (uri (string-append "mirror://sourceforge/wvware/"
359 "/" name "-" version ".tar.gz"))
361 (base32 "1y3wba4q8pl7kr51212jwrsz1x6nslsx1gsjml1x0i8549lmqd2v"))
363 (search-patches "libwmf-CAN-2004-0941.patch"
364 "libwmf-CVE-2006-3376.patch"
365 "libwmf-CVE-2007-0455.patch"
366 "libwmf-CVE-2007-2756.patch"
367 "libwmf-CVE-2007-3472.patch"
368 "libwmf-CVE-2007-3473.patch"
369 "libwmf-CVE-2007-3477.patch"
370 "libwmf-CVE-2009-1364.patch"
371 "libwmf-CVE-2009-3546.patch"
372 "libwmf-CVE-2015-0848+CVE-2015-4588.patch"
373 "libwmf-CVE-2015-4695.patch"
374 "libwmf-CVE-2015-4696.patch"))))
376 (build-system gnu-build-system)
378 `(("freetype" ,freetype)
384 `(("pkg-config" ,pkg-config)))
385 (synopsis "Library for reading images in the Microsoft WMF format")
387 "libwmf is a library for reading vector images in Microsoft's native
388 Windows Metafile Format (WMF) and for either (a) displaying them in, e.g., an X
389 window; or (b) converting them to more standard/free file formats such as, e.g.,
390 the W3C's XML-based Scaleable Vector Graphic (SVG) format.")
391 (home-page "http://wvware.sourceforge.net/libwmf.html")
393 ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+.
394 (license license:lgpl2.0+)))
396 (define-public leptonica
404 "https://github.com/DanBloomberg/leptonica/archive/" version
406 (file-name (string-append "leptonica-" version ".tar.gz"))
408 (base32 "0i2a4vx9gizki0wgmv03xjz8j9d8agkvbag1a8m4kcw4asd4p87g"))))
409 (build-system gnu-build-system)
411 `(("gnuplot" ,gnuplot) ;needed for test suite
412 ("autoconf" ,autoconf)
413 ("automake" ,automake)
415 ("pkg-config" ,pkg-config)))
421 ("libwebp" ,libwebp)))
423 ;; Linking a program with leptonica also requires these.
424 `(("openjpeg" ,openjpeg)
428 (modify-phases %standard-phases
429 (add-after 'unpack 'autogen
431 (zero? (system* "sh" "autobuild"))))
432 (add-after 'unpack 'patch-reg-wrapper
434 (substitute* "prog/reg_wrapper.sh"
436 (string-append " " (which "sh") " "))
439 (home-page "http://www.leptonica.com/")
440 (synopsis "Library and tools for image processing and analysis")
442 "Leptonica is a C library and set of command-line tools for efficient
443 image processing and image analysis operations. It supports rasterop, affine
444 transformations, binary and grayscale morphology, rank order, and convolution,
445 seedfill and connected components, image transformations combining changes in
446 scale and pixel depth, and pixelwise masking, blending, enhancement, and
448 (license license:bsd-2)))
450 (define-public jbig2dec
457 (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
458 name "-" version ".tar.gz"))
460 (base32 "04akiwab8iy5iy34razcvh9mcja9wy737civ3sbjxk4j143s1b2s"))
461 (patches (search-patches "jbig2dec-ignore-testtest.patch"
462 "jbig2dec-CVE-2016-9601.patch"))))
464 (build-system gnu-build-system)
465 (synopsis "Decoder of the JBIG2 image compression format")
467 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
468 monochrome) images at moderately high resolution, and in particular scanned
469 paper documents. In this domain it is very efficient, offering compression
470 ratios on the order of 100:1.
472 This is a decoder only implementation, and currently is in the alpha
473 stage, meaning it doesn't completely work yet. However, it is
474 maintaining parity with available encoders, so it is useful for real
476 (home-page "http://www.ghostscript.com/jbig2dec.html")
477 (license license:gpl2+)))
479 (define-public openjpeg
487 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
489 (file-name (string-append name "-" version ".tar.gz"))
492 "19yz4g0c45sm8y1z01j9djsrl1mkz3pmw7fykc6hkvrqymp7prsc"))
493 (patches (search-patches "openjpeg-CVE-2016-9850-CVE-2016-9851.patch"
494 "openjpeg-CVE-2016-9572-CVE-2016-9573.patch"))))
495 (build-system cmake-build-system)
497 ;; Trying to run `$ make check' results in a no rule fault.
504 (synopsis "JPEG 2000 codec")
506 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
507 been developed in order to promote the use of JPEG 2000, the new
508 still-image compression standard from the Joint Photographic Experts
511 In addition to the basic codec, various other features are under
512 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
513 an indexing tool useful for the JPIP protocol, JPWL-tools for
514 error-resilience, a Java-viewer for j2k-images, ...")
515 (home-page "https://github.com/uclouvain/openjpeg")
516 (license license:bsd-2)))
518 (define-public openjpeg-1
519 (package (inherit openjpeg)
526 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
527 name "-" version ".tar.gz"))
529 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
531 (define-public giflib
537 (uri (string-append "mirror://sourceforge/giflib/giflib-"
541 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
542 (build-system gnu-build-system)
543 (outputs '("bin" ; utility programs
545 (inputs `(("libx11" ,libx11)
551 (modify-phases %standard-phases
552 (add-after 'unpack 'disable-html-doc-gen
554 (substitute* "doc/Makefile.in"
555 (("^all: allhtml manpages") ""))))
556 (add-after 'install 'install-manpages
557 (lambda* (#:key outputs #:allow-other-keys)
558 (let* ((bin (assoc-ref outputs "bin"))
559 (man1dir (string-append bin "/share/man/man1")))
561 (for-each (lambda (file)
562 (let ((base (basename file)))
563 (format #t "installing `~a' to `~a'~%"
568 (find-files "doc" "\\.1"))))))))
569 (synopsis "Tools and library for working with GIF images")
571 "GIFLIB is a library for reading and writing GIF images. It is API and
572 ABI compatible with libungif which was in wide use while the LZW compression
573 algorithm was patented. Tools are also included to convert, manipulate,
574 compose, and analyze GIF images.")
575 (home-page "http://giflib.sourceforge.net/")
576 (license license:x11)))
578 (define-public libungif
584 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
585 "libungif-" version "/libungif-"
589 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
590 (build-system gnu-build-system)
591 (inputs `(("perl" ,perl))) ;package ships some perl tools
592 (home-page "http://giflib.sourceforge.net/")
593 (synopsis "GIF decompression library")
595 "libungif is the old GIF decompression library by the GIFLIB project.")
596 (license license:expat)))
598 (define-public imlib2
605 "mirror://sourceforge/enlightenment/imlib2-src/" version
606 "/imlib2-" version ".tar.bz2"))
609 "0wm2q2xlkbm71k7mw2jyzbxgzylrkcj5yh6nq58w5gybhp98qs9z"))))
610 (build-system gnu-build-system)
612 `(("pkgconfig" ,pkg-config)))
616 ("freetype" ,freetype)
622 (home-page "https://sourceforge.net/projects/enlightenment/")
624 "Loading, saving, rendering and manipulating image files")
626 "Imlib2 is a library that does image file loading and saving as well as
627 rendering, manipulation, arbitrary polygon support, etc.
629 It does ALL of these operations FAST. Imlib2 also tries to be highly
630 intelligent about doing them, so writing naive programs can be done easily,
631 without sacrificing speed.
633 This is a complete rewrite over the Imlib 1.x series. The architecture is
634 more modular, simple, and flexible.")
635 (license license:imlib2)))
637 (define-public giblib
645 "http://linuxbrit.co.uk/downloads/giblib-"
648 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
649 "files/giblib/giblib-" version ".tar.gz")))
652 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
653 (build-system gnu-build-system)
657 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
658 (synopsis "Wrapper library for imlib2")
660 "Giblib is a simple library which wraps imlib2's context API, avoiding
661 all the context_get/set calls, adds fontstyles to the truetype renderer and
662 supplies a generic doubly-linked list and some string functions.")
663 ;; This license removes a clause about X Consortium from the original
665 (license (license:x11-style "file://COPYING"
666 "See 'COPYING' in the distribution."))))
668 (define-public freeimage
675 "mirror://sourceforge/freeimage/Source%20Distribution/"
677 (string-concatenate (string-split version #\.))
681 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
682 (patches (search-patches "freeimage-CVE-2015-0852.patch"
683 "freeimage-CVE-2016-5684.patch"
684 "freeimage-fix-build-with-gcc-5.patch"))))
685 (build-system gnu-build-system)
688 (modify-phases %standard-phases
690 (add-before 'build 'patch-makefile
691 (lambda* (#:key outputs #:allow-other-keys)
692 (substitute* "Makefile.gnu"
693 (("/usr") (assoc-ref outputs "out"))
694 (("-o root -g root") ""))
696 #:make-flags '("CC=gcc")
697 #:tests? #f)) ; no check target
700 ;; Fails to build on MIPS due to assembly code in the source.
701 (supported-systems (delete "mips64el-linux" %supported-systems))
702 (synopsis "Library for handling popular graphics image formats")
704 "FreeImage is a library for developers who would like to support popular
705 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
706 (license license:gpl2+)
707 (home-page "http://freeimage.sourceforge.net")))
716 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
717 "Version-1-11-0/vigra-"
718 version "-src.tar.gz"))
720 "1jzm79kqiiilvys3b8mlzy9cvmiirrcwsrlg19qd9rza8zipsqb8"))))
721 (build-system cmake-build-system)
727 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
728 ; to create a configure-flag
733 ("python" ,python-2) ; print syntax
734 ("python2-numpy" ,python2-numpy)
737 `(("doxygen" ,doxygen)
738 ("python2-nose" ,python2-nose)
739 ("python2-sphinx" ,python2-sphinx)))
741 `(#:test-target "check"
742 #:parallel-build? #f ; parallel builds trigger an ICE
744 (list "-Wno-dev" ; suppress developer mode with lots of warnings
745 (string-append "-DVIGRANUMPY_INSTALL_DIR="
746 (assoc-ref %outputs "out")
747 "/lib/python2.7/site-packages")
748 ;; OpenEXR is not enabled by default.
750 ;; Fix rounding error on 32-bit machines
751 "-DCMAKE_C_FLAGS=-ffloat-store"
752 ;; The header files of ilmbase are not found when included
753 ;; by the header files of openexr, and an explicit flag
755 (string-append "-DCMAKE_CXX_FLAGS=-I"
756 (assoc-ref %build-inputs "ilmbase")
759 (synopsis "Computer vision library")
761 "VIGRA stands for Vision with Generic Algorithms. It is an image
762 processing and analysis library that puts its main emphasis on customizable
763 algorithms and data structures. It is particularly strong for
764 multi-dimensional image processing.")
765 (license license:expat)
766 (home-page "https://hci.iwr.uni-heidelberg.de/vigra")))
768 (define-public libwebp
776 "http://downloads.webmproject.org/releases/webp/libwebp-" version
780 "0h1brwkyxc7lb8lc53aacdks5vc1y9hzngqi41gg7y6l56912a69"))))
781 (build-system gnu-build-system)
783 `(("freeglut" ,freeglut)
787 ("libtiff" ,libtiff)))
789 '(#:configure-flags '("--enable-libwebpmux"
790 "--enable-libwebpdemux"
791 "--enable-libwebpdecoder")))
792 (home-page "https://developers.google.com/speed/webp/")
793 (synopsis "Lossless and lossy image compression")
795 "WebP is a new image format that provides lossless and lossy compression
796 for images. WebP lossless images are 26% smaller in size compared to
797 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
798 equivalent SSIM index. WebP supports lossless transparency (also known as
799 alpha channel) with just 22% additional bytes. Transparency is also supported
800 with lossy compression and typically provides 3x smaller file sizes compared
801 to PNG when lossy compression is acceptable for the red/green/blue color
803 (license license:bsd-3)))
805 (define-public libmng
811 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
812 version "/" name "-" version ".tar.xz"))
815 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
816 (build-system gnu-build-system)
818 ;; These are all in the 'Libs.private' field of libmng.pc.
822 (home-page "http://www.libmng.com/")
823 (synopsis "Library for handling MNG files")
825 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
826 (license license:bsd-3)))
834 (uri (list (string-append "http://www.exiv2.org/exiv2-"
836 (string-append "https://fossies.org/linux/misc/exiv2-"
840 "197g6vgcpyf9p2cwn5p5hb1r714xsk1v4p96f5pv1z8mi9vzq2y8"))))
841 (build-system gnu-build-system)
842 (arguments '(#:tests? #f)) ; no `check' target
847 `(("intltool" ,intltool)))
848 (home-page "http://www.exiv2.org/")
849 (synopsis "Library and command-line utility to manage image metadata")
851 "Exiv2 is a C++ library and a command line utility to manage image
852 metadata. It provides fast and easy read and write access to the Exif, IPTC
853 and XMP metadata of images in various formats.")
855 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
856 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
857 ;; The core is GPLv2+:
858 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
859 (license license:gpl2+)))
867 (uri (string-append "http://downloads.sourceforge.net/openil/"
868 "DevIL-" version ".tar.gz"))
871 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
872 (build-system cmake-build-system)
874 '(;; XXX: Not supported in the released CMakeLists.txt.
875 ;; Enable this for > 1.8.0.
878 (modify-phases %standard-phases
879 (add-before 'configure 'change-directory
880 (lambda _ (chdir "DevIL") #t)))))
882 `(("pkg-config" ,pkg-config)))
885 ("libjpeg" ,libjpeg-turbo)
891 (synopsis "Library for manipulating many image formats")
892 (description "Developer's Image Library (DevIL) is a library to develop
893 applications with support for many types of images. DevIL can load, save,
894 convert, manipulate, filter and display a wide variety of image formats.")
895 (home-page "http://openil.sourceforge.net")
896 (license license:lgpl2.1+)))
898 (define-public jasper
904 (uri (string-append "https://www.ece.uvic.ca/~frodo/jasper"
905 "/software/jasper-" version ".tar.gz"))
908 "1njdbxv7d4anzrd476wjww2qsi96dd8vfnp4hri0srrqxpszl92v"))
909 (patches (search-patches "jasper-CVE-2017-6850.patch"))))
910 (build-system cmake-build-system)
911 (inputs `(("libjpeg" ,libjpeg)))
912 (synopsis "JPEG-2000 library")
913 (description "The JasPer Project is an initiative to provide a reference
914 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
916 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
917 (license (license:x11-style "file://LICENSE"))))
926 (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
927 "release-" version ".tar.gz"))
928 (file-name (string-append name "-" version ".tar.gz"))
931 "0kbq2dy659645fmgxpzg38b6y6x82kwkydhc380kdkaikv2brcjh"))))
932 (build-system gnu-build-system)
934 `(("autoconf" ,autoconf)
935 ("automake" ,automake)
936 ("libtool" ,libtool)))
939 (modify-phases %standard-phases
940 (add-after 'unpack 'autogen
942 (zero? (system* "sh" "autogen.sh")))))))
943 (synopsis "Scaling, colorspace conversion, and dithering library")
944 (description "Zimg implements the commonly required image processing basics
945 of scaling, colorspace conversion, and depth conversion. A simple API enables
946 conversion between any supported formats to operate with minimal knowledge from
948 (home-page "https://github.com/sekrit-twc/zimg")
949 ;; test/extra/ contains musl-libm,
950 ;; which is MIT/expat licensed, but only used for tests
951 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
953 (define-public perceptualdiff
955 (name "perceptualdiff")
960 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
962 (file-name (string-append name "-" version ".tar.gz"))
965 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
966 (build-system cmake-build-system)
967 (inputs `(("freeimage" ,freeimage)))
969 '(#:phases (modify-phases %standard-phases
970 (add-after 'unpack 'fix-tests
971 ;; cmake-build-system uses a build/ directory outside
972 ;; of the source tree, one level higher than expected
974 (substitute* "test/run_tests.bash"
975 (("../build") "../../build")))))))
976 (home-page "https://github.com/myint/perceptualdiff")
977 (synopsis "Perceptual image comparison utility")
978 (description "PerceptualDiff visually compares two images to determine
979 whether they look alike. It uses a computational model of the human visual
980 system to detect similarities. This allows it too see beyond irrelevant
981 differences in file encoding, image quality, and other small variations.")
982 (license license:gpl2+)))
984 (define-public steghide
990 (uri (string-append "mirror://sourceforge/steghide/steghide/"
991 version "/steghide-" version ".tar.bz2"))
994 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
995 (patches (list (search-patch "steghide-fixes.patch")))))
996 (build-system gnu-build-system)
998 `(("gettext" ,gettext-minimal)
1000 ("perl" ,perl))) ;for tests
1002 `(("libmhash" ,libmhash)
1003 ("libmcrypt" ,libmcrypt)
1004 ("libjpeg" ,libjpeg)
1007 `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc
1008 (home-page "http://steghide.sourceforge.net")
1009 (synopsis "Image and audio steganography")
1011 "Steghide is a steganography program that is able to hide data in various
1012 kinds of image- and audio-files. The color- respectivly sample-frequencies
1013 are not changed thus making the embedding resistant against first-order
1014 statistical tests.")
1015 (license license:gpl2+)))
1017 (define-public stb-image-for-extempore
1018 (let ((revision "1")
1019 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1021 (name "stb-image-for-extempore")
1022 (version (string-append "0-" revision "." (string-take commit 9)))
1024 (origin (method git-fetch)
1026 (url "https://github.com/extemporelang/stb.git")
1030 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1031 (file-name (string-append name "-" version "-checkout"))))
1032 (build-system cmake-build-system)
1033 (arguments `(#:tests? #f)) ; no tests included
1034 ;; Extempore refuses to build on architectures other than x86_64
1035 (supported-systems '("x86_64-linux"))
1036 (home-page "https://github.com/extemporelang/stb")
1037 (synopsis "Image library for Extempore")
1039 "This package is a collection of assorted single-file libraries. Of
1040 all included libraries only the image loading and decoding library is
1041 installed as @code{stb_image}.")
1042 (license license:public-domain))))
1044 (define-public optipng
1051 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1055 "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
1056 (build-system gnu-build-system)
1061 (modify-phases %standard-phases
1062 ;; configure script does not accept arguments CONFIG_SHELL and SHELL
1064 (lambda* (#:key outputs #:allow-other-keys)
1065 (zero? (system* "sh" "configure"
1066 (string-append "--prefix=" (assoc-ref outputs "out")))))))))
1067 (synopsis "Optimizer that recompresses PNG image files to a
1069 (description "OptiPNG is a PNG optimizer that recompresses image
1070 files to a smaller size, without losing any information. This program
1071 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1072 PNG, and performs PNG integrity checks and corrections.")
1073 (home-page "http://optipng.sourceforge.net/")
1074 (license license:zlib)))
1076 (define-public libjpeg-turbo
1078 (name "libjpeg-turbo")
1082 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1083 name "-" version ".tar.gz"))
1086 "0v365hm6z6lddcqagjj15wflk66rqyw75m73cqzl65rh4lyrshj1"))))
1087 (build-system gnu-build-system)
1091 '(#:test-target "test"
1093 (modify-phases %standard-phases
1094 (add-after 'unpack 'set-env-on-MIPS
1095 ;; This is borrowed from Debian's patchset for libjpeg
1096 ;; 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
1098 (substitute* "simd/jsimd_mips.c"
1099 (("env = getenv\\(\"JSIMD_FORCEDSPR2")
1100 "char *env = getenv(\"JSIMD_FORCEDSPR2"))
1102 (home-page "http://www.libjpeg-turbo.org/")
1103 (synopsis "SIMD-accelerated JPEG image handling library")
1104 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1105 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1106 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1107 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1108 a significant amount.
1109 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1110 but more straightforward TurboJPEG API, and provides a full-featured Java
1111 interface. It supports color space extensions that allow it to compress from
1112 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1113 (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/
1114 license:ijg)))) ; the rest
1116 (define-public niftilib
1122 (uri (list (string-append "mirror://sourceforge/niftilib/"
1123 "nifticlib/nifticlib_"
1124 (string-join (string-split version #\.) "_")
1125 "/nifticlib-" version ".tar.gz")))
1127 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1128 (build-system gnu-build-system)
1130 '(#:tests? #f ; there is no test target
1131 #:parallel-build? #f ; not supported
1134 (string-append "ZLIB_INC="
1135 (assoc-ref %build-inputs "zlib") "/include")
1136 ;; Append "-fPIC" to CFLAGS.
1137 (string-append "CFLAGS="
1138 "-Wall -ansi -pedantic -fPIC"))
1140 (modify-phases %standard-phases
1142 (lambda* (#:key outputs #:allow-other-keys)
1143 (let ((out (assoc-ref outputs "out")))
1146 (copy-recursively dir (string-append out "/" dir)))
1147 '("bin" "lib" "include")))
1149 (delete 'configure))))
1152 (synopsis "Library for reading and writing files in the nifti-1 format")
1153 (description "Niftilib is a set of i/o libraries for reading and writing
1154 files in the nifti-1 data format - a binary file format for storing
1155 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1156 (fMRI) brain images.")
1157 (home-page "http://niftilib.sourceforge.net")
1158 (license license:public-domain)))