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, 2018 Efraim Flashner <efraim@flashner.co.il>
13 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
14 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
15 ;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net>
16 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
17 ;;; Copyright © 2017 ng0 <ng0@infotropique.org>
18 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
19 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages image)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages algebra)
39 #:use-module (gnu packages assembly)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages boost)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages documentation)
45 #:use-module (gnu packages fontutils)
46 ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
47 #:use-module (gnu packages gcc)
48 #:use-module (gnu packages gettext)
49 #:use-module (gnu packages ghostscript)
50 #:use-module (gnu packages gl)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages graphics)
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages lua)
55 #:use-module (gnu packages maths)
56 #:use-module (gnu packages mcrypt)
57 #:use-module (gnu packages perl)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages python)
60 #:use-module (gnu packages xml)
61 #:use-module (gnu packages xorg)
62 #:use-module ((guix licenses) #:prefix license:)
63 #:use-module (guix packages)
64 #:use-module (guix download)
65 #:use-module (guix git-download)
66 #:use-module (guix build-system gnu)
67 #:use-module (guix build-system cmake)
68 #:use-module (guix build-system python)
69 #:use-module (guix build-system r)
70 #:use-module (guix build-system scons)
71 #:use-module (srfi srfi-1))
79 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
80 version "/libpng-" version ".tar.xz")
82 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
83 "/libpng16/libpng-" version ".tar.xz")
85 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
86 "/libpng16/libpng-" version ".tar.xz")))
89 "1xjr0v34fyjgnhvaa1zixcpx5yvxcg4zwvfh0fyklfyfj86rc7ig"))))
90 (build-system gnu-build-system)
92 ;; libpng.la says "-lz", so propagate it.
93 (propagated-inputs `(("zlib" ,zlib)))
95 (synopsis "Library for handling PNG files")
97 "Libpng is the official PNG (Portable Network Graphics) reference
98 library. It supports almost all PNG features and is extensible.")
99 (license license:zlib)
100 (home-page "http://www.libpng.org/pub/png/libpng.html")))
102 ;; libpng-apng should be updated when the APNG patch is released:
103 ;; <https://bugs.gnu.org/27556>
104 (define-public libpng-apng
111 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
112 version "/libpng-" version ".tar.xz")
114 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
115 "/libpng16/libpng-" version ".tar.xz")
117 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
118 "/libpng16/libpng-" version ".tar.xz")))
121 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
122 (build-system gnu-build-system)
124 `(#:modules ((guix build gnu-build-system)
128 (modify-phases %standard-phases
129 (add-after 'unpack 'patch-apng
130 (lambda* (#:key inputs #:allow-other-keys)
131 (define (apply-patch file)
132 (zero? (system* "patch" "-p1" "--force"
134 (let ((apng.gz (assoc-ref inputs "apng")))
135 (format #t "Applying APNG patch '~a'...~%"
139 (system (string-append "gunzip < " apng.gz " > the-patch")))
140 (apply-patch "the-patch")))))
141 (add-before 'configure 'no-checks
143 (substitute* "Makefile.in"
144 (("^scripts/symbols.chk") "")
145 (("check: scripts/symbols.chk") ""))
151 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
152 version "/libpng-" version "-apng.patch.gz"))
155 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
157 `(("libtool" ,libtool)))
158 ;; libpng.la says "-lz", so propagate it.
161 (synopsis "APNG patch for libpng")
163 "APNG (Animated Portable Network Graphics) is an unofficial
164 extension of the APNG (Portable Network Graphics) format.
165 APNG patch provides APNG support to libpng.")
166 (home-page "https://sourceforge.net/projects/libpng-apng/")
167 (license license:zlib)))
169 (define-public libpng-1.2
176 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
177 version "/libpng-" version ".tar.xz")
179 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
180 "/libpng12/libpng-" version ".tar.xz")
182 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
183 "/libpng12/libpng-" version ".tar.xz")))
186 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
194 (uri (cran-uri "png" version))
197 "0g2mcp55lvvpx4kd3mn225mpbxqcq73wy5qx8b4lyf04iybgysg2"))))
198 (build-system r-build-system)
202 (home-page "http://www.rforge.net/png/")
203 (synopsis "Read and write PNG images")
205 "This package provides an easy and simple way to read, write and display
206 bitmap images stored in the PNG format. It can read and write both files and
207 in-memory raw vectors.")
208 ;; Any of these GPL versions.
209 (license (list license:gpl2 license:gpl3))))
211 (define-public pngcrush
217 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
218 version "/pngcrush-" version "-nolib.tar.xz"))
220 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
221 (build-system gnu-build-system)
223 '(#:tests? #f ; no check target
225 (modify-phases %standard-phases
227 (lambda* (#:key inputs outputs #:allow-other-keys)
228 (substitute* "Makefile"
229 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
230 (string-append vardef (assoc-ref inputs "libpng") "/"))
231 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
232 (string-append vardef (assoc-ref inputs "zlib") "/"))
233 ;; The Makefile is written by hand and not using $PREFIX
234 (("\\$\\(DESTDIR\\)/usr/")
235 (string-append (assoc-ref outputs "out") "/"))))))))
239 (home-page "https://pmt.sourceforge.io/pngcrush")
240 (synopsis "Utility to compress PNG files")
241 (description "pngcrusqh is an optimizer for PNG (Portable Network Graphics)
242 files. It can compress them as much as 40% losslessly.")
243 (license license:zlib)))
245 (define-public pngcrunch
246 ;; This package used to be wrongfully name "pngcrunch".
247 (deprecated-package "pngcrunch" pngcrush))
249 (define-public libjpeg
255 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
258 "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
259 (build-system gnu-build-system)
260 (synopsis "Library for handling JPEG files")
262 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
263 JPEG is a standardized compression method for full-color and gray-scale
265 The included programs provide conversion between the JPEG format and
266 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
267 (license license:ijg)
268 (home-page "http://www.ijg.org/")))
270 (define-public libjpeg-8
271 (package (inherit libjpeg)
275 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
278 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
280 (define-public libjxr
285 ;; We are using the Debian source because CodePlex does not
286 ;; deliver an easily downloadable tarball.
288 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
289 version ".orig.tar.gz"))
292 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
293 (patch-flags '("-p1" "--binary"))
294 (patches (search-patches "libjxr-fix-function-signature.patch"
295 "libjxr-fix-typos.patch"))))
296 (build-system gnu-build-system)
297 (arguments '(#:make-flags '("CC=gcc")
298 #:tests? #f ; no check target
300 (modify-phases %standard-phases
301 (delete 'configure) ; no configure script
302 ;; The upstream makefile does not include an install phase.
304 (lambda* (#:key outputs #:allow-other-keys)
305 (let* ((out (assoc-ref outputs "out"))
306 (bin (string-append out "/bin"))
307 (lib (string-append out "/lib"))
308 (include (string-append out "/include/jxrlib")))
309 (for-each (lambda (file)
310 (install-file file include)
313 '("jxrgluelib/JXRGlue.h"
314 "jxrgluelib/JXRMeta.h"
315 "jxrtestlib/JXRTest.h"
316 "image/sys/windowsmediaphoto.h")
317 (find-files "common/include" "\\.h$")))
318 (for-each (lambda (file)
319 (install-file file lib)
321 (find-files "." "\\.a$"))
322 (for-each (lambda (file)
323 (install-file file bin)
325 '("JxrDecApp" "JxrEncApp")))
327 (synopsis "Implementation of the JPEG XR standard")
328 (description "JPEG XR is an approved ISO/IEC International standard (its
329 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
331 (license:non-copyleft
333 "See the header of the Makefile in the distribution."))
334 (home-page "https://jxrlib.codeplex.com/")))
336 (define-public jpegoptim
342 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
345 "1cn1i0g1xjdwa12w0ifbnzgb1vqbpr8ji6h05vxksj79vyi3x849"))))
346 (build-system gnu-build-system)
347 (inputs `(("libjpeg" ,libjpeg)))
351 (synopsis "Optimize JPEG images")
353 "jpegoptim provides lossless optimization (based on optimizing
354 the Huffman tables) and \"lossy\" optimization based on setting
355 maximum quality factor.")
356 (license license:gpl2+)
357 (home-page "http://www.kokkonen.net/tjko/projects.html#jpegoptim")))
359 (define-public libicns
366 "mirror://sourceforge/icns/"
367 "libicns-" version ".tar.gz"))
370 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
371 (build-system gnu-build-system)
376 `(#:tests? #t)) ; No tests.
377 (home-page "http://icns.sourceforge.net/")
378 (synopsis "Library for handling Mac OS icns resource files")
380 "Libicns is a library for the manipulation of Mac OS IconFamily resource
381 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
382 convert between PNG and ICNS. @command{icns2png} will extract image files from
383 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
384 with .desktop files. Additionally, @command{icontainer2png} is provided for
385 extracting icontainer icon files.")
386 (license (list license:lgpl2.1+ ; libicns
387 license:lgpl2.0+ ; src/apidocs.*
388 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
390 (define-public libtiff
394 (replacement libtiff/fixed)
398 (uri (string-append "http://download.osgeo.org/libtiff/tiff-"
402 "1kfg4q01r4mqn7dj63ifhi6pmqzbf4xax6ni6kkk81ri5kndwyvf"))))
403 (build-system gnu-build-system)
405 "doc")) ;1.3 MiB of HTML documentation
407 ;; Instead of using --docdir, this package has its own --with-docdir.
408 `(#:configure-flags (list (string-append "--with-docdir="
409 (assoc-ref %outputs "doc")
411 ,name "-" ,version))))
412 (inputs `(("zlib" ,zlib)
413 ("libjpeg" ,libjpeg)))
414 (synopsis "Library for handling TIFF files")
416 "Libtiff provides support for the Tag Image File Format (TIFF), a format
417 used for storing image data.
418 Included are a library, libtiff, for reading and writing TIFF and a small
419 collection of tools for doing simple manipulations of TIFF images.")
420 (license (license:non-copyleft "file://COPYRIGHT"
421 "See COPYRIGHT in the distribution."))
422 (home-page "http://www.simplesystems.org/libtiff/")))
424 (define libtiff/fixed
429 (inherit (package-source libtiff))
431 (append (origin-patches (package-source libtiff))
432 (search-patches "libtiff-CVE-2017-9935.patch"
433 "libtiff-CVE-2017-18013.patch")))))))
435 (define-public leptonica
443 "https://github.com/DanBloomberg/leptonica/archive/" version
445 (file-name (string-append "leptonica-" version ".tar.gz"))
447 (base32 "10pw7pwccd0m0fc9rlrr2m41s7j1qvba2wcrav17pw1gclkf34i0"))))
448 (build-system gnu-build-system)
450 `(("gnuplot" ,gnuplot) ;needed for test suite
451 ("autoconf" ,autoconf)
452 ("automake" ,automake)
454 ("pkg-config" ,pkg-config)))
460 ("libwebp" ,libwebp)))
462 ;; Linking a program with leptonica also requires these.
463 `(("openjpeg" ,openjpeg)
467 (modify-phases %standard-phases
468 (add-after 'unpack 'autogen
470 (zero? (system* "sh" "autobuild"))))
471 (add-after 'unpack 'patch-reg-wrapper
473 (substitute* "prog/reg_wrapper.sh"
475 (string-append " " (which "sh") " "))
478 (home-page "http://www.leptonica.com/")
479 (synopsis "Library and tools for image processing and analysis")
481 "Leptonica is a C library and set of command-line tools for efficient
482 image processing and image analysis operations. It supports rasterop, affine
483 transformations, binary and grayscale morphology, rank order, and convolution,
484 seedfill and connected components, image transformations combining changes in
485 scale and pixel depth, and pixelwise masking, blending, enhancement, and
487 (license license:bsd-2)))
489 (define-public jbig2dec
496 (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
497 name "-" version ".tar.gz"))
499 (base32 "0k01hp0q4275fj4rbr1gy64svfraw5w7wvwl08yjhvsnpb1rid11"))
500 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
501 (build-system gnu-build-system)
502 (synopsis "Decoder of the JBIG2 image compression format")
504 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
505 monochrome) images at moderately high resolution, and in particular scanned
506 paper documents. In this domain it is very efficient, offering compression
507 ratios on the order of 100:1.
509 This is a decoder only implementation, and currently is in the alpha
510 stage, meaning it doesn't completely work yet. However, it is
511 maintaining parity with available encoders, so it is useful for real
513 (home-page "http://www.ghostscript.com/jbig2dec.html")
514 (license license:gpl2+)))
516 (define-public openjpeg
524 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
526 (file-name (string-append name "-" version ".tar.gz"))
529 "06npqzkg20avnygdwaqpap91r7qpdqgrn39adj2bl8v0pg0qgirx"))))
530 (build-system cmake-build-system)
532 ;; Trying to run `$ make check' results in a no rule fault.
539 (synopsis "JPEG 2000 codec")
541 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
542 been developed in order to promote the use of JPEG 2000, the new
543 still-image compression standard from the Joint Photographic Experts
546 In addition to the basic codec, various other features are under
547 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
548 an indexing tool useful for the JPIP protocol, JPWL-tools for
549 error-resilience, a Java-viewer for j2k-images, ...")
550 (home-page "https://github.com/uclouvain/openjpeg")
551 (license license:bsd-2)))
553 (define-public openjpeg-1
554 (package (inherit openjpeg)
561 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
562 name "-" version ".tar.gz"))
564 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
566 (define-public giflib
572 (uri (string-append "mirror://sourceforge/giflib/giflib-"
576 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))))
577 (build-system gnu-build-system)
578 (outputs '("bin" ; utility programs
580 (inputs `(("libx11" ,libx11)
586 (modify-phases %standard-phases
587 (add-after 'unpack 'disable-html-doc-gen
589 (substitute* "doc/Makefile.in"
590 (("^all: allhtml manpages") ""))))
591 (add-after 'install 'install-manpages
592 (lambda* (#:key outputs #:allow-other-keys)
593 (let* ((bin (assoc-ref outputs "bin"))
594 (man1dir (string-append bin "/share/man/man1")))
596 (for-each (lambda (file)
597 (let ((base (basename file)))
598 (format #t "installing `~a' to `~a'~%"
603 (find-files "doc" "\\.1"))))))))
604 (synopsis "Tools and library for working with GIF images")
606 "GIFLIB is a library for reading and writing GIF images. It is API and
607 ABI compatible with libungif which was in wide use while the LZW compression
608 algorithm was patented. Tools are also included to convert, manipulate,
609 compose, and analyze GIF images.")
610 (home-page "http://giflib.sourceforge.net/")
611 (license license:x11)))
613 (define-public libungif
619 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
620 "libungif-" version "/libungif-"
624 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
625 (build-system gnu-build-system)
626 (inputs `(("perl" ,perl))) ;package ships some perl tools
627 (home-page "http://giflib.sourceforge.net/")
628 (synopsis "GIF decompression library")
630 "libungif is the old GIF decompression library by the GIFLIB project.")
631 (license license:expat)))
633 (define-public imlib2
640 "mirror://sourceforge/enlightenment/imlib2-src/" version
641 "/imlib2-" version ".tar.bz2"))
644 "0kg28b5wp886hiy12v7abdybrvlymb7g3nvg0ysn2y8h883s5w8m"))))
645 (build-system gnu-build-system)
647 `(("pkgconfig" ,pkg-config)))
651 ("freetype" ,freetype)
657 (home-page "https://sourceforge.net/projects/enlightenment/")
659 "Loading, saving, rendering and manipulating image files")
661 "Imlib2 is a library that does image file loading and saving as well as
662 rendering, manipulation, arbitrary polygon support, etc.
664 It does ALL of these operations FAST. Imlib2 also tries to be highly
665 intelligent about doing them, so writing naive programs can be done easily,
666 without sacrificing speed.
668 This is a complete rewrite over the Imlib 1.x series. The architecture is
669 more modular, simple, and flexible.")
670 (license license:imlib2)))
672 (define-public giblib
680 "http://linuxbrit.co.uk/downloads/giblib-"
683 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
684 "files/giblib/giblib-" version ".tar.gz")))
687 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
688 (build-system gnu-build-system)
692 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
693 (synopsis "Wrapper library for imlib2")
695 "Giblib is a simple library which wraps imlib2's context API, avoiding
696 all the context_get/set calls, adds fontstyles to the truetype renderer and
697 supplies a generic doubly-linked list and some string functions.")
698 ;; This license removes a clause about X Consortium from the original
700 (license (license:x11-style "file://COPYING"
701 "See 'COPYING' in the distribution."))))
703 (define-public freeimage
710 "mirror://sourceforge/freeimage/Source%20Distribution/"
712 (string-concatenate (string-split version #\.))
716 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
717 (patches (search-patches "freeimage-CVE-2015-0852.patch"
718 "freeimage-CVE-2016-5684.patch"
719 "freeimage-fix-build-with-gcc-5.patch"))))
720 (build-system gnu-build-system)
723 (modify-phases %standard-phases
725 (add-before 'build 'patch-makefile
726 (lambda* (#:key outputs #:allow-other-keys)
727 (substitute* "Makefile.gnu"
728 (("/usr") (assoc-ref outputs "out"))
729 (("-o root -g root") ""))
731 #:make-flags '("CC=gcc")
732 #:tests? #f)) ; no check target
735 ;; Fails to build on MIPS due to assembly code in the source.
736 (supported-systems (delete "mips64el-linux" %supported-systems))
737 (synopsis "Library for handling popular graphics image formats")
739 "FreeImage is a library for developers who would like to support popular
740 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
741 (license license:gpl2+)
742 (home-page "http://freeimage.sourceforge.net")))
751 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
752 "Version-" (string-join (string-split version #\.) "-")
753 "/vigra-" version "-src.tar.gz"))
755 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
756 (build-system cmake-build-system)
762 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
763 ; to create a configure-flag
768 ("python" ,python-2) ; print syntax
769 ("python2-numpy" ,python2-numpy)
772 `(("doxygen" ,doxygen)
773 ("python2-nose" ,python2-nose)
774 ("python2-sphinx" ,python2-sphinx)))
776 `(#:test-target "check"
777 #:parallel-build? #f ; parallel builds trigger an ICE
779 (list "-Wno-dev" ; suppress developer mode with lots of warnings
780 (string-append "-DVIGRANUMPY_INSTALL_DIR="
781 (assoc-ref %outputs "out")
782 "/lib/python2.7/site-packages")
783 ;; OpenEXR is not enabled by default.
785 ;; Fix rounding error on 32-bit machines
786 "-DCMAKE_C_FLAGS=-ffloat-store"
787 ;; The header files of ilmbase are not found when included
788 ;; by the header files of openexr, and an explicit flag
790 (string-append "-DCMAKE_CXX_FLAGS=-I"
791 (assoc-ref %build-inputs "ilmbase")
794 (synopsis "Computer vision library")
796 "VIGRA stands for Vision with Generic Algorithms. It is an image
797 processing and analysis library that puts its main emphasis on customizable
798 algorithms and data structures. It is particularly strong for
799 multi-dimensional image processing.")
800 (license license:expat)
801 (home-page "https://ukoethe.github.io/vigra/")))
803 (define-public libwebp
811 "http://downloads.webmproject.org/releases/webp/libwebp-" version
815 "1ayq2zq0zbgf5yizbm32zh7p1vb8kibw74am6am1n5cz5mw3ql06"))))
816 (build-system gnu-build-system)
818 `(("freeglut" ,freeglut)
822 ("libtiff" ,libtiff)))
824 '(#:configure-flags '("--enable-libwebpmux"
825 "--enable-libwebpdemux"
826 "--enable-libwebpdecoder")))
827 (home-page "https://developers.google.com/speed/webp/")
828 (synopsis "Lossless and lossy image compression")
830 "WebP is a new image format that provides lossless and lossy compression
831 for images. WebP lossless images are 26% smaller in size compared to
832 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
833 equivalent SSIM index. WebP supports lossless transparency (also known as
834 alpha channel) with just 22% additional bytes. Transparency is also supported
835 with lossy compression and typically provides 3x smaller file sizes compared
836 to PNG when lossy compression is acceptable for the red/green/blue color
838 (license license:bsd-3)))
840 (define-public libmng
846 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
847 version "/" name "-" version ".tar.xz"))
850 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
851 (build-system gnu-build-system)
853 ;; These are all in the 'Libs.private' field of libmng.pc.
857 (home-page "http://www.libmng.com/")
858 (synopsis "Library for handling MNG files")
860 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
861 (license license:bsd-3)))
869 (uri (list (string-append "http://www.exiv2.org/builds/exiv2-"
870 version "-trunk.tar.gz")
871 (string-append "http://www.exiv2.org/exiv2-"
873 (string-append "https://fossies.org/linux/misc/exiv2-"
875 (patches (search-patches "exiv2-CVE-2017-14860.patch"
876 "exiv2-CVE-2017-14859-14862-14864.patch"))
879 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
880 (build-system gnu-build-system)
881 (arguments '(#:tests? #f)) ; no `check' target
886 `(("intltool" ,intltool)))
887 (home-page "http://www.exiv2.org/")
888 (synopsis "Library and command-line utility to manage image metadata")
890 "Exiv2 is a C++ library and a command line utility to manage image
891 metadata. It provides fast and easy read and write access to the Exif, IPTC
892 and XMP metadata of images in various formats.")
894 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
895 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
896 ;; The core is GPLv2+:
897 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
898 (license license:gpl2+)))
906 (uri (string-append "http://downloads.sourceforge.net/openil/"
907 "DevIL-" version ".tar.gz"))
910 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
911 (build-system cmake-build-system)
913 '(;; XXX: Not supported in the released CMakeLists.txt.
914 ;; Enable this for > 1.8.0.
917 (modify-phases %standard-phases
918 (add-before 'configure 'change-directory
919 (lambda _ (chdir "DevIL") #t)))))
921 `(("pkg-config" ,pkg-config)))
924 ("libjpeg" ,libjpeg-turbo)
930 (synopsis "Library for manipulating many image formats")
931 (description "Developer's Image Library (DevIL) is a library to develop
932 applications with support for many types of images. DevIL can load, save,
933 convert, manipulate, filter and display a wide variety of image formats.")
934 (home-page "http://openil.sourceforge.net")
935 (license license:lgpl2.1+)))
937 (define-public jasper
943 (uri (string-append "https://github.com/mdadams/jasper/archive/"
944 "version-" version ".tar.gz"))
945 (file-name (string-append name "-" version ".tar.gz"))
948 "0yx9y5y0g6jv142vnqp50j3k8k5yqznz3smrblv192wgfbm6w9l5"))))
949 (build-system cmake-build-system)
950 (inputs `(("libjpeg" ,libjpeg)))
951 (synopsis "JPEG-2000 library")
952 (description "The JasPer Project is an initiative to provide a reference
953 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
955 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
956 (license (license:x11-style "file://LICENSE"))))
965 (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
966 "release-" version ".tar.gz"))
967 (file-name (string-append name "-" version ".tar.gz"))
970 "0kbq2dy659645fmgxpzg38b6y6x82kwkydhc380kdkaikv2brcjh"))))
971 (build-system gnu-build-system)
973 `(("autoconf" ,autoconf)
974 ("automake" ,automake)
975 ("libtool" ,libtool)))
978 (modify-phases %standard-phases
979 (add-after 'unpack 'autogen
981 (zero? (system* "sh" "autogen.sh")))))))
982 (synopsis "Scaling, colorspace conversion, and dithering library")
983 (description "Zimg implements the commonly required image processing basics
984 of scaling, colorspace conversion, and depth conversion. A simple API enables
985 conversion between any supported formats to operate with minimal knowledge from
987 (home-page "https://github.com/sekrit-twc/zimg")
988 ;; test/extra/ contains musl-libm,
989 ;; which is MIT/expat licensed, but only used for tests
990 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
992 (define-public perceptualdiff
994 (name "perceptualdiff")
999 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
1001 (file-name (string-append name "-" version ".tar.gz"))
1004 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
1005 (build-system cmake-build-system)
1006 (inputs `(("freeimage" ,freeimage)))
1008 '(#:phases (modify-phases %standard-phases
1009 (add-after 'unpack 'fix-tests
1010 ;; cmake-build-system uses a build/ directory outside
1011 ;; of the source tree, one level higher than expected
1013 (substitute* "test/run_tests.bash"
1014 (("../build") "../../build")))))))
1015 (home-page "https://github.com/myint/perceptualdiff")
1016 (synopsis "Perceptual image comparison utility")
1017 (description "PerceptualDiff visually compares two images to determine
1018 whether they look alike. It uses a computational model of the human visual
1019 system to detect similarities. This allows it too see beyond irrelevant
1020 differences in file encoding, image quality, and other small variations.")
1021 (license license:gpl2+)))
1023 (define-public steghide
1029 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1030 version "/steghide-" version ".tar.bz2"))
1033 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1034 (patches (list (search-patch "steghide-fixes.patch")))))
1035 (build-system gnu-build-system)
1037 `(("gettext" ,gettext-minimal)
1038 ("libtool" ,libtool)
1039 ("perl" ,perl))) ;for tests
1041 `(("libmhash" ,libmhash)
1042 ("libmcrypt" ,libmcrypt)
1043 ("libjpeg" ,libjpeg)
1046 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1048 #:phases (modify-phases %standard-phases
1049 (add-before 'configure 'set-perl-search-path
1051 ;; Work around "dotless @INC" build failure.
1053 (string-append (getcwd) "/tests:"
1054 (getenv "PERL5LIB")))
1056 (home-page "http://steghide.sourceforge.net")
1057 (synopsis "Image and audio steganography")
1059 "Steghide is a program to hide data in various kinds of image and audio
1060 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1061 changed, making the embedding resistant against first-order statistical tests.")
1062 (license license:gpl2+)))
1064 (define-public stb-image-for-extempore
1065 (let ((revision "1")
1066 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1068 (name "stb-image-for-extempore")
1069 (version (string-append "0-" revision "." (string-take commit 9)))
1071 (origin (method git-fetch)
1073 (url "https://github.com/extemporelang/stb.git")
1077 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1078 (file-name (string-append name "-" version "-checkout"))))
1079 (build-system cmake-build-system)
1080 (arguments `(#:tests? #f)) ; no tests included
1081 ;; Extempore refuses to build on architectures other than x86_64
1082 (supported-systems '("x86_64-linux"))
1083 (home-page "https://github.com/extemporelang/stb")
1084 (synopsis "Image library for Extempore")
1086 "This package is a collection of assorted single-file libraries. Of
1087 all included libraries only the image loading and decoding library is
1088 installed as @code{stb_image}.")
1089 (license license:public-domain))))
1091 (define-public optipng
1098 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1102 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))))
1103 (build-system gnu-build-system)
1108 (modify-phases %standard-phases
1110 (lambda* (#:key outputs #:allow-other-keys)
1111 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1112 (invoke "sh" "configure"
1113 (string-append "--prefix=" (assoc-ref outputs "out")))
1115 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1116 (description "OptiPNG is a PNG optimizer that recompresses image
1117 files to a smaller size, without losing any information. This program
1118 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1119 PNG, and performs PNG integrity checks and corrections.")
1120 (home-page "http://optipng.sourceforge.net/")
1121 (license license:zlib)))
1123 (define-public libjpeg-turbo
1125 (name "libjpeg-turbo")
1129 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1130 name "-" version ".tar.gz"))
1133 "08r5b5mywwrxv4axvq80dm31cklz81grczlzlxr2xqa6pgi90j5j"))))
1134 (build-system gnu-build-system)
1138 '(#:test-target "test"
1139 #:configure-flags (list "--with-build-date=1970-01-01")))
1140 (home-page "http://www.libjpeg-turbo.org/")
1141 (synopsis "SIMD-accelerated JPEG image handling library")
1142 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1143 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1144 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1145 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1146 a significant amount.
1147 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1148 but more straightforward TurboJPEG API, and provides a full-featured Java
1149 interface. It supports color space extensions that allow it to compress from
1150 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1151 (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/
1152 license:ijg)))) ; the rest
1154 (define-public niftilib
1160 (uri (list (string-append "mirror://sourceforge/niftilib/"
1161 "nifticlib/nifticlib_"
1162 (string-join (string-split version #\.) "_")
1163 "/nifticlib-" version ".tar.gz")))
1165 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1166 (build-system gnu-build-system)
1168 '(#:tests? #f ; there is no test target
1169 #:parallel-build? #f ; not supported
1172 (string-append "ZLIB_INC="
1173 (assoc-ref %build-inputs "zlib") "/include")
1174 ;; Append "-fPIC" to CFLAGS.
1175 (string-append "CFLAGS="
1176 "-Wall -ansi -pedantic -fPIC"))
1178 (modify-phases %standard-phases
1180 (lambda* (#:key outputs #:allow-other-keys)
1181 (let ((out (assoc-ref outputs "out")))
1184 (copy-recursively dir (string-append out "/" dir)))
1185 '("bin" "lib" "include")))
1187 (delete 'configure))))
1190 (synopsis "Library for reading and writing files in the nifti-1 format")
1191 (description "Niftilib is a set of i/o libraries for reading and writing
1192 files in the nifti-1 data format - a binary file format for storing
1193 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1194 (fMRI) brain images.")
1195 (home-page "http://niftilib.sourceforge.net")
1196 (license license:public-domain)))
1198 (define-public gpick
1204 (uri (string-append "https://github.com/thezbyg/gpick/archive/"
1205 name "-" version ".tar.gz"))
1208 "0mxvxk15xhk2i5vfavjhnkk4j3bnii0gpf8di14rlbpq070hd5rs"))))
1209 (build-system scons-build-system)
1212 ("gettext" ,gnu-gettext)
1213 ("pkg-config" ,pkg-config)))
1220 #:scons ,scons-python2
1221 #:scons-flags (list (string-append "DESTDIR=" %output))
1223 (modify-phases %standard-phases
1224 (add-before 'build 'fix-lua-reference
1226 (substitute* "SConscript"
1227 (("lua5.2") "lua-5.2"))
1229 (home-page "http://www.gpick.org/")
1230 (synopsis "Color picker")
1231 (description "Gpick is an advanced color picker and palette editing tool.")
1232 (license license:bsd-3)))