gnu: gifsicle: New variable.
[jackhill/guix/guix.git] / gnu / packages / image.scm
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, 2017, 2018 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
17 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
18 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
19 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
20 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
21 ;;; Copyright © 2018 Pierre Neidhardt <ambrevar@gmail.com>
22 ;;;
23 ;;; This file is part of GNU Guix.
24 ;;;
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
29 ;;;
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
34 ;;;
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38 (define-module (gnu packages image)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages algebra)
41 #:use-module (gnu packages assembly)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages boost)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages documentation)
47 #:use-module (gnu packages fontutils)
48 ;; To provide gcc@5 and gcc@6, to work around <http://bugs.gnu.org/24703>.
49 #:use-module (gnu packages gcc)
50 #:use-module (gnu packages gettext)
51 #:use-module (gnu packages ghostscript)
52 #:use-module (gnu packages gl)
53 #:use-module (gnu packages glib)
54 #:use-module (gnu packages graphics)
55 #:use-module (gnu packages gtk)
56 #:use-module (gnu packages lua)
57 #:use-module (gnu packages maths)
58 #:use-module (gnu packages mcrypt)
59 #:use-module (gnu packages perl)
60 #:use-module (gnu packages photo)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages xml)
64 #:use-module (gnu packages xorg)
65 #:use-module (gnu packages qt)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix packages)
68 #:use-module (guix download)
69 #:use-module (guix git-download)
70 #:use-module (guix build-system gnu)
71 #:use-module (guix build-system cmake)
72 #:use-module (guix build-system python)
73 #:use-module (guix build-system r)
74 #:use-module (guix build-system scons)
75 #:use-module (srfi srfi-1))
76
77 (define-public libpng
78 (package
79 (name "libpng")
80 (version "1.6.34")
81 (source (origin
82 (method url-fetch)
83 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
84 version "/libpng-" version ".tar.xz")
85 (string-append
86 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
87 "/libpng16/libpng-" version ".tar.xz")
88 (string-append
89 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
90 "/libpng16/libpng-" version ".tar.xz")))
91 (sha256
92 (base32
93 "1xjr0v34fyjgnhvaa1zixcpx5yvxcg4zwvfh0fyklfyfj86rc7ig"))))
94 (build-system gnu-build-system)
95
96 ;; libpng.la says "-lz", so propagate it.
97 (propagated-inputs `(("zlib" ,zlib)))
98
99 (synopsis "Library for handling PNG files")
100 (description
101 "Libpng is the official PNG (Portable Network Graphics) reference
102 library. It supports almost all PNG features and is extensible.")
103 (license license:zlib)
104 (home-page "http://www.libpng.org/pub/png/libpng.html")))
105
106 ;; libpng-apng should be updated when the APNG patch is released:
107 ;; <https://bugs.gnu.org/27556>
108 (define-public libpng-apng
109 (package
110 (name "libpng-apng")
111 (version "1.6.28")
112 (source
113 (origin
114 (method url-fetch)
115 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
116 version "/libpng-" version ".tar.xz")
117 (string-append
118 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
119 "/libpng16/libpng-" version ".tar.xz")
120 (string-append
121 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
122 "/libpng16/libpng-" version ".tar.xz")))
123 (sha256
124 (base32
125 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
126 (build-system gnu-build-system)
127 (arguments
128 `(#:modules ((guix build gnu-build-system)
129 (guix build utils)
130 (srfi srfi-1))
131 #:phases
132 (modify-phases %standard-phases
133 (add-after 'unpack 'patch-apng
134 (lambda* (#:key inputs #:allow-other-keys)
135 (define (apply-patch file)
136 (zero? (system* "patch" "-p1" "--force"
137 "--input" file)))
138 (let ((apng.gz (assoc-ref inputs "apng")))
139 (format #t "Applying APNG patch '~a'...~%"
140 apng.gz)
141 (and
142 (zero?
143 (system (string-append "gunzip < " apng.gz " > the-patch")))
144 (apply-patch "the-patch")))))
145 (add-before 'configure 'no-checks
146 (lambda _
147 (substitute* "Makefile.in"
148 (("^scripts/symbols.chk") "")
149 (("check: scripts/symbols.chk") ""))
150 #t)))))
151 (inputs
152 `(("apng" ,(origin
153 (method url-fetch)
154 (uri
155 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
156 version "/libpng-" version "-apng.patch.gz"))
157 (sha256
158 (base32
159 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
160 (native-inputs
161 `(("libtool" ,libtool)))
162 ;; libpng.la says "-lz", so propagate it.
163 (propagated-inputs
164 `(("zlib" ,zlib)))
165 (synopsis "APNG patch for libpng")
166 (description
167 "APNG (Animated Portable Network Graphics) is an unofficial
168 extension of the APNG (Portable Network Graphics) format.
169 APNG patch provides APNG support to libpng.")
170 (home-page "https://sourceforge.net/projects/libpng-apng/")
171 (license license:zlib)))
172
173 (define-public libpng-1.2
174 (package
175 (inherit libpng)
176 (version "1.2.59")
177 (source
178 (origin
179 (method url-fetch)
180 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
181 version "/libpng-" version ".tar.xz")
182 (string-append
183 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
184 "/libpng12/libpng-" version ".tar.xz")
185 (string-append
186 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
187 "/libpng12/libpng-" version ".tar.xz")))
188 (sha256
189 (base32
190 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
191
192 (define-public r-png
193 (package
194 (name "r-png")
195 (version "0.1-7")
196 (source (origin
197 (method url-fetch)
198 (uri (cran-uri "png" version))
199 (sha256
200 (base32
201 "0g2mcp55lvvpx4kd3mn225mpbxqcq73wy5qx8b4lyf04iybgysg2"))))
202 (build-system r-build-system)
203 (inputs
204 `(("libpng" ,libpng)
205 ("zlib" ,zlib)))
206 (home-page "http://www.rforge.net/png/")
207 (synopsis "Read and write PNG images")
208 (description
209 "This package provides an easy and simple way to read, write and display
210 bitmap images stored in the PNG format. It can read and write both files and
211 in-memory raw vectors.")
212 ;; Any of these GPL versions.
213 (license (list license:gpl2 license:gpl3))))
214
215 (define-public pngcrush
216 (package
217 (name "pngcrush")
218 (version "1.8.13")
219 (source (origin
220 (method url-fetch)
221 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
222 version "/pngcrush-" version "-nolib.tar.xz"))
223 (sha256 (base32
224 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
225 (build-system gnu-build-system)
226 (arguments
227 '(#:tests? #f ; no check target
228 #:phases
229 (modify-phases %standard-phases
230 (replace 'configure
231 (lambda* (#:key inputs outputs #:allow-other-keys)
232 (substitute* "Makefile"
233 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
234 (string-append vardef (assoc-ref inputs "libpng") "/"))
235 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
236 (string-append vardef (assoc-ref inputs "zlib") "/"))
237 ;; The Makefile is written by hand and not using $PREFIX
238 (("\\$\\(DESTDIR\\)/usr/")
239 (string-append (assoc-ref outputs "out") "/"))))))))
240 (inputs
241 `(("libpng" ,libpng)
242 ("zlib" , zlib)))
243 (home-page "https://pmt.sourceforge.io/pngcrush")
244 (synopsis "Utility to compress PNG files")
245 (description "pngcrusqh is an optimizer for PNG (Portable Network Graphics)
246 files. It can compress them as much as 40% losslessly.")
247 (license license:zlib)))
248
249 (define-public pngcrunch
250 ;; This package used to be wrongfully name "pngcrunch".
251 (deprecated-package "pngcrunch" pngcrush))
252
253 (define-public libjpeg
254 (package
255 (name "libjpeg")
256 (version "9b")
257 (source (origin
258 (method url-fetch)
259 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
260 version ".tar.gz"))
261 (sha256 (base32
262 "0lnhpahgdwlrkd41lx6cr90r199f8mc6ydlh7jznj5klvacd63r4"))))
263 (build-system gnu-build-system)
264 (synopsis "Library for handling JPEG files")
265 (description
266 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
267 JPEG is a standardized compression method for full-color and gray-scale
268 images.
269 The included programs provide conversion between the JPEG format and
270 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats.")
271 (license license:ijg)
272 (home-page "http://www.ijg.org/")))
273
274 (define-public libjpeg-8
275 (package (inherit libjpeg)
276 (version "8d")
277 (source (origin
278 (method url-fetch)
279 (uri (string-append "http://www.ijg.org/files/jpegsrc.v"
280 version ".tar.gz"))
281 (sha256 (base32
282 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
283
284 (define-public libjxr
285 (package
286 (name "libjxr")
287 (version "1.1")
288 (source (origin
289 ;; We are using the Debian source because CodePlex does not
290 ;; deliver an easily downloadable tarball.
291 (method url-fetch)
292 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
293 version ".orig.tar.gz"))
294 (sha256
295 (base32
296 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
297 (patch-flags '("-p1" "--binary"))
298 (patches (search-patches "libjxr-fix-function-signature.patch"
299 "libjxr-fix-typos.patch"))))
300 (build-system gnu-build-system)
301 (arguments '(#:make-flags '("CC=gcc")
302 #:tests? #f ; no check target
303 #:phases
304 (modify-phases %standard-phases
305 (delete 'configure) ; no configure script
306 ;; The upstream makefile does not include an install phase.
307 (replace 'install
308 (lambda* (#:key outputs #:allow-other-keys)
309 (let* ((out (assoc-ref outputs "out"))
310 (bin (string-append out "/bin"))
311 (lib (string-append out "/lib"))
312 (include (string-append out "/include/jxrlib")))
313 (for-each (lambda (file)
314 (install-file file include)
315 (delete-file file))
316 (append
317 '("jxrgluelib/JXRGlue.h"
318 "jxrgluelib/JXRMeta.h"
319 "jxrtestlib/JXRTest.h"
320 "image/sys/windowsmediaphoto.h")
321 (find-files "common/include" "\\.h$")))
322 (for-each (lambda (file)
323 (install-file file lib)
324 (delete-file file))
325 (find-files "." "\\.a$"))
326 (for-each (lambda (file)
327 (install-file file bin)
328 (delete-file file))
329 '("JxrDecApp" "JxrEncApp")))
330 #t)))))
331 (synopsis "Implementation of the JPEG XR standard")
332 (description "JPEG XR is an approved ISO/IEC International standard (its
333 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
334 (license
335 (license:non-copyleft
336 "file://Makefile"
337 "See the header of the Makefile in the distribution."))
338 (home-page "https://jxrlib.codeplex.com/")))
339
340 (define-public jpegoptim
341 (package
342 (name "jpegoptim")
343 (version "1.4.5")
344 (source (origin
345 (method url-fetch)
346 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
347 version ".tar.gz"))
348 (sha256 (base32
349 "1mngi8c4mhzwa7i4wqrqq6i80cqj4adbacblfvk6dy573wywyxmi"))))
350 (build-system gnu-build-system)
351 (inputs `(("libjpeg" ,libjpeg)))
352 (arguments
353 ;; no tests
354 '(#:tests? #f))
355 (synopsis "Optimize JPEG images")
356 (description
357 "jpegoptim provides lossless optimization (based on optimizing
358 the Huffman tables) and \"lossy\" optimization based on setting
359 maximum quality factor.")
360 (license license:gpl2+)
361 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
362
363 (define-public libicns
364 (package
365 (name "libicns")
366 (version "0.8.1")
367 (source (origin
368 (method url-fetch)
369 (uri (string-append
370 "mirror://sourceforge/icns/"
371 "libicns-" version ".tar.gz"))
372 (sha256
373 (base32
374 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
375 (build-system gnu-build-system)
376 (inputs
377 `(("libpng" ,libpng)
378 ("jasper" ,jasper)))
379 (arguments
380 `(#:tests? #t)) ; No tests.
381 (home-page "http://icns.sourceforge.net/")
382 (synopsis "Library for handling Mac OS icns resource files")
383 (description
384 "Libicns is a library for the manipulation of Mac OS IconFamily resource
385 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
386 convert between PNG and ICNS. @command{icns2png} will extract image files from
387 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
388 with .desktop files. Additionally, @command{icontainer2png} is provided for
389 extracting icontainer icon files.")
390 (license (list license:lgpl2.1+ ; libicns
391 license:lgpl2.0+ ; src/apidocs.*
392 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
393
394 (define-public libtiff
395 (package
396 (name "libtiff")
397 (version "4.0.9")
398 (replacement libtiff/fixed)
399 (source
400 (origin
401 (method url-fetch)
402 (uri (string-append "http://download.osgeo.org/libtiff/tiff-"
403 version ".tar.gz"))
404 (sha256
405 (base32
406 "1kfg4q01r4mqn7dj63ifhi6pmqzbf4xax6ni6kkk81ri5kndwyvf"))))
407 (build-system gnu-build-system)
408 (outputs '("out"
409 "doc")) ;1.3 MiB of HTML documentation
410 (arguments
411 ;; Instead of using --docdir, this package has its own --with-docdir.
412 `(#:configure-flags (list (string-append "--with-docdir="
413 (assoc-ref %outputs "doc")
414 "/share/doc/"
415 ,name "-" ,version))))
416 (inputs `(("zlib" ,zlib)
417 ("libjpeg" ,libjpeg)))
418 (synopsis "Library for handling TIFF files")
419 (description
420 "Libtiff provides support for the Tag Image File Format (TIFF), a format
421 used for storing image data.
422 Included are a library, libtiff, for reading and writing TIFF and a small
423 collection of tools for doing simple manipulations of TIFF images.")
424 (license (license:non-copyleft "file://COPYRIGHT"
425 "See COPYRIGHT in the distribution."))
426 (home-page "http://www.simplesystems.org/libtiff/")))
427
428 (define libtiff/fixed
429 (package
430 (inherit libtiff)
431 (source
432 (origin
433 (inherit (package-source libtiff))
434 (patches
435 (append (origin-patches (package-source libtiff))
436 (search-patches "libtiff-CVE-2017-9935.patch"
437 "libtiff-CVE-2017-18013.patch")))))))
438
439 (define-public leptonica
440 (package
441 (name "leptonica")
442 (version "1.74.4")
443 (source
444 (origin
445 (method url-fetch)
446 (uri (string-append
447 "https://github.com/DanBloomberg/leptonica/archive/" version
448 ".tar.gz"))
449 (file-name (string-append "leptonica-" version ".tar.gz"))
450 (sha256
451 (base32 "10pw7pwccd0m0fc9rlrr2m41s7j1qvba2wcrav17pw1gclkf34i0"))))
452 (build-system gnu-build-system)
453 (native-inputs
454 `(("gnuplot" ,gnuplot) ;needed for test suite
455 ("autoconf" ,autoconf)
456 ("automake" ,automake)
457 ("libtool" ,libtool)
458 ("pkg-config" ,pkg-config)))
459 (inputs
460 `(("giflib" ,giflib)
461 ("libjpeg" ,libjpeg)
462 ("libpng" ,libpng)
463 ("libtiff" ,libtiff)
464 ("libwebp" ,libwebp)))
465 (propagated-inputs
466 ;; Linking a program with leptonica also requires these.
467 `(("openjpeg" ,openjpeg)
468 ("zlib" ,zlib)))
469 (arguments
470 '(#:phases
471 (modify-phases %standard-phases
472 (add-after 'unpack 'autogen
473 (lambda _
474 (zero? (system* "sh" "autobuild"))))
475 (add-after 'unpack 'patch-reg-wrapper
476 (lambda _
477 (substitute* "prog/reg_wrapper.sh"
478 ((" /bin/sh ")
479 (string-append " " (which "sh") " "))
480 (("which gnuplot")
481 "true")))))))
482 (home-page "http://www.leptonica.com/")
483 (synopsis "Library and tools for image processing and analysis")
484 (description
485 "Leptonica is a C library and set of command-line tools for efficient
486 image processing and image analysis operations. It supports rasterop, affine
487 transformations, binary and grayscale morphology, rank order, and convolution,
488 seedfill and connected components, image transformations combining changes in
489 scale and pixel depth, and pixelwise masking, blending, enhancement, and
490 arithmetic ops.")
491 (license license:bsd-2)))
492
493 (define-public jbig2dec
494 (package
495 (name "jbig2dec")
496 (version "0.14")
497 (source
498 (origin
499 (method url-fetch)
500 (uri (string-append "http://downloads.ghostscript.com/public/" name "/"
501 name "-" version ".tar.gz"))
502 (sha256
503 (base32 "0k01hp0q4275fj4rbr1gy64svfraw5w7wvwl08yjhvsnpb1rid11"))
504 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
505 (build-system gnu-build-system)
506 (synopsis "Decoder of the JBIG2 image compression format")
507 (description
508 "JBIG2 is designed for lossy or lossless encoding of 'bilevel' (1-bit
509 monochrome) images at moderately high resolution, and in particular scanned
510 paper documents. In this domain it is very efficient, offering compression
511 ratios on the order of 100:1.
512
513 This is a decoder only implementation, and currently is in the alpha
514 stage, meaning it doesn't completely work yet. However, it is
515 maintaining parity with available encoders, so it is useful for real
516 work.")
517 (home-page "http://www.ghostscript.com/jbig2dec.html")
518 (license license:gpl2+)))
519
520 (define-public openjpeg
521 (package
522 (name "openjpeg")
523 (version "2.3.0")
524 (source
525 (origin
526 (method url-fetch)
527 (uri
528 (string-append "https://github.com/uclouvain/openjpeg/archive/v"
529 version ".tar.gz"))
530 (file-name (string-append name "-" version ".tar.gz"))
531 (sha256
532 (base32
533 "06npqzkg20avnygdwaqpap91r7qpdqgrn39adj2bl8v0pg0qgirx"))))
534 (build-system cmake-build-system)
535 (arguments
536 ;; Trying to run `$ make check' results in a no rule fault.
537 '(#:tests? #f))
538 (inputs
539 `(("lcms" ,lcms)
540 ("libpng" ,libpng)
541 ("libtiff" ,libtiff)
542 ("zlib" ,zlib)))
543 (synopsis "JPEG 2000 codec")
544 (description
545 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
546 been developed in order to promote the use of JPEG 2000, the new
547 still-image compression standard from the Joint Photographic Experts
548 Group (JPEG).
549
550 In addition to the basic codec, various other features are under
551 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
552 an indexing tool useful for the JPIP protocol, JPWL-tools for
553 error-resilience, a Java-viewer for j2k-images, ...")
554 (home-page "https://github.com/uclouvain/openjpeg")
555 (license license:bsd-2)))
556
557 (define-public openjpeg-1
558 (package (inherit openjpeg)
559 (name "openjpeg")
560 (version "1.5.2")
561 (source
562 (origin
563 (method url-fetch)
564 (uri
565 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
566 name "-" version ".tar.gz"))
567 (sha256
568 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
569
570 (define-public giflib
571 (package
572 (name "giflib")
573 (version "5.1.4")
574 (source (origin
575 (method url-fetch)
576 (uri (string-append "mirror://sourceforge/giflib/giflib-"
577 version ".tar.bz2"))
578 (sha256
579 (base32
580 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))
581 (patches (search-patches
582 "giflib-make-reallocarray-private.patch"))))
583 (build-system gnu-build-system)
584 (outputs '("bin" ; utility programs
585 "out")) ; library
586 (inputs `(("libx11" ,libx11)
587 ("libice" ,libice)
588 ("libsm" ,libsm)
589 ("perl" ,perl)))
590 (arguments
591 `(#:phases
592 (modify-phases %standard-phases
593 (add-after 'unpack 'disable-html-doc-gen
594 (lambda _
595 (substitute* "doc/Makefile.in"
596 (("^all: allhtml manpages") ""))))
597 (add-after 'install 'install-manpages
598 (lambda* (#:key outputs #:allow-other-keys)
599 (let* ((bin (assoc-ref outputs "bin"))
600 (man1dir (string-append bin "/share/man/man1")))
601 (mkdir-p man1dir)
602 (for-each (lambda (file)
603 (let ((base (basename file)))
604 (format #t "installing `~a' to `~a'~%"
605 base man1dir)
606 (copy-file file
607 (string-append
608 man1dir "/" base))))
609 (find-files "doc" "\\.1"))))))))
610 (synopsis "Tools and library for working with GIF images")
611 (description
612 "GIFLIB is a library for reading and writing GIF images. It is API and
613 ABI compatible with libungif which was in wide use while the LZW compression
614 algorithm was patented. Tools are also included to convert, manipulate,
615 compose, and analyze GIF images.")
616 (home-page "http://giflib.sourceforge.net/")
617 (license license:x11)))
618
619 (define-public libungif
620 (package
621 (name "libungif")
622 (version "4.1.4")
623 (source (origin
624 (method url-fetch)
625 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
626 "libungif-" version "/libungif-"
627 version ".tar.bz2"))
628 (sha256
629 (base32
630 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
631 (build-system gnu-build-system)
632 (inputs `(("perl" ,perl))) ;package ships some perl tools
633 (home-page "http://giflib.sourceforge.net/")
634 (synopsis "GIF decompression library")
635 (description
636 "libungif is the old GIF decompression library by the GIFLIB project.")
637 (license license:expat)))
638
639 (define-public imlib2
640 (package
641 (name "imlib2")
642 (version "1.5.1")
643 (source (origin
644 (method url-fetch)
645 (uri (string-append
646 "mirror://sourceforge/enlightenment/imlib2-src/" version
647 "/imlib2-" version ".tar.bz2"))
648 (sha256
649 (base32
650 "1bms2iwmvnvpz5jqq3r52glarqkafif47zbh1ykz8hw85d2mfkps"))))
651 (build-system gnu-build-system)
652 (native-inputs
653 `(("pkgconfig" ,pkg-config)))
654 (inputs
655 `(("libx11" ,libx11)
656 ("libxext" ,libxext)
657 ("freetype" ,freetype)
658 ("libjpeg" ,libjpeg)
659 ("libpng" ,libpng)
660 ("libtiff" ,libtiff)
661 ("giflib" ,giflib)
662 ("bzip2" ,bzip2)))
663 (home-page "https://sourceforge.net/projects/enlightenment/")
664 (synopsis
665 "Loading, saving, rendering and manipulating image files")
666 (description
667 "Imlib2 is a library that does image file loading and saving as well as
668 rendering, manipulation, arbitrary polygon support, etc.
669
670 It does ALL of these operations FAST. Imlib2 also tries to be highly
671 intelligent about doing them, so writing naive programs can be done easily,
672 without sacrificing speed.
673
674 This is a complete rewrite over the Imlib 1.x series. The architecture is
675 more modular, simple, and flexible.")
676 (license license:imlib2)))
677
678 (define-public giblib
679 (package
680 (name "giblib")
681 (version "1.2.4")
682 (source (origin
683 (method url-fetch)
684 (uri (list
685 (string-append
686 "http://linuxbrit.co.uk/downloads/giblib-"
687 version ".tar.gz")
688 (string-append
689 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
690 "files/giblib/giblib-" version ".tar.gz")))
691 (sha256
692 (base32
693 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
694 (build-system gnu-build-system)
695 (inputs
696 `(("libx11" ,libx11)
697 ("imlib2" ,imlib2)))
698 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
699 (synopsis "Wrapper library for imlib2")
700 (description
701 "Giblib is a simple library which wraps imlib2's context API, avoiding
702 all the context_get/set calls, adds fontstyles to the truetype renderer and
703 supplies a generic doubly-linked list and some string functions.")
704 ;; This license removes a clause about X Consortium from the original
705 ;; X11 license.
706 (license (license:x11-style "file://COPYING"
707 "See 'COPYING' in the distribution."))))
708
709 (define-public freeimage
710 (package
711 (name "freeimage")
712 (version "3.17.0")
713 (source (origin
714 (method url-fetch)
715 (uri (string-append
716 "mirror://sourceforge/freeimage/Source%20Distribution/"
717 version "/FreeImage"
718 (string-concatenate (string-split version #\.))
719 ".zip"))
720 (sha256
721 (base32
722 "12bz57asdcfsz3zr9i9nska0fb6h3z2aizy412qjqkixkginbz7v"))
723 (modules '((guix build utils)))
724 (snippet
725 '(begin
726 (for-each
727 (lambda (dir)
728 (delete-file-recursively (string-append "Source/" dir)))
729 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
730 ;; "LibJXR"
731 "LibWebP" "OpenEXR" "ZLib"))))
732 (patches (search-patches "freeimage-unbundle.patch"
733 "freeimage-CVE-2015-0852.patch"
734 "freeimage-CVE-2016-5684.patch"
735 "freeimage-fix-build-with-gcc-5.patch"))))
736 (build-system gnu-build-system)
737 (arguments
738 '(#:phases
739 (modify-phases %standard-phases
740 ;; According to Fedora these files depend on private headers, but their
741 ;; presence is required for building, so we replace them with empty files.
742 (add-after 'unpack 'delete-unbuildable-files
743 (lambda _
744 (for-each (lambda (file)
745 (delete-file file)
746 (close (open file O_CREAT)))
747 '("Source/FreeImage/PluginG3.cpp"
748 "Source/FreeImageToolkit/JPEGTransform.cpp"))
749 #t))
750 ;; These scripts generate the Makefiles.
751 (replace 'configure
752 (lambda _
753 (invoke "sh" "gensrclist.sh")
754 (invoke "sh" "genfipsrclist.sh")))
755 (add-before 'build 'patch-makefile
756 (lambda* (#:key outputs #:allow-other-keys)
757 (substitute* "Makefile.gnu"
758 (("/usr") (assoc-ref outputs "out"))
759 (("-o root -g root") ""))
760 #t)))
761 #:make-flags
762 (list "CC=gcc"
763 ;; We need '-fpermissive' for Source/FreeImage.h.
764 ;; libjxr doesn't have a pkg-config file.
765 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
766 ;"-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"
767 ))
768 #:tests? #f)) ; no check target
769 (native-inputs
770 `(("pkg-config" ,pkg-config)
771 ("unzip" ,unzip)))
772 (inputs
773 `(("libjpeg" ,libjpeg)
774 ;("libjxr" ,libjxr)
775 ("libpng" ,libpng)
776 ("libraw" ,libraw)
777 ("libtiff" ,libtiff)
778 ("libwebp" ,libwebp)
779 ("openexr" ,openexr)
780 ("openjpeg" ,openjpeg)
781 ("zlib" ,zlib)))
782 (synopsis "Library for handling popular graphics image formats")
783 (description
784 "FreeImage is a library for developers who would like to support popular
785 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
786 (license license:gpl2+)
787 (home-page "http://freeimage.sourceforge.net")))
788
789 (define-public vigra
790 (package
791 (name "vigra")
792 (version "1.11.1")
793 (source
794 (origin
795 (method url-fetch)
796 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
797 "Version-" (string-join (string-split version #\.) "-")
798 "/vigra-" version "-src.tar.gz"))
799 (sha256 (base32
800 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
801 (build-system cmake-build-system)
802 (inputs
803 `(("boost" ,boost)
804 ("fftw" ,fftw)
805 ("fftwf" ,fftwf)
806 ("hdf5" ,hdf5)
807 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
808 ; to create a configure-flag
809 ("libjpeg" ,libjpeg)
810 ("libpng" ,libpng)
811 ("libtiff" ,libtiff)
812 ("openexr" ,openexr)
813 ("python" ,python-2) ; print syntax
814 ("python2-numpy" ,python2-numpy)
815 ("zlib" ,zlib)))
816 (native-inputs
817 `(("doxygen" ,doxygen)
818 ("python2-nose" ,python2-nose)
819 ("python2-sphinx" ,python2-sphinx)))
820 (arguments
821 `(#:test-target "check"
822 #:parallel-build? #f ; parallel builds trigger an ICE
823 #:configure-flags
824 (list "-Wno-dev" ; suppress developer mode with lots of warnings
825 (string-append "-DVIGRANUMPY_INSTALL_DIR="
826 (assoc-ref %outputs "out")
827 "/lib/python2.7/site-packages")
828 ;; OpenEXR is not enabled by default.
829 "-DWITH_OPENEXR=1"
830 ;; Fix rounding error on 32-bit machines
831 "-DCMAKE_C_FLAGS=-ffloat-store"
832 ;; The header files of ilmbase are not found when included
833 ;; by the header files of openexr, and an explicit flag
834 ;; needs to be set.
835 (string-append "-DCMAKE_CXX_FLAGS=-I"
836 (assoc-ref %build-inputs "ilmbase")
837 "/include/OpenEXR"
838 " -ffloat-store"))))
839 (synopsis "Computer vision library")
840 (description
841 "VIGRA stands for Vision with Generic Algorithms. It is an image
842 processing and analysis library that puts its main emphasis on customizable
843 algorithms and data structures. It is particularly strong for
844 multi-dimensional image processing.")
845 (license license:expat)
846 (home-page "https://ukoethe.github.io/vigra/")))
847
848 (define-public vigra-c
849 (let* ((commit "a2ff675f42079e2623318d8ff8b4288dbe7a7f06")
850 (revision "0")
851 (version (git-version "0.0.0" revision commit)))
852 (package
853 (name "vigra-c")
854 (version version)
855 (home-page "https://github.com/BSeppke/vigra_c")
856 (source (origin
857 (method git-fetch)
858 (uri (git-reference
859 (url home-page)
860 (commit commit)))
861 (sha256
862 (base32
863 "1f1phmfbbz3dsq9330rd6bjmdg29hxskxi9l17cyx1f4mdqpgdgl"))
864 (file-name (git-file-name name version))))
865 (build-system cmake-build-system)
866 (arguments
867 `(#:tests? #f)) ; No test target.
868 (native-inputs
869 `(("doxygen" ,doxygen)))
870 (inputs
871 `(("fftw" ,fftw)
872 ("fftwf" ,fftwf)
873 ("vigra" ,vigra)))
874 (synopsis "C interface to the VIGRA computer vision library")
875 (description
876 "This package provides a C interface to the VIGRA C++ computer vision
877 library. It is designed primarily to ease the implementation of higher-level
878 language bindings to VIGRA.")
879 (license license:expat))))
880
881 (define-public libwebp
882 (package
883 (name "libwebp")
884 (version "1.0.0")
885 (source
886 (origin
887 ;; No tarballs are provided for >0.6.1.
888 (method git-fetch)
889 (uri (git-reference
890 (url "https://chromium.googlesource.com/webm/libwebp")
891 (commit (string-append "v" version))))
892 (file-name (git-file-name name version))
893 (sha256
894 (base32
895 "1w8jzdbr1s4238ygyrlxryycss3f2z6d9amxdq8m82nl3l6skar4"))))
896 (build-system gnu-build-system)
897 (inputs
898 `(("freeglut" ,freeglut)
899 ("giflib" ,giflib)
900 ("libjpeg" ,libjpeg)
901 ("libpng" ,libpng)
902 ("libtiff" ,libtiff)))
903 (native-inputs
904 `(("autoconf" ,autoconf)
905 ("automake" ,automake)
906 ("libtool" ,libtool)))
907 (arguments
908 '(#:configure-flags '("--enable-libwebpmux"
909 "--enable-libwebpdemux"
910 "--enable-libwebpdecoder")
911 #:phases (modify-phases %standard-phases
912 (add-after 'unpack 'bootstrap
913 (lambda _
914 (invoke "autoreconf" "-vif"))))))
915 (home-page "https://developers.google.com/speed/webp/")
916 (synopsis "Lossless and lossy image compression")
917 (description
918 "WebP is a new image format that provides lossless and lossy compression
919 for images. WebP lossless images are 26% smaller in size compared to
920 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
921 equivalent SSIM index. WebP supports lossless transparency (also known as
922 alpha channel) with just 22% additional bytes. Transparency is also supported
923 with lossy compression and typically provides 3x smaller file sizes compared
924 to PNG when lossy compression is acceptable for the red/green/blue color
925 channels.")
926 (license license:bsd-3)))
927
928 (define-public libmng
929 (package
930 (name "libmng")
931 (version "2.0.3")
932 (source (origin
933 (method url-fetch)
934 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
935 version "/" name "-" version ".tar.xz"))
936 (sha256
937 (base32
938 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
939 (build-system gnu-build-system)
940 (propagated-inputs
941 ;; These are all in the 'Libs.private' field of libmng.pc.
942 `(("lcms" ,lcms)
943 ("libjpeg" ,libjpeg)
944 ("zlib" ,zlib)))
945 (home-page "http://www.libmng.com/")
946 (synopsis "Library for handling MNG files")
947 (description
948 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
949 (license license:bsd-3)))
950
951 (define-public exiv2
952 (package
953 (name "exiv2")
954 (version "0.26")
955 (source (origin
956 (method url-fetch)
957 (uri (list (string-append "http://www.exiv2.org/builds/exiv2-"
958 version "-trunk.tar.gz")
959 (string-append "http://www.exiv2.org/exiv2-"
960 version ".tar.gz")
961 (string-append "https://fossies.org/linux/misc/exiv2-"
962 version ".tar.gz")))
963 (patches (search-patches "exiv2-CVE-2017-14860.patch"
964 "exiv2-CVE-2017-14859-14862-14864.patch"))
965 (sha256
966 (base32
967 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
968 (build-system gnu-build-system)
969 (arguments '(#:tests? #f)) ; no `check' target
970 (propagated-inputs
971 `(("expat" ,expat)
972 ("zlib" ,zlib)))
973 (native-inputs
974 `(("intltool" ,intltool)))
975 (home-page "http://www.exiv2.org/")
976 (synopsis "Library and command-line utility to manage image metadata")
977 (description
978 "Exiv2 is a C++ library and a command line utility to manage image
979 metadata. It provides fast and easy read and write access to the Exif, IPTC
980 and XMP metadata of images in various formats.")
981
982 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
983 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
984 ;; The core is GPLv2+:
985 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
986 (license license:gpl2+)))
987
988 (define-public devil
989 (package
990 (name "devil")
991 (version "1.8.0")
992 (source (origin
993 (method url-fetch)
994 (uri (string-append "http://downloads.sourceforge.net/openil/"
995 "DevIL-" version ".tar.gz"))
996 (sha256
997 (base32
998 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
999 (build-system cmake-build-system)
1000 (arguments
1001 '(;; XXX: Not supported in the released CMakeLists.txt.
1002 ;; Enable this for > 1.8.0.
1003 #:tests? #f
1004 #:phases
1005 (modify-phases %standard-phases
1006 (add-before 'configure 'change-directory
1007 (lambda _ (chdir "DevIL") #t)))))
1008 (native-inputs
1009 `(("pkg-config" ,pkg-config)))
1010 (inputs
1011 `(("lcms" ,lcms)
1012 ("libjpeg" ,libjpeg-turbo)
1013 ("libmng" ,libmng)
1014 ("libpng" ,libpng)
1015 ("libtiff" ,libtiff)
1016 ("openexr" ,openexr)
1017 ("zlib" ,zlib)))
1018 (synopsis "Library for manipulating many image formats")
1019 (description "Developer's Image Library (DevIL) is a library to develop
1020 applications with support for many types of images. DevIL can load, save,
1021 convert, manipulate, filter and display a wide variety of image formats.")
1022 (home-page "http://openil.sourceforge.net")
1023 (license license:lgpl2.1+)))
1024
1025 (define-public jasper
1026 (package
1027 (name "jasper")
1028 (version "2.0.14")
1029 (source (origin
1030 (method url-fetch)
1031 (uri (string-append "https://github.com/mdadams/jasper/archive/"
1032 "version-" version ".tar.gz"))
1033 (file-name (string-append name "-" version ".tar.gz"))
1034 (sha256
1035 (base32
1036 "0yx9y5y0g6jv142vnqp50j3k8k5yqznz3smrblv192wgfbm6w9l5"))))
1037 (build-system cmake-build-system)
1038 (inputs `(("libjpeg" ,libjpeg)))
1039 (synopsis "JPEG-2000 library")
1040 (description "The JasPer Project is an initiative to provide a reference
1041 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1042 ISO/IEC 15444-1).")
1043 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1044 (license (license:x11-style "file://LICENSE"))))
1045
1046 (define-public zimg
1047 (package
1048 (name "zimg")
1049 (version "2.5")
1050 (source
1051 (origin
1052 (method url-fetch)
1053 (uri (string-append "https://github.com/sekrit-twc/zimg/archive/"
1054 "release-" version ".tar.gz"))
1055 (file-name (string-append name "-" version ".tar.gz"))
1056 (sha256
1057 (base32
1058 "0kbq2dy659645fmgxpzg38b6y6x82kwkydhc380kdkaikv2brcjh"))))
1059 (build-system gnu-build-system)
1060 (native-inputs
1061 `(("autoconf" ,autoconf)
1062 ("automake" ,automake)
1063 ("libtool" ,libtool)))
1064 (arguments
1065 '(#:phases
1066 (modify-phases %standard-phases
1067 (add-after 'unpack 'autogen
1068 (lambda _
1069 (zero? (system* "sh" "autogen.sh")))))))
1070 (synopsis "Scaling, colorspace conversion, and dithering library")
1071 (description "Zimg implements the commonly required image processing basics
1072 of scaling, colorspace conversion, and depth conversion. A simple API enables
1073 conversion between any supported formats to operate with minimal knowledge from
1074 the programmer.")
1075 (home-page "https://github.com/sekrit-twc/zimg")
1076 ;; test/extra/ contains musl-libm,
1077 ;; which is MIT/expat licensed, but only used for tests
1078 (license (license:fsf-free "file://COPYING")))) ;WTFPL version 2
1079
1080 (define-public perceptualdiff
1081 (package
1082 (name "perceptualdiff")
1083 (version "1.3")
1084 (source
1085 (origin
1086 (method url-fetch)
1087 (uri (string-append "https://github.com/myint/perceptualdiff/archive/v"
1088 version ".tar.gz"))
1089 (file-name (string-append name "-" version ".tar.gz"))
1090 (sha256
1091 (base32
1092 "0zl6xmp971fffg7fzcz2fbgxg5x2w7l8qa65c008i4kbkc9016ps"))))
1093 (build-system cmake-build-system)
1094 (inputs `(("freeimage" ,freeimage)))
1095 (arguments
1096 '(#:phases (modify-phases %standard-phases
1097 (add-after 'unpack 'fix-tests
1098 ;; cmake-build-system uses a build/ directory outside
1099 ;; of the source tree, one level higher than expected
1100 (lambda _
1101 (substitute* "test/run_tests.bash"
1102 (("../build") "../../build")))))))
1103 (home-page "https://github.com/myint/perceptualdiff")
1104 (synopsis "Perceptual image comparison utility")
1105 (description "PerceptualDiff visually compares two images to determine
1106 whether they look alike. It uses a computational model of the human visual
1107 system to detect similarities. This allows it too see beyond irrelevant
1108 differences in file encoding, image quality, and other small variations.")
1109 (license license:gpl2+)))
1110
1111 (define-public steghide
1112 (package
1113 (name "steghide")
1114 (version "0.5.1")
1115 (source (origin
1116 (method url-fetch)
1117 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1118 version "/steghide-" version ".tar.bz2"))
1119 (sha256
1120 (base32
1121 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1122 (patches (list (search-patch "steghide-fixes.patch")))))
1123 (build-system gnu-build-system)
1124 (native-inputs
1125 `(("gettext" ,gettext-minimal)
1126 ("libtool" ,libtool)
1127 ("perl" ,perl))) ;for tests
1128 (inputs
1129 `(("libmhash" ,libmhash)
1130 ("libmcrypt" ,libmcrypt)
1131 ("libjpeg" ,libjpeg)
1132 ("zlib" ,zlib)))
1133 (arguments
1134 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1135
1136 #:phases (modify-phases %standard-phases
1137 (add-before 'configure 'set-perl-search-path
1138 (lambda _
1139 ;; Work around "dotless @INC" build failure.
1140 (setenv "PERL5LIB"
1141 (string-append (getcwd) "/tests:"
1142 (getenv "PERL5LIB")))
1143 #t)))))
1144 (home-page "http://steghide.sourceforge.net")
1145 (synopsis "Image and audio steganography")
1146 (description
1147 "Steghide is a program to hide data in various kinds of image and audio
1148 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1149 changed, making the embedding resistant against first-order statistical tests.")
1150 (license license:gpl2+)))
1151
1152 (define-public stb-image-for-extempore
1153 (let ((revision "1")
1154 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1155 (package
1156 (name "stb-image-for-extempore")
1157 (version (string-append "0-" revision "." (string-take commit 9)))
1158 (source
1159 (origin (method git-fetch)
1160 (uri (git-reference
1161 (url "https://github.com/extemporelang/stb.git")
1162 (commit commit)))
1163 (sha256
1164 (base32
1165 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1166 (file-name (string-append name "-" version "-checkout"))))
1167 (build-system cmake-build-system)
1168 (arguments `(#:tests? #f)) ; no tests included
1169 ;; Extempore refuses to build on architectures other than x86_64
1170 (supported-systems '("x86_64-linux"))
1171 (home-page "https://github.com/extemporelang/stb")
1172 (synopsis "Image library for Extempore")
1173 (description
1174 "This package is a collection of assorted single-file libraries. Of
1175 all included libraries only the image loading and decoding library is
1176 installed as @code{stb_image}.")
1177 (license license:public-domain))))
1178
1179 (define-public optipng
1180 (package
1181 (name "optipng")
1182 (version "0.7.7")
1183 (source
1184 (origin
1185 (method url-fetch)
1186 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1187 version ".tar.gz"))
1188 (sha256
1189 (base32
1190 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))))
1191 (build-system gnu-build-system)
1192 (inputs
1193 `(("zlib" ,zlib)))
1194 (arguments
1195 '(#:phases
1196 (modify-phases %standard-phases
1197 (replace 'configure
1198 (lambda* (#:key outputs #:allow-other-keys)
1199 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1200 (invoke "sh" "configure"
1201 (string-append "--prefix=" (assoc-ref outputs "out")))
1202 #t)))))
1203 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1204 (description "OptiPNG is a PNG optimizer that recompresses image
1205 files to a smaller size, without losing any information. This program
1206 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1207 PNG, and performs PNG integrity checks and corrections.")
1208 (home-page "http://optipng.sourceforge.net/")
1209 (license license:zlib)))
1210
1211 (define-public libjpeg-turbo
1212 (package
1213 (name "libjpeg-turbo")
1214 (version "1.5.3")
1215 (source (origin
1216 (method url-fetch)
1217 (uri (string-append "mirror://sourceforge/" name "/" version "/"
1218 name "-" version ".tar.gz"))
1219 (sha256
1220 (base32
1221 "08r5b5mywwrxv4axvq80dm31cklz81grczlzlxr2xqa6pgi90j5j"))))
1222 (build-system gnu-build-system)
1223 (native-inputs
1224 `(("nasm" ,nasm)))
1225 (arguments
1226 '(#:test-target "test"
1227 #:configure-flags (list "--with-build-date=1970-01-01")))
1228 (home-page "http://www.libjpeg-turbo.org/")
1229 (synopsis "SIMD-accelerated JPEG image handling library")
1230 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1231 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1232 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1233 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1234 a significant amount.
1235 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1236 but more straightforward TurboJPEG API, and provides a full-featured Java
1237 interface. It supports color space extensions that allow it to compress from
1238 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1239 (license (list license:bsd-3 ; jsimd*.[ch] and most of simd/
1240 license:ijg)))) ; the rest
1241
1242 (define-public niftilib
1243 (package
1244 (name "niftilib")
1245 (version "2.0.0")
1246 (source (origin
1247 (method url-fetch)
1248 (uri (list (string-append "mirror://sourceforge/niftilib/"
1249 "nifticlib/nifticlib_"
1250 (string-join (string-split version #\.) "_")
1251 "/nifticlib-" version ".tar.gz")))
1252 (sha256
1253 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1254 (build-system gnu-build-system)
1255 (arguments
1256 '(#:tests? #f ; there is no test target
1257 #:parallel-build? #f ; not supported
1258 #:make-flags
1259 (list "SHELL=bash"
1260 (string-append "ZLIB_INC="
1261 (assoc-ref %build-inputs "zlib") "/include")
1262 ;; Append "-fPIC" to CFLAGS.
1263 (string-append "CFLAGS="
1264 "-Wall -ansi -pedantic -fPIC"))
1265 #:phases
1266 (modify-phases %standard-phases
1267 (replace 'install
1268 (lambda* (#:key outputs #:allow-other-keys)
1269 (let ((out (assoc-ref outputs "out")))
1270 (for-each
1271 (lambda (dir)
1272 (copy-recursively dir (string-append out "/" dir)))
1273 '("bin" "lib" "include")))
1274 #t))
1275 (delete 'configure))))
1276 (inputs
1277 `(("zlib" ,zlib)))
1278 (synopsis "Library for reading and writing files in the nifti-1 format")
1279 (description "Niftilib is a set of i/o libraries for reading and writing
1280 files in the nifti-1 data format - a binary file format for storing
1281 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1282 (fMRI) brain images.")
1283 (home-page "http://niftilib.sourceforge.net")
1284 (license license:public-domain)))
1285
1286 (define-public gpick
1287 (package
1288 (name "gpick")
1289 (version "0.2.5")
1290 (source (origin
1291 (method url-fetch)
1292 (uri (string-append "https://github.com/thezbyg/gpick/archive/"
1293 name "-" version ".tar.gz"))
1294 (sha256
1295 (base32
1296 "0mxvxk15xhk2i5vfavjhnkk4j3bnii0gpf8di14rlbpq070hd5rs"))))
1297 (build-system scons-build-system)
1298 (native-inputs
1299 `(("boost" ,boost)
1300 ("gettext" ,gnu-gettext)
1301 ("pkg-config" ,pkg-config)))
1302 (inputs
1303 `(("expat" ,expat)
1304 ("gtk2" ,gtk+-2)
1305 ("lua" ,lua-5.2)))
1306 (arguments
1307 `(#:tests? #f
1308 #:scons ,scons-python2
1309 #:scons-flags (list (string-append "DESTDIR=" %output))
1310 #:phases
1311 (modify-phases %standard-phases
1312 (add-before 'build 'fix-lua-reference
1313 (lambda _
1314 (substitute* "SConscript"
1315 (("lua5.2") "lua-5.2"))
1316 #t)))))
1317 (home-page "http://www.gpick.org/")
1318 (synopsis "Color picker")
1319 (description "Gpick is an advanced color picker and palette editing tool.")
1320 (license license:bsd-3)))
1321
1322 (define-public libiptcdata
1323 (package
1324 (name "libiptcdata")
1325 (version "1.0.4")
1326 (source (origin
1327 (method url-fetch)
1328 (uri (string-append "mirror://sourceforge/" name "/" name "/"
1329 version "/" name "-" version ".tar.gz"))
1330 (sha256
1331 (base32
1332 "03pfvkmmx762iydq0q207x2028d275pbdysfsgpmrr0ywy63pxkr"))))
1333 (build-system gnu-build-system)
1334 (home-page "http://libiptcdata.sourceforge.net/")
1335 (synopsis "IPTC metadata manipulation library")
1336 (description "Libiptcdata is a C library for manipulating the International
1337 Press Telecommunications Council (IPTC) metadata stored within multimedia files
1338 such as images. This metadata can include captions and keywords, often used by
1339 popular photo management applications. The library provides routines for
1340 parsing, viewing, modifying, and saving this metadata.")
1341 (license license:lgpl2.0+)))
1342
1343 (define-public flameshot
1344 (package
1345 (name "flameshot")
1346 (version "0.5.1")
1347 (source
1348 (origin
1349 (method url-fetch)
1350 (uri (string-append "https://github.com/lupoDharkael/flameshot/archive/"
1351 "v" version ".tar.gz"))
1352 (file-name (string-append name "-" version ".tar.gz"))
1353 (sha256
1354 (base32
1355 "0kp451bqgssvg8n3sg60s3fifplm9l5kxiij0yxkl864p2mhw8im"))))
1356 (build-system gnu-build-system)
1357 (native-inputs
1358 `(("qttools" ,qttools)))
1359 (inputs
1360 `(("qtbase" ,qtbase)))
1361 (arguments
1362 `(#:tests? #f ; no tests
1363 #:phases
1364 (modify-phases %standard-phases
1365 (replace 'configure
1366 (lambda* (#:key outputs #:allow-other-keys)
1367 (invoke "qmake"
1368 "CONFIG+=packaging"
1369 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1370 "PREFIX=/"))))))
1371 (home-page "https://github.com/lupoDharkael/flameshot")
1372 (synopsis "Powerful yet simple to use screenshot software")
1373 (description "Flameshot is a screenshot program.
1374 Features:
1375
1376 @itemize
1377 @item Customizable appearance.
1378 @item Easy to use.
1379 @item In-app screenshot edition.
1380 @item DBus interface.
1381 @item Upload to Imgur.
1382 @end itemize\n")
1383 (license license:gpl3+)))
1384
1385 (define-public r-jpeg
1386 (package
1387 (name "r-jpeg")
1388 (version "0.1-8")
1389 (source
1390 (origin
1391 (method url-fetch)
1392 (uri (cran-uri "jpeg" version))
1393 (sha256
1394 (base32
1395 "05hawv5qcb82ljc1l2nchx1wah8mq2k2kfkhpzyww554ngzbwcnh"))))
1396 (build-system r-build-system)
1397 (inputs `(("libjpeg" ,libjpeg)))
1398 (home-page "http://www.rforge.net/jpeg/")
1399 (synopsis "Read and write JPEG images with R")
1400 (description "This package provides a way to read, write and display bitmap
1401 images stored in the JPEG format with R. It can read and write both files and
1402 in-memory raw vectors.")
1403 (license license:gpl2+)))
1404
1405 (define-public gifsicle
1406 (package
1407 (name "gifsicle")
1408 (version "1.91")
1409 (source
1410 (origin
1411 (method url-fetch)
1412 (uri (string-append "http://www.lcdf.org/gifsicle/gifsicle-"
1413 version ".tar.gz"))
1414 (sha256
1415 (base32
1416 "00586z1yz86qcblgmf16yly39n4lkjrscl52hvfxqk14m81fckha"))))
1417 (build-system gnu-build-system)
1418 (arguments
1419 '(#:phases
1420 (modify-phases %standard-phases
1421 (add-before 'check 'patch-tests
1422 (lambda _
1423 (substitute* "test/testie"
1424 (("/usr/bin/perl")
1425 (which "perl"))
1426 (("/bin/sh")
1427 (which "sh"))
1428 (("/bin/rm")
1429 (which "rm")))
1430 #t)))))
1431 (native-inputs `(("perl" ,perl))) ; Only for tests.
1432 (inputs `(("libx11" ,libx11)))
1433 (home-page "http://www.lcdf.org/gifsicle/")
1434 (synopsis "Edit GIF images and animations")
1435 (description "Gifsicle is a command-line GIF image manipulation tool that:
1436
1437 @itemize
1438 @item Provides a batch mode for changing GIFs in place.
1439 @item Prints detailed information about GIFs, including comments.
1440 @item Control over interlacing, comments, looping, transparency, etc.
1441 @item Creates well-behaved GIFs: removes redundant colors, only uses local color
1442 tables, etc.
1443 @item Shrinks colormaps and change images to use the Web-safe palette.
1444 @item Optimizes GIF animations, or unoptimizes them for easier editing.
1445 @end itemize
1446
1447 Two other programs are included with Gifsicle: @command{gifview} is a
1448 lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1449 identical visual appearance.")
1450 (license license:gpl2+)))