Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / image.scm
CommitLineData
e55354b8 1;;; GNU Guix --- Functional package management for GNU
eafd0390 2;;; Copyright © 2013, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
451b5c5d 3;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
86fa2ea9 4;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
85a02905 5;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
9538014a 6;;; Copyright © 2014, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
0731a47c 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
fcc43c1f 8;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
21122bd7 9;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
bc806b0c 10;;; Copyright © 2016, 2017, 2018 Leo Famulari <leo@famulari.name>
115ace6b 11;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
3caef3bd 12;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
1fa3e336 13;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
2235abb2 14;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net>
3c8ba11a 15;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
47956fa0 16;;; Copyright © 2017 ng0 <ng0@n0.is>
8db1bd18 17;;; Copyright © 2017,2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
f2079849 18;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
da4dde61 19;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
62813c10 20;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
4715f92e 21;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
a82e6faa 22;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
3239dcd3 23;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
6e35bad0 24;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
0290f533 25;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
e55354b8
DT
26;;;
27;;; This file is part of GNU Guix.
28;;;
29;;; GNU Guix is free software; you can redistribute it and/or modify it
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
34;;; GNU Guix is distributed in the hope that it will be useful, but
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42(define-module (gnu packages image)
43 #:use-module (gnu packages)
97039f6e 44 #:use-module (gnu packages algebra)
37e05d64 45 #:use-module (gnu packages assembly)
894e2cba 46 #:use-module (gnu packages autotools)
97039f6e 47 #:use-module (gnu packages boost)
ac257f12 48 #:use-module (gnu packages check)
3239dcd3 49 #:use-module (gnu packages curl)
e55354b8 50 #:use-module (gnu packages compression)
99828fa7 51 #:use-module (gnu packages documentation)
efa77baf 52 #:use-module (gnu packages fontutils)
0290f533 53 #:use-module (gnu packages freedesktop)
1fa3e336 54 #:use-module (gnu packages gettext)
97039f6e 55 #:use-module (gnu packages ghostscript)
060ad3de 56 #:use-module (gnu packages gl)
023f0fb0 57 #:use-module (gnu packages glib)
ced7cc92 58 #:use-module (gnu packages graphics)
f2079849
JL
59 #:use-module (gnu packages gtk)
60 #:use-module (gnu packages lua)
0290f533 61 #:use-module (gnu packages man)
97039f6e 62 #:use-module (gnu packages maths)
1fa3e336 63 #:use-module (gnu packages mcrypt)
115ace6b 64 #:use-module (gnu packages mp3)
dc7e5783 65 #:use-module (gnu packages ncurses)
97039f6e 66 #:use-module (gnu packages perl)
a5d4c96b 67 #:use-module (gnu packages photo)
efa77baf 68 #:use-module (gnu packages pkg-config)
97039f6e 69 #:use-module (gnu packages python)
44d10b1f 70 #:use-module (gnu packages python-xyz)
9d0c291e 71 #:use-module (gnu packages sphinx)
efa77baf 72 #:use-module (gnu packages xml)
76d88cfa 73 #:use-module (gnu packages xorg)
84567657 74 #:use-module (gnu packages qt)
b5b73a82 75 #:use-module ((guix licenses) #:prefix license:)
e55354b8
DT
76 #:use-module (guix packages)
77 #:use-module (guix download)
ac2a38a5 78 #:use-module (guix git-download)
a82e6faa 79 #:use-module (guix utils)
38c55e5c 80 #:use-module (guix build-system gnu)
e596ab0f 81 #:use-module (guix build-system cmake)
0290f533 82 #:use-module (guix build-system meson)
f2079849 83 #:use-module (guix build-system python)
2235abb2 84 #:use-module (guix build-system scons)
e596ab0f 85 #:use-module (srfi srfi-1))
e55354b8
DT
86
87(define-public libpng
88 (package
89 (name "libpng")
8b5b3aca 90 (version "1.6.37")
e55354b8
DT
91 (source (origin
92 (method url-fetch)
a2f3c614 93 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
21ef9843
MW
94 version "/libpng-" version ".tar.xz")
95 (string-append
96 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
913059a1
EF
97 "/libpng16/libpng-" version ".tar.xz")
98 (string-append
99 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
100 "/libpng16/libpng-" version ".tar.xz")))
e55354b8 101 (sha256
8fda37bc 102 (base32
8b5b3aca 103 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
e55354b8 104 (build-system gnu-build-system)
420b0137
MB
105 (arguments
106 `(#:configure-flags '("--disable-static")))
e55354b8
DT
107
108 ;; libpng.la says "-lz", so propagate it.
109 (propagated-inputs `(("zlib" ,zlib)))
110
111 (synopsis "Library for handling PNG files")
112 (description
113 "Libpng is the official PNG (Portable Network Graphics) reference
35b9e423 114library. It supports almost all PNG features and is extensible.")
e55354b8
DT
115 (license license:zlib)
116 (home-page "http://www.libpng.org/pub/png/libpng.html")))
117
e0958c2d 118;; libpng-apng should be updated when the APNG patch is released:
119;; <https://bugs.gnu.org/27556>
114a325e 120(define-public libpng-apng
121 (package
114a325e 122 (name "libpng-apng")
e0958c2d 123 (version "1.6.28")
124 (source
125 (origin
126 (method url-fetch)
127 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
128 version "/libpng-" version ".tar.xz")
129 (string-append
130 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
131 "/libpng16/libpng-" version ".tar.xz")
132 (string-append
133 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
134 "/libpng16/libpng-" version ".tar.xz")))
135 (sha256
136 (base32
137 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
138 (build-system gnu-build-system)
114a325e 139 (arguments
696f1d0f
LF
140 `(#:modules ((guix build gnu-build-system)
141 (guix build utils)
142 (srfi srfi-1))
143 #:phases
114a325e 144 (modify-phases %standard-phases
145 (add-after 'unpack 'patch-apng
146 (lambda* (#:key inputs #:allow-other-keys)
147 (define (apply-patch file)
fccacffb
MW
148 (invoke "patch" "-p1" "--force"
149 "--input" file))
114a325e 150 (let ((apng.gz (assoc-ref inputs "apng")))
151 (format #t "Applying APNG patch '~a'...~%"
152 apng.gz)
fccacffb
MW
153 (invoke "sh" "-c"
154 (string-append "gunzip < " apng.gz " > the-patch"))
155 (apply-patch "the-patch")
156 #t)))
114a325e 157 (add-before 'configure 'no-checks
158 (lambda _
159 (substitute* "Makefile.in"
160 (("^scripts/symbols.chk") "")
161 (("check: scripts/symbols.chk") ""))
114a325e 162 #t)))))
163 (inputs
164 `(("apng" ,(origin
165 (method url-fetch)
166 (uri
167 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
168 version "/libpng-" version "-apng.patch.gz"))
169 (sha256
170 (base32
e0958c2d 171 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
114a325e 172 (native-inputs
173 `(("libtool" ,libtool)))
e0958c2d 174 ;; libpng.la says "-lz", so propagate it.
175 (propagated-inputs
176 `(("zlib" ,zlib)))
114a325e 177 (synopsis "APNG patch for libpng")
178 (description
179 "APNG (Animated Portable Network Graphics) is an unofficial
180extension of the APNG (Portable Network Graphics) format.
181APNG patch provides APNG support to libpng.")
e0958c2d 182 (home-page "https://sourceforge.net/projects/libpng-apng/")
183 (license license:zlib)))
114a325e 184
2df831a7
RW
185(define-public libpng-1.2
186 (package
187 (inherit libpng)
6cdd8c97 188 (version "1.2.59")
2df831a7
RW
189 (source
190 (origin
191 (method url-fetch)
2df831a7
RW
192 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
193 version "/libpng-" version ".tar.xz")
194 (string-append
195 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
913059a1
EF
196 "/libpng12/libpng-" version ".tar.xz")
197 (string-append
198 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
2df831a7
RW
199 "/libpng12/libpng-" version ".tar.xz")))
200 (sha256
6cdd8c97
LF
201 (base32
202 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
2df831a7 203
1ee13e01 204(define-public pngcrush
2f8b9c46 205 (package
1ee13e01 206 (name "pngcrush")
207 (version "1.8.13")
2f8b9c46
HG
208 (source (origin
209 (method url-fetch)
210 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
1ee13e01 211 version "/pngcrush-" version "-nolib.tar.xz"))
2f8b9c46 212 (sha256 (base32
1ee13e01 213 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
2f8b9c46
HG
214 (build-system gnu-build-system)
215 (arguments
1ee13e01 216 '(#:tests? #f ; no check target
2f8b9c46
HG
217 #:phases
218 (modify-phases %standard-phases
219 (replace 'configure
220 (lambda* (#:key inputs outputs #:allow-other-keys)
1ee13e01 221 (substitute* "Makefile"
2f8b9c46
HG
222 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
223 (string-append vardef (assoc-ref inputs "libpng") "/"))
224 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
225 (string-append vardef (assoc-ref inputs "zlib") "/"))
226 ;; The Makefile is written by hand and not using $PREFIX
227 (("\\$\\(DESTDIR\\)/usr/")
fccacffb
MW
228 (string-append (assoc-ref outputs "out") "/")))
229 #t)))))
2f8b9c46
HG
230 (inputs
231 `(("libpng" ,libpng)
232 ("zlib" , zlib)))
1ee13e01 233 (home-page "https://pmt.sourceforge.io/pngcrush")
2f8b9c46 234 (synopsis "Utility to compress PNG files")
85a4531f
AB
235 (description "Pngcrush optimizes @acronym{PNG, Portable Network Graphics}
236images. It can further losslessly compress them by as much as 40%.")
2f8b9c46
HG
237 (license license:zlib)))
238
1ee13e01 239(define-public pngcrunch
240 ;; This package used to be wrongfully name "pngcrunch".
241 (deprecated-package "pngcrunch" pngcrush))
242
6e35bad0
AV
243(define-public pnglite
244 (let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
245 (revision "1"))
246 (package
247 (name "pnglite")
248 ;; The project was moved from sourceforge to github.
249 ;; The latest version in sourceforge was 0.1.17:
250 ;; https://sourceforge.net/projects/pnglite/files/pnglite/
251 ;; No releases are made in github.
252 (version (git-version "0.1.17" revision commit))
253 (source (origin
254 (method git-fetch)
255 (uri (git-reference
256 (url "https://github.com/dankar/pnglite")
257 (commit commit)))
258 (sha256
259 (base32
260 "1lmmkdxby5b8z9kx3zrpgpk33njpcf2xx8z9bgqag855sjsqbbby"))
261 (file-name (git-file-name name version))))
262 (build-system gnu-build-system)
263 (arguments
264 `(#:tests? #f ; no tests
265 #:phases
266 (modify-phases %standard-phases
267 (delete 'configure)
268 (replace 'build
269 (lambda _
270 ;; common build flags for building shared libraries
271 (let ((cflags '("-O2" "-g" "-fPIC"))
272 (ldflags '("-shared")))
273 (apply invoke
274 `("gcc"
275 "-o" "libpnglite.so"
276 ,@cflags
277 ,@ldflags
278 "pnglite.c"))
279 #t)))
280 (replace 'install
281 (lambda* (#:key outputs #:allow-other-keys)
282 (let* ((out (assoc-ref outputs "out"))
283 (lib (string-append out "/lib/"))
284 (include (string-append out "/include/"))
285 (doc (string-append out "/share/doc/"
286 ,name "-" ,version "/")))
287 (install-file "libpnglite.so" lib)
288 (install-file "pnglite.h" include)
289 (install-file "README.md" doc)
290 #t))))))
291 (inputs `(("zlib" ,zlib)))
292 (home-page "https://github.com/dankar/pnglite")
293 (synopsis "Pretty small png library")
294 (description "A pretty small png library.
295Currently all documentation resides in @file{pnglite.h}.")
296 (license license:zlib))))
297
8db1bd18
HG
298(define-public libimagequant
299 (package
300 (name "libimagequant")
ba362ec8 301 (version "2.12.5")
8db1bd18
HG
302 (source
303 (origin
304 (method git-fetch)
305 (uri (git-reference
306 (url "https://github.com/ImageOptim/libimagequant.git")
307 (commit version)))
308 (file-name (git-file-name name version))
309 (sha256
ba362ec8 310 (base32 "0cp68w04ja5pv77ssfafsn958w9hh9zb8crrlb5j3gsrcmdc032k"))))
8db1bd18
HG
311 (build-system gnu-build-system)
312 (arguments
ba362ec8 313 '(#:tests? #f)) ; no check target
8db1bd18
HG
314 (home-page "https://pngquant.org/lib/")
315 (synopsis "Image palette quantization library")
316 (description "libimagequant is a small, portable C library for
317high-quality conversion of RGBA images to 8-bit indexed-color (palette)
318images. This library can significantly reduces file sizes and powers pngquant
319and other PNG optimizers.")
ba362ec8 320 (license license:gpl3+)))
8db1bd18 321
6b61dea3
HG
322(define-public pngquant
323 (package
324 (name "pngquant")
3caef3bd 325 (version "2.12.6")
6b61dea3
HG
326 (source
327 (origin
328 (method git-fetch)
329 (uri (git-reference
330 (url "https://github.com/kornelski/pngquant.git")
331 (commit version)))
332 (file-name (git-file-name name version))
333 (sha256
3caef3bd 334 (base32 "15hanshahxqs6s9fyc3aym02251dcys7bf78g3inp0y233amdbl3"))))
6b61dea3
HG
335 (build-system gnu-build-system)
336 (arguments
337 `(#:test-target "test"
338 #:configure-flags
339 '("--with-openmp" "--with-lcms2")))
340 (native-inputs
341 `(("pkg-config" ,pkg-config)))
342 (inputs
343 `(("libpng" ,libpng)
344 ("zlib" , zlib)
345 ("lcms" ,lcms)
346 ("libimagequant" ,libimagequant)))
347 (home-page "https://pngquant.org/")
348 (synopsis "Utility and library for lossy compressing PNG images")
349 (description "pngquant is a PNG compressor that significantly reduces file
350sizes by converting images to a more efficient 8-bit PNG format with alpha
351channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images
352are fully standards-compliant and are supported by all web browsers and
353operating systems.
354
355Features:
356@enumerate
357@item High-quality palette generation using a combination of vector
358 quantization algorithms.
359@item Unique adaptive dithering algorithm that adds less noise to images
360 than the standard Floyd-Steinberg.
361@item Easy to integrate with shell scripts, GUIs and server-side software.
362@item Fast mode for real-time processing/large numbers of images.
363@end enumerate")
364 (license license:gpl3+)))
365
e55354b8
DT
366(define-public libjpeg
367 (package
368 (name "libjpeg")
38e4d595 369 (version "9c")
e55354b8
DT
370 (source (origin
371 (method url-fetch)
60562ec2 372 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
e55354b8
DT
373 version ".tar.gz"))
374 (sha256 (base32
38e4d595 375 "08kixcf3a7s9x91174abjnk1xbvj4v8crdc73zi4k9h3jfbm00k5"))))
e55354b8 376 (build-system gnu-build-system)
35b9e423 377 (synopsis "Library for handling JPEG files")
e55354b8
DT
378 (description
379 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
380JPEG is a standardized compression method for full-color and gray-scale
381images.
61853b74
MC
382It also includes programs that provide conversion between the JPEG format and
383image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats, as well as
384lossless JPEG manipulations such as rotation, scaling or cropping:
385@enumerate
386@item cjpeg
387@item djpeg
388@item jpegtran
389@item rdjpgcom
390@item wrjpgcom
391@end enumerate")
e55354b8 392 (license license:ijg)
60562ec2 393 (home-page "https://www.ijg.org/")))
e55354b8
DT
394
395(define-public libjpeg-8
396 (package (inherit libjpeg)
397 (version "8d")
398 (source (origin
399 (method url-fetch)
60562ec2 400 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
e55354b8
DT
401 version ".tar.gz"))
402 (sha256 (base32
403 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
fcc43c1f 404
b81245cc
KK
405(define-public libjxr
406 (package
407 (name "libjxr")
408 (version "1.1")
409 (source (origin
410 ;; We are using the Debian source because CodePlex does not
411 ;; deliver an easily downloadable tarball.
412 (method url-fetch)
413 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
414 version ".orig.tar.gz"))
415 (sha256
416 (base32
417 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
418 (patch-flags '("-p1" "--binary"))
419 (patches (search-patches "libjxr-fix-function-signature.patch"
420 "libjxr-fix-typos.patch"))))
421 (build-system gnu-build-system)
8b9570ad
KK
422 (arguments
423 '(#:make-flags
424 (list "CC=gcc"
425 ;; A substitute* procedure call would be enough to add the -fPIC
426 ;; flag if there was no file decoding error.
427 ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
428 ;; terminators" according to the file(1) utility.
429 (string-append "CFLAGS=-I. -Icommon/include -Iimage/sys -fPIC "
430 "-D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O "))
431 #:tests? #f ; no check target
432 #:phases
433 (modify-phases %standard-phases
434 (delete 'configure) ; no configure script
435 (add-after 'build 'build-shared-library
436 (lambda _
437 ;; The Makefile uses optimization level 1, so the same
438 ;; level is used here for consistency.
439 (invoke "gcc" "-shared" "-fPIC" "-O"
440 ;; Common files.
441 "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
442 "strTransform.o" "perfTimerANSI.o"
443 ;; Decoding files.
444 "decode.o" "postprocess.o" "segdec.o" "strdec.o"
445 "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
446 ;; Encoding files.
447 "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
448 "strPredQuantEnc.o"
449 "-o" "libjpegxr.so")
450 (invoke "gcc" "-shared" "-fPIC" "-O"
451 ;; Glue files.
452 "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
453 ;; Test files.
454 "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
455 "JXRTestTif.o" "JXRTestYUV.o"
456 "-o" "libjxrglue.so")))
457 ;; The upstream makefile does not include an install phase.
458 (replace 'install
459 (lambda* (#:key outputs #:allow-other-keys)
460 (let* ((out (assoc-ref outputs "out"))
461 (bin (string-append out "/bin"))
462 (lib (string-append out "/lib"))
463 (include (string-append out "/include/jxrlib")))
464 (for-each (lambda (file)
465 (install-file file include)
466 (delete-file file))
467 (append
468 '("jxrgluelib/JXRGlue.h"
469 "jxrgluelib/JXRMeta.h"
470 "jxrtestlib/JXRTest.h"
471 "image/sys/windowsmediaphoto.h")
472 (find-files "common/include" "\\.h$")))
473 (for-each (lambda (file)
474 (install-file file lib)
475 (delete-file file))
476 (find-files "." "\\.(a|so)$"))
477 (for-each (lambda (file)
478 (install-file file bin)
479 (delete-file file))
480 '("JxrDecApp" "JxrEncApp")))
481 #t)))))
b81245cc
KK
482 (synopsis "Implementation of the JPEG XR standard")
483 (description "JPEG XR is an approved ISO/IEC International standard (its
484official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
485 (license
486 (license:non-copyleft
487 "file://Makefile"
488 "See the header of the Makefile in the distribution."))
489 (home-page "https://jxrlib.codeplex.com/")))
490
fcc43c1f
AB
491(define-public jpegoptim
492 (package
493 (name "jpegoptim")
b01a8790 494 (version "1.4.6")
fcc43c1f
AB
495 (source (origin
496 (method url-fetch)
497 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
498 version ".tar.gz"))
499 (sha256 (base32
b01a8790 500 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
fcc43c1f
AB
501 (build-system gnu-build-system)
502 (inputs `(("libjpeg" ,libjpeg)))
503 (arguments
b01a8790 504 '(#:tests? #f)) ; no tests
fcc43c1f
AB
505 (synopsis "Optimize JPEG images")
506 (description
507 "jpegoptim provides lossless optimization (based on optimizing
508the Huffman tables) and \"lossy\" optimization based on setting
509maximum quality factor.")
510 (license license:gpl2+)
ada3b94f 511 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
e55354b8 512
f5e4229a
BT
513(define-public libicns
514 (package
515 (name "libicns")
516 (version "0.8.1")
517 (source (origin
518 (method url-fetch)
519 (uri (string-append
520 "mirror://sourceforge/icns/"
521 "libicns-" version ".tar.gz"))
522 (sha256
523 (base32
524 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
525 (build-system gnu-build-system)
526 (inputs
527 `(("libpng" ,libpng)
528 ("jasper" ,jasper)))
529 (arguments
530 `(#:tests? #t)) ; No tests.
531 (home-page "http://icns.sourceforge.net/")
532 (synopsis "Library for handling Mac OS icns resource files")
533 (description
534 "Libicns is a library for the manipulation of Mac OS IconFamily resource
535type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
536convert between PNG and ICNS. @command{icns2png} will extract image files from
537ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
538with .desktop files. Additionally, @command{icontainer2png} is provided for
539extracting icontainer icon files.")
540 (license (list license:lgpl2.1+ ; libicns
541 license:lgpl2.0+ ; src/apidocs.*
542 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
543
e55354b8
DT
544(define-public libtiff
545 (package
546 (name "libtiff")
d9cd568a 547 (version "4.1.0")
c8eb2b8c
LF
548 (source
549 (origin
550 (method url-fetch)
9d7d8e71 551 (uri (string-append "http://download.osgeo.org/libtiff/tiff-"
c8eb2b8c 552 version ".tar.gz"))
c8eb2b8c
LF
553 (sha256
554 (base32
d9cd568a 555 "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"))))
e55354b8 556 (build-system gnu-build-system)
6f6eb857
LC
557 (outputs '("out"
558 "doc")) ;1.3 MiB of HTML documentation
559 (arguments
560 ;; Instead of using --docdir, this package has its own --with-docdir.
561 `(#:configure-flags (list (string-append "--with-docdir="
562 (assoc-ref %outputs "doc")
563 "/share/doc/"
2874a33d
MB
564 ,name "-" ,version)
565 "--disable-static")))
e55354b8 566 (inputs `(("zlib" ,zlib)
1de0afd5 567 ("libjpeg" ,libjpeg)))
35b9e423 568 (synopsis "Library for handling TIFF files")
e55354b8
DT
569 (description
570 "Libtiff provides support for the Tag Image File Format (TIFF), a format
571used for storing image data.
572Included are a library, libtiff, for reading and writing TIFF and a small
573collection of tools for doing simple manipulations of TIFF images.")
166191b3
LC
574 (license (license:non-copyleft "file://COPYRIGHT"
575 "See COPYRIGHT in the distribution."))
0bd1097c 576 (home-page "http://www.simplesystems.org/libtiff/")))
ed5940b6 577
894e2cba
TUBK
578(define-public leptonica
579 (package
580 (name "leptonica")
340502ba 581 (version "1.74.4")
894e2cba
TUBK
582 (source
583 (origin
69f7d3f4
RW
584 (method git-fetch)
585 (uri (git-reference
586 (url "https://github.com/DanBloomberg/leptonica.git")
587 (commit version)))
588 (file-name (git-file-name name version))
894e2cba 589 (sha256
69f7d3f4 590 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
894e2cba
TUBK
591 (build-system gnu-build-system)
592 (native-inputs
d02fb7ce
TUBK
593 `(("gnuplot" ,gnuplot) ;needed for test suite
594 ("autoconf" ,autoconf)
595 ("automake" ,automake)
596 ("libtool" ,libtool)
597 ("pkg-config" ,pkg-config)))
894e2cba
TUBK
598 (inputs
599 `(("giflib" ,giflib)
600 ("libjpeg" ,libjpeg)
601 ("libpng" ,libpng)
602 ("libtiff" ,libtiff)
603 ("libwebp" ,libwebp)))
604 (propagated-inputs
d02fb7ce 605 ;; Linking a program with leptonica also requires these.
894e2cba
TUBK
606 `(("openjpeg" ,openjpeg)
607 ("zlib" ,zlib)))
608 (arguments
d02fb7ce 609 '(#:phases
894e2cba 610 (modify-phases %standard-phases
d02fb7ce
TUBK
611 (add-after 'unpack 'patch-reg-wrapper
612 (lambda _
613 (substitute* "prog/reg_wrapper.sh"
614 ((" /bin/sh ")
615 (string-append " " (which "sh") " "))
616 (("which gnuplot")
fccacffb
MW
617 "true"))
618 #t)))))
894e2cba
TUBK
619 (home-page "http://www.leptonica.com/")
620 (synopsis "Library and tools for image processing and analysis")
621 (description
622 "Leptonica is a C library and set of command-line tools for efficient
623image processing and image analysis operations. It supports rasterop, affine
624transformations, binary and grayscale morphology, rank order, and convolution,
625seedfill and connected components, image transformations combining changes in
626scale and pixel depth, and pixelwise masking, blending, enhancement, and
627arithmetic ops.")
628 (license license:bsd-2)))
629
8d9872b5
MB
630(define-public jbig2dec
631 (package
632 (name "jbig2dec")
5d229b49 633 (version "0.17")
fb94354a
MB
634 (source (origin
635 (method url-fetch)
636 (uri (string-append "https://github.com/ArtifexSoftware"
637 "/ghostpdl-downloads/releases/download"
5d229b49 638 "/gs950/" name "-" version ".tar.gz"))
fb94354a
MB
639 (sha256
640 (base32
5d229b49 641 "0wpvslmwazia3z8gyk343kbq6yj47pxr4x5yjvx332v309qssazp"))
fb94354a 642 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
8d9872b5 643 (build-system gnu-build-system)
5e537222 644 (arguments '(#:configure-flags '("--disable-static")))
8d9872b5
MB
645 (synopsis "Decoder of the JBIG2 image compression format")
646 (description
36a4366d 647 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
7c125ce0
AK
648monochrome) images at moderately high resolution, and in particular scanned
649paper documents. In this domain it is very efficient, offering compression
650ratios on the order of 100:1.
8d9872b5
MB
651
652This is a decoder only implementation, and currently is in the alpha
653stage, meaning it doesn't completely work yet. However, it is
654maintaining parity with available encoders, so it is useful for real
655work.")
6acc671b 656 (home-page "https://jbig2dec.com")
8d9872b5 657 (license license:gpl2+)))
38c55e5c 658
8f685df2
TGR
659(define-public jbigkit
660 (package
661 (name "jbigkit")
662 (version "2.1")
663 (source
664 (origin
665 (method url-fetch)
666 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
667 "download/jbigkit-" version ".tar.gz"))
668 (sha256
669 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
670 (modules '((guix build utils)))
671 (snippet
672 '(begin
673 ;; Remove files without clear licence information.
674 (for-each delete-file-recursively
675 (list "contrib" "examples"))
676 #t))))
677 (build-system gnu-build-system)
678 (outputs (list "out" "pbmtools"))
679 (arguments
680 `(#:modules ((srfi srfi-26)
681 ,@%gnu-build-system-modules)
682 #:phases
683 (modify-phases %standard-phases
684 (delete 'configure) ; no configure script
685 (replace 'install ; no ‘make install’ target
686 (lambda* (#:key outputs #:allow-other-keys)
687 (let* ((out (assoc-ref outputs "out"))
688 (lib (string-append out "/lib"))
689 (include (string-append out "/include")))
690 (with-directory-excursion "libjbig"
691 (for-each (cut install-file <> include)
692 (find-files "." "\\.h$"))
693 (for-each (cut install-file <> lib)
694 (find-files "." "\\.a$")))
695 #t)))
696 (add-after 'install 'install-pbmtools
697 (lambda* (#:key outputs #:allow-other-keys)
698 (let* ((out (assoc-ref outputs "pbmtools"))
699 (bin (string-append out "/bin"))
700 (man1 (string-append out "/share/man/man1"))
701 (man5 (string-append out "/share/man/man5")))
702 (with-directory-excursion "pbmtools"
703 (for-each (cut install-file <> bin)
704 (list "jbgtopbm" "jbgtopbm85"
705 "pbmtojbg" "pbmtojbg85"))
706
707 (for-each (cut install-file <> man1)
708 (find-files "." "\\.1$"))
709 (for-each (cut install-file <> man5)
710 (find-files "." "\\.5$"))
711 #t)))))
712 #:test-target "test"
713 #:tests? #f)) ; tests depend on examples/
714 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
715 (synopsis "Lossless compression for bi-level high-resolution images")
716 (description
717 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
718ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
719black-and-white scanned documents. It is widely used in fax products, printer
720firmware and drivers, document management systems, and imaging software.
721
722This package provides a static C library of (de)compression functions and some
723simple command-line converters similar to those provided by netpbm.
724
725Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
726options of the standard but has to keep the full uncompressed image in memory.
727The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
728memory management optimized for embedded and fax applications. It buffers
729only a few lines of the uncompressed image in memory and is able to stream
730images of initially unknown height.")
731 (license (list license:isc ; pbmtools/p?m.5
732 license:gpl2+)))) ; the rest
733
38c55e5c
MB
734(define-public openjpeg
735 (package
736 (name "openjpeg")
de1b5e49
MB
737 (version "2.3.1")
738 (source (origin
739 (method git-fetch)
740 (uri (git-reference
741 (url "https://github.com/uclouvain/openjpeg")
742 (commit (string-append "v" version))))
743 (file-name (git-file-name "openjpeg" version))
744 (sha256
745 (base32
746 "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb"))))
38c55e5c
MB
747 (build-system cmake-build-system)
748 (arguments
8de1979d
MB
749 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
750 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
38c55e5c
MB
751 (inputs
752 `(("lcms" ,lcms)
753 ("libpng" ,libpng)
754 ("libtiff" ,libtiff)
755 ("zlib" ,zlib)))
756 (synopsis "JPEG 2000 codec")
757 (description
758 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
759been developed in order to promote the use of JPEG 2000, the new
760still-image compression standard from the Joint Photographic Experts
761Group (JPEG).
762
763In addition to the basic codec, various other features are under
764development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
765an indexing tool useful for the JPIP protocol, JPWL-tools for
766error-resilience, a Java-viewer for j2k-images, ...")
b9270582 767 (home-page "https://github.com/uclouvain/openjpeg")
38c55e5c 768 (license license:bsd-2)))
76d88cfa 769
6140b9d8
RW
770(define-public openjpeg-1
771 (package (inherit openjpeg)
772 (name "openjpeg")
773 (version "1.5.2")
774 (source
775 (origin
776 (method url-fetch)
777 (uri
de67e922
LF
778 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
779 name "-" version ".tar.gz"))
6140b9d8
RW
780 (sha256
781 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
782
e596ab0f
AK
783(define-public giflib
784 (package
785 (name "giflib")
c9d4e14a 786 (version "5.2.1")
e596ab0f
AK
787 (source (origin
788 (method url-fetch)
789 (uri (string-append "mirror://sourceforge/giflib/giflib-"
c9d4e14a 790 version ".tar.gz"))
e596ab0f 791 (sha256
44c5f025 792 (base32
c9d4e14a 793 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
e596ab0f
AK
794 (build-system gnu-build-system)
795 (outputs '("bin" ; utility programs
796 "out")) ; library
e596ab0f 797 (arguments
c9d4e14a
MB
798 '(#:make-flags (list "CC=gcc"
799 (string-append "PREFIX="
800 (assoc-ref %outputs "out"))
801 (string-append "BINDIR="
802 (assoc-ref %outputs "bin") "/bin"))
803 #:phases
44c5f025
EF
804 (modify-phases %standard-phases
805 (add-after 'unpack 'disable-html-doc-gen
806 (lambda _
c9d4e14a 807 (substitute* "doc/Makefile"
4a3ee3fb
MW
808 (("^all: allhtml manpages") ""))
809 #t))
c9d4e14a 810 (delete 'configure)
44c5f025
EF
811 (add-after 'install 'install-manpages
812 (lambda* (#:key outputs #:allow-other-keys)
813 (let* ((bin (assoc-ref outputs "bin"))
814 (man1dir (string-append bin "/share/man/man1")))
815 (mkdir-p man1dir)
816 (for-each (lambda (file)
817 (let ((base (basename file)))
818 (format #t "installing `~a' to `~a'~%"
819 base man1dir)
820 (copy-file file
821 (string-append
822 man1dir "/" base))))
4a3ee3fb
MW
823 (find-files "doc" "\\.1"))
824 #t))))))
e596ab0f
AK
825 (synopsis "Tools and library for working with GIF images")
826 (description
35b9e423 827 "GIFLIB is a library for reading and writing GIF images. It is API and
e596ab0f
AK
828ABI compatible with libungif which was in wide use while the LZW compression
829algorithm was patented. Tools are also included to convert, manipulate,
830compose, and analyze GIF images.")
831 (home-page "http://giflib.sourceforge.net/")
832 (license license:x11)))
833
0731a47c
TUBK
834(define-public libungif
835 (package
836 (name "libungif")
837 (version "4.1.4")
838 (source (origin
839 (method url-fetch)
de67e922
LF
840 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
841 "libungif-" version "/libungif-"
0731a47c
TUBK
842 version ".tar.bz2"))
843 (sha256
844 (base32
845 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
846 (build-system gnu-build-system)
847 (inputs `(("perl" ,perl))) ;package ships some perl tools
848 (home-page "http://giflib.sourceforge.net/")
849 (synopsis "GIF decompression library")
850 (description
851 "libungif is the old GIF decompression library by the GIFLIB project.")
852 (license license:expat)))
853
76d88cfa
AK
854(define-public imlib2
855 (package
856 (name "imlib2")
c45fdf90 857 (version "1.6.1")
76d88cfa
AK
858 (source (origin
859 (method url-fetch)
860 (uri (string-append
de67e922
LF
861 "mirror://sourceforge/enlightenment/imlib2-src/" version
862 "/imlib2-" version ".tar.bz2"))
76d88cfa
AK
863 (sha256
864 (base32
c45fdf90 865 "0v8n3dswx7rxqfd0q03xwc7j2w1mv8lv18rdxv487a1xw5vklfad"))))
76d88cfa 866 (build-system gnu-build-system)
76d88cfa
AK
867 (native-inputs
868 `(("pkgconfig" ,pkg-config)))
869 (inputs
e56d02a0 870 `(("bzip2" ,bzip2)
76d88cfa 871 ("freetype" ,freetype)
e56d02a0
EF
872 ("giflib" ,giflib)
873 ("libid3tag" ,libid3tag)
76d88cfa
AK
874 ("libjpeg" ,libjpeg)
875 ("libpng" ,libpng)
876 ("libtiff" ,libtiff)
e56d02a0
EF
877 ("libx11" ,libx11)
878 ("libxext" ,libxext)
879 ("libwebp" ,libwebp)))
3b3b60d0 880 (home-page "https://sourceforge.net/projects/enlightenment/")
76d88cfa
AK
881 (synopsis
882 "Loading, saving, rendering and manipulating image files")
883 (description
884 "Imlib2 is a library that does image file loading and saving as well as
885rendering, manipulation, arbitrary polygon support, etc.
886
887It does ALL of these operations FAST. Imlib2 also tries to be highly
888intelligent about doing them, so writing naive programs can be done easily,
889without sacrificing speed.
890
891This is a complete rewrite over the Imlib 1.x series. The architecture is
892more modular, simple, and flexible.")
8835aed4 893 (license license:imlib2)))
f7d28082
AK
894
895(define-public giblib
896 (package
897 (name "giblib")
898 (version "1.2.4")
899 (source (origin
900 (method url-fetch)
bf512da1
EF
901 (uri (list
902 (string-append
903 "http://linuxbrit.co.uk/downloads/giblib-"
904 version ".tar.gz")
905 (string-append
906 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
907 "files/giblib/giblib-" version ".tar.gz")))
f7d28082
AK
908 (sha256
909 (base32
910 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
911 (build-system gnu-build-system)
912 (inputs
913 `(("libx11" ,libx11)
914 ("imlib2" ,imlib2)))
915 (home-page "http://linuxbrit.co.uk/software/") ; no real home-page
916 (synopsis "Wrapper library for imlib2")
917 (description
35b9e423 918 "Giblib is a simple library which wraps imlib2's context API, avoiding
f7d28082
AK
919all the context_get/set calls, adds fontstyles to the truetype renderer and
920supplies a generic doubly-linked list and some string functions.")
921 ;; This license removes a clause about X Consortium from the original
922 ;; X11 license.
923 (license (license:x11-style "file://COPYING"
924 "See 'COPYING' in the distribution."))))
43402c5c
DT
925
926(define-public freeimage
927 (package
928 (name "freeimage")
8dc3c2a7 929 (version "3.18.0")
43402c5c
DT
930 (source (origin
931 (method url-fetch)
932 (uri (string-append
933 "mirror://sourceforge/freeimage/Source%20Distribution/"
934 version "/FreeImage"
bcc09d9a 935 (string-concatenate (string-split version #\.))
43402c5c
DT
936 ".zip"))
937 (sha256
938 (base32
8dc3c2a7 939 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
a5d4c96b
EF
940 (modules '((guix build utils)))
941 (snippet
942 '(begin
943 (for-each
944 (lambda (dir)
945 (delete-file-recursively (string-append "Source/" dir)))
f347c24a 946 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
8dc3c2a7
KK
947 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
948 (patches (search-patches "freeimage-unbundle.patch"))))
43402c5c
DT
949 (build-system gnu-build-system)
950 (arguments
4a2798e0
EF
951 '(#:phases
952 (modify-phases %standard-phases
a5d4c96b
EF
953 ;; According to Fedora these files depend on private headers, but their
954 ;; presence is required for building, so we replace them with empty files.
955 (add-after 'unpack 'delete-unbuildable-files
956 (lambda _
957 (for-each (lambda (file)
958 (delete-file file)
959 (close (open file O_CREAT)))
960 '("Source/FreeImage/PluginG3.cpp"
961 "Source/FreeImageToolkit/JPEGTransform.cpp"))
962 #t))
963 ;; These scripts generate the Makefiles.
964 (replace 'configure
965 (lambda _
966 (invoke "sh" "gensrclist.sh")
967 (invoke "sh" "genfipsrclist.sh")))
4a2798e0
EF
968 (add-before 'build 'patch-makefile
969 (lambda* (#:key outputs #:allow-other-keys)
970 (substitute* "Makefile.gnu"
971 (("/usr") (assoc-ref outputs "out"))
972 (("-o root -g root") ""))
973 #t)))
a5d4c96b
EF
974 #:make-flags
975 (list "CC=gcc"
976 ;; We need '-fpermissive' for Source/FreeImage.h.
977 ;; libjxr doesn't have a pkg-config file.
978 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
0fe041bd 979 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
43402c5c
DT
980 #:tests? #f)) ; no check target
981 (native-inputs
a5d4c96b
EF
982 `(("pkg-config" ,pkg-config)
983 ("unzip" ,unzip)))
984 (inputs
985 `(("libjpeg" ,libjpeg)
8dc3c2a7 986 ("libjxr" ,libjxr)
a5d4c96b
EF
987 ("libpng" ,libpng)
988 ("libraw" ,libraw)
989 ("libtiff" ,libtiff)
990 ("libwebp" ,libwebp)
991 ("openexr" ,openexr)
992 ("openjpeg" ,openjpeg)
993 ("zlib" ,zlib)))
43402c5c
DT
994 (synopsis "Library for handling popular graphics image formats")
995 (description
996 "FreeImage is a library for developers who would like to support popular
997graphics image formats like PNG, BMP, JPEG, TIFF and others.")
998 (license license:gpl2+)
999 (home-page "http://freeimage.sourceforge.net")))
97039f6e
AE
1000
1001(define-public vigra
019b3875
AE
1002 (package
1003 (name "vigra")
83273596 1004 (version "1.11.1")
019b3875
AE
1005 (source
1006 (origin
1007 (method url-fetch)
1008 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
83273596
MB
1009 "Version-" (string-join (string-split version #\.) "-")
1010 "/vigra-" version "-src.tar.gz"))
a82e6faa 1011 (patches (search-patches "vigra-python-compat.patch"))
019b3875 1012 (sha256 (base32
83273596 1013 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
019b3875
AE
1014 (build-system cmake-build-system)
1015 (inputs
1016 `(("boost" ,boost)
1017 ("fftw" ,fftw)
1018 ("fftwf" ,fftwf)
1019 ("hdf5" ,hdf5)
1020 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
1021 ; to create a configure-flag
1022 ("libjpeg" ,libjpeg)
1023 ("libpng" ,libpng)
1024 ("libtiff" ,libtiff)
1025 ("openexr" ,openexr)
691068f0 1026 ("python" ,python-wrapper)
a82e6faa 1027 ("python-numpy" ,python-numpy)
019b3875
AE
1028 ("zlib" ,zlib)))
1029 (native-inputs
1030 `(("doxygen" ,doxygen)
a82e6faa 1031 ("python-nose" ,python-nose)
556530c9 1032 ("sphinx" ,python-sphinx)))
019b3875
AE
1033 (arguments
1034 `(#:test-target "check"
e32db0fa
RW
1035 #:phases
1036 (modify-phases %standard-phases
43696990 1037 (add-after 'unpack 'disable-broken-tests
e32db0fa 1038 (lambda _
43696990 1039 ;; See https://github.com/ukoethe/vigra/issues/432
e32db0fa
RW
1040 (substitute* "test/fourier/CMakeLists.txt"
1041 (("VIGRA_ADD_TEST.*") ""))
43696990
MB
1042 ;; This test fails with Numpy 1.15:
1043 ;; <https://github.com/ukoethe/vigra/issues/436>.
1044 (substitute* "vigranumpy/test/CMakeLists.txt"
1045 (("test1\\.py") ""))
e32db0fa 1046 #t)))
019b3875
AE
1047 #:configure-flags
1048 (list "-Wno-dev" ; suppress developer mode with lots of warnings
1049 (string-append "-DVIGRANUMPY_INSTALL_DIR="
1050 (assoc-ref %outputs "out")
a82e6faa
MB
1051 "/lib/python"
1052 ,(version-major+minor (package-version python))
1053 "/site-packages")
019b3875
AE
1054 ;; OpenEXR is not enabled by default.
1055 "-DWITH_OPENEXR=1"
f803f775
LF
1056 ;; Fix rounding error on 32-bit machines
1057 "-DCMAKE_C_FLAGS=-ffloat-store"
019b3875
AE
1058 ;; The header files of ilmbase are not found when included
1059 ;; by the header files of openexr, and an explicit flag
1060 ;; needs to be set.
1061 (string-append "-DCMAKE_CXX_FLAGS=-I"
1062 (assoc-ref %build-inputs "ilmbase")
f803f775
LF
1063 "/include/OpenEXR"
1064 " -ffloat-store"))))
019b3875
AE
1065 (synopsis "Computer vision library")
1066 (description
1067 "VIGRA stands for Vision with Generic Algorithms. It is an image
97039f6e
AE
1068processing and analysis library that puts its main emphasis on customizable
1069algorithms and data structures. It is particularly strong for
1070multi-dimensional image processing.")
019b3875 1071 (license license:expat)
83273596 1072 (home-page "https://ukoethe.github.io/vigra/")))
060ad3de 1073
62813c10 1074(define-public vigra-c
4526bd07
RW
1075 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1076 (revision "1"))
62813c10
FT
1077 (package
1078 (name "vigra-c")
4526bd07 1079 (version (git-version "0.0.0" revision commit))
62813c10
FT
1080 (home-page "https://github.com/BSeppke/vigra_c")
1081 (source (origin
1082 (method git-fetch)
1083 (uri (git-reference
1084 (url home-page)
1085 (commit commit)))
1086 (sha256
1087 (base32
4526bd07 1088 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
62813c10
FT
1089 (file-name (git-file-name name version))))
1090 (build-system cmake-build-system)
1091 (arguments
1092 `(#:tests? #f)) ; No test target.
1093 (native-inputs
1094 `(("doxygen" ,doxygen)))
1095 (inputs
1096 `(("fftw" ,fftw)
1097 ("fftwf" ,fftwf)
4526bd07 1098 ("hdf5" ,hdf5)
62813c10
FT
1099 ("vigra" ,vigra)))
1100 (synopsis "C interface to the VIGRA computer vision library")
1101 (description
1102 "This package provides a C interface to the VIGRA C++ computer vision
1103library. It is designed primarily to ease the implementation of higher-level
1104language bindings to VIGRA.")
1105 (license license:expat))))
1106
060ad3de
TUBK
1107(define-public libwebp
1108 (package
1109 (name "libwebp")
ad7287b2 1110 (version "1.1.0")
060ad3de
TUBK
1111 (source
1112 (origin
b981f777
MB
1113 ;; No tarballs are provided for >0.6.1.
1114 (method git-fetch)
1115 (uri (git-reference
1116 (url "https://chromium.googlesource.com/webm/libwebp")
1117 (commit (string-append "v" version))))
1118 (file-name (git-file-name name version))
060ad3de 1119 (sha256
b2ed5ca7 1120 (base32
ad7287b2 1121 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
060ad3de
TUBK
1122 (build-system gnu-build-system)
1123 (inputs
1124 `(("freeglut" ,freeglut)
1125 ("giflib" ,giflib)
1126 ("libjpeg" ,libjpeg)
1127 ("libpng" ,libpng)
1128 ("libtiff" ,libtiff)))
b981f777
MB
1129 (native-inputs
1130 `(("autoconf" ,autoconf)
1131 ("automake" ,automake)
1132 ("libtool" ,libtool)))
060ad3de
TUBK
1133 (arguments
1134 '(#:configure-flags '("--enable-libwebpmux"
1135 "--enable-libwebpdemux"
371d95eb
MB
1136 "--enable-libwebpdecoder"
1137 "--disable-static")))
060ad3de
TUBK
1138 (home-page "https://developers.google.com/speed/webp/")
1139 (synopsis "Lossless and lossy image compression")
1140 (description
1141 "WebP is a new image format that provides lossless and lossy compression
1eefe4a8
LC
1142for images. WebP lossless images are 26% smaller in size compared to
1143PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1144equivalent SSIM index. WebP supports lossless transparency (also known as
1145alpha channel) with just 22% additional bytes. Transparency is also supported
060ad3de
TUBK
1146with lossy compression and typically provides 3x smaller file sizes compared
1147to PNG when lossy compression is acceptable for the red/green/blue color
1148channels.")
1149 (license license:bsd-3)))
b9ecd5ae
SB
1150
1151(define-public libmng
1152 (package
1153 (name "libmng")
1154 (version "2.0.3")
1155 (source (origin
1156 (method url-fetch)
0f971a04
LF
1157 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1158 version "/" name "-" version ".tar.xz"))
b9ecd5ae
SB
1159 (sha256
1160 (base32
1161 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1162 (build-system gnu-build-system)
1163 (propagated-inputs
1164 ;; These are all in the 'Libs.private' field of libmng.pc.
1165 `(("lcms" ,lcms)
1166 ("libjpeg" ,libjpeg)
1167 ("zlib" ,zlib)))
1168 (home-page "http://www.libmng.com/")
1169 (synopsis "Library for handling MNG files")
1170 (description
1171 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1172 (license license:bsd-3)))
3aab2c83 1173
023f0fb0
AK
1174(define-public exiv2
1175 (package
1176 (name "exiv2")
febbe431 1177 (version "0.27.2")
0e1c5ccc
TGR
1178 (source
1179 (origin
1180 (method url-fetch)
1181 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
1182 "-Source.tar.gz"))
1183 (sha256
febbe431 1184 (base32 "0gqminvj14xm3rgbnydbywf22608js80rp7nmxxk4497j5mzali6"))))
0e1c5ccc
TGR
1185 (build-system cmake-build-system)
1186 (arguments '(#:tests? #f)) ; no test suite
023f0fb0
AK
1187 (propagated-inputs
1188 `(("expat" ,expat)
1189 ("zlib" ,zlib)))
993d8164 1190 (home-page "https://www.exiv2.org/")
023f0fb0
AK
1191 (synopsis "Library and command-line utility to manage image metadata")
1192 (description
1193 "Exiv2 is a C++ library and a command line utility to manage image
1194metadata. It provides fast and easy read and write access to the Exif, IPTC
1195and XMP metadata of images in various formats.")
1196
1197 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1198 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1199 ;; The core is GPLv2+:
1200 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1201 (license license:gpl2+)))
1202
eafd0390
LC
1203(define-public exiv2-0.26
1204 (package
1205 (inherit exiv2)
1206 (version "0.26")
1207 (source (origin
1208 (method url-fetch)
1209 (uri (list (string-append "https://www.exiv2.org/builds/exiv2-"
1210 version "-trunk.tar.gz")
1211 (string-append "https://www.exiv2.org/exiv2-"
1212 version ".tar.gz")
1213 (string-append "https://fossies.org/linux/misc/exiv2-"
1214 version ".tar.gz")))
1215 (patches (search-patches "exiv2-CVE-2017-14860.patch"
1216 "exiv2-CVE-2017-14859-14862-14864.patch"))
1217 (sha256
1218 (base32
1219 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
1220 (build-system gnu-build-system)
1221 (arguments '(#:tests? #f)) ; no `check' target
1222 (propagated-inputs
1223 `(("expat" ,expat)
1224 ("zlib" ,zlib)))
1225 (native-inputs
1226 `(("intltool" ,intltool)))
1227
1228 ;; People should rely on the newer version, so don't expose it.
1229 (properties `((hidden? . #t)))))
1230
3aab2c83
DT
1231(define-public devil
1232 (package
1233 (name "devil")
77ab6983 1234 (version "1.8.0")
3aab2c83
DT
1235 (source (origin
1236 (method url-fetch)
1237 (uri (string-append "http://downloads.sourceforge.net/openil/"
1238 "DevIL-" version ".tar.gz"))
1239 (sha256
1240 (base32
77ab6983
MB
1241 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1242 (build-system cmake-build-system)
3aab2c83 1243 (arguments
77ab6983
MB
1244 '(;; XXX: Not supported in the released CMakeLists.txt.
1245 ;; Enable this for > 1.8.0.
1246 #:tests? #f
3aab2c83
DT
1247 #:phases
1248 (modify-phases %standard-phases
77ab6983
MB
1249 (add-before 'configure 'change-directory
1250 (lambda _ (chdir "DevIL") #t)))))
3aab2c83
DT
1251 (native-inputs
1252 `(("pkg-config" ,pkg-config)))
1253 (inputs
1254 `(("lcms" ,lcms)
77ab6983 1255 ("libjpeg" ,libjpeg-turbo)
3aab2c83
DT
1256 ("libmng" ,libmng)
1257 ("libpng" ,libpng)
1258 ("libtiff" ,libtiff)
1259 ("openexr" ,openexr)
1260 ("zlib" ,zlib)))
1261 (synopsis "Library for manipulating many image formats")
1262 (description "Developer's Image Library (DevIL) is a library to develop
1263applications with support for many types of images. DevIL can load, save,
1264convert, manipulate, filter and display a wide variety of image formats.")
1265 (home-page "http://openil.sourceforge.net")
1266 (license license:lgpl2.1+)))
b0b23e52
DT
1267
1268(define-public jasper
1269 (package
1270 (name "jasper")
8cc3983a 1271 (version "2.0.16")
b0b23e52 1272 (source (origin
d57b017c
RW
1273 (method git-fetch)
1274 (uri (git-reference
1275 (url "https://github.com/mdadams/jasper.git")
1276 (commit (string-append "version-" version))))
1277 (file-name (git-file-name name version))
b0b23e52
DT
1278 (sha256
1279 (base32
8cc3983a 1280 "05l75yd1zsxwv25ykwwwjs8961szv7iywf16nc6vc6qpby27ckv6"))))
c7a70c33 1281 (build-system cmake-build-system)
d87c201f 1282 (inputs `(("libjpeg" ,libjpeg)))
b0b23e52
DT
1283 (synopsis "JPEG-2000 library")
1284 (description "The JasPer Project is an initiative to provide a reference
1285implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1286ISO/IEC 15444-1).")
1287 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1288 (license (license:x11-style "file://LICENSE"))))
365a4a7f
EF
1289
1290(define-public zimg
1291 (package
1292 (name "zimg")
4120e6e0 1293 (version "2.9.2")
365a4a7f
EF
1294 (source
1295 (origin
ba185e2a
RW
1296 (method git-fetch)
1297 (uri (git-reference
1298 (url "https://github.com/sekrit-twc/zimg.git")
1299 (commit (string-append "release-" version))))
1300 (file-name (git-file-name name version))
365a4a7f 1301 (sha256
4120e6e0 1302 (base32 "0jlgrlfs9maixd8mx7gk2kfawz8ixnihkxi7vhyzfy1gq49vmxm2"))))
365a4a7f
EF
1303 (build-system gnu-build-system)
1304 (native-inputs
1305 `(("autoconf" ,autoconf)
1306 ("automake" ,automake)
1307 ("libtool" ,libtool)))
365a4a7f
EF
1308 (synopsis "Scaling, colorspace conversion, and dithering library")
1309 (description "Zimg implements the commonly required image processing basics
1310of scaling, colorspace conversion, and depth conversion. A simple API enables
1311conversion between any supported formats to operate with minimal knowledge from
1312the programmer.")
1313 (home-page "https://github.com/sekrit-twc/zimg")
8ee04627 1314 ;; test/extra/ contains musl-libm,
365a4a7f 1315 ;; which is MIT/expat licensed, but only used for tests
f62e7ce4 1316 (license license:wtfpl2)))
af7aaaeb
TGR
1317
1318(define-public perceptualdiff
1319 (package
1320 (name "perceptualdiff")
1321 (version "1.3")
1322 (source
1323 (origin
be59c48d
TGR
1324 (method git-fetch)
1325 (uri (git-reference
1326 (url "https://github.com/myint/perceptualdiff.git")
1327 (commit (string-append "v" version))))
1328 (file-name (git-file-name name version))
1329 (sha256
1330 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
af7aaaeb
TGR
1331 (build-system cmake-build-system)
1332 (inputs `(("freeimage" ,freeimage)))
1333 (arguments
1334 '(#:phases (modify-phases %standard-phases
1335 (add-after 'unpack 'fix-tests
1336 ;; cmake-build-system uses a build/ directory outside
1337 ;; of the source tree, one level higher than expected
1338 (lambda _
1339 (substitute* "test/run_tests.bash"
fccacffb
MW
1340 (("../build") "../../build"))
1341 #t)))))
af7aaaeb
TGR
1342 (home-page "https://github.com/myint/perceptualdiff")
1343 (synopsis "Perceptual image comparison utility")
1344 (description "PerceptualDiff visually compares two images to determine
1345whether they look alike. It uses a computational model of the human visual
1346system to detect similarities. This allows it too see beyond irrelevant
1347differences in file encoding, image quality, and other small variations.")
1348 (license license:gpl2+)))
1fa3e336
EB
1349
1350(define-public steghide
1351 (package
1352 (name "steghide")
1353 (version "0.5.1")
1354 (source (origin
1355 (method url-fetch)
1356 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1357 version "/steghide-" version ".tar.bz2"))
1358 (sha256
1359 (base32
1360 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1361 (patches (list (search-patch "steghide-fixes.patch")))))
1362 (build-system gnu-build-system)
1363 (native-inputs
7c90d0f4 1364 `(("gettext" ,gettext-minimal)
1fa3e336
EB
1365 ("libtool" ,libtool)
1366 ("perl" ,perl))) ;for tests
1367 (inputs
1368 `(("libmhash" ,libmhash)
1369 ("libmcrypt" ,libmcrypt)
1370 ("libjpeg" ,libjpeg)
1371 ("zlib" ,zlib)))
1372 (arguments
a56bf101
LC
1373 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1374
1375 #:phases (modify-phases %standard-phases
1376 (add-before 'configure 'set-perl-search-path
1377 (lambda _
1378 ;; Work around "dotless @INC" build failure.
1379 (setenv "PERL5LIB"
1380 (string-append (getcwd) "/tests:"
1381 (getenv "PERL5LIB")))
1382 #t)))))
1fa3e336
EB
1383 (home-page "http://steghide.sourceforge.net")
1384 (synopsis "Image and audio steganography")
1385 (description
7832785d
TGR
1386 "Steghide is a program to hide data in various kinds of image and audio
1387files (known as @dfn{steganography}). Neither color nor sample frequencies are
1388changed, making the embedding resistant against first-order statistical tests.")
1fa3e336 1389 (license license:gpl2+)))
ac2a38a5
RW
1390
1391(define-public stb-image-for-extempore
1392 (let ((revision "1")
1393 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1394 (package
1395 (name "stb-image-for-extempore")
1396 (version (string-append "0-" revision "." (string-take commit 9)))
1397 (source
1398 (origin (method git-fetch)
1399 (uri (git-reference
1400 (url "https://github.com/extemporelang/stb.git")
1401 (commit commit)))
1402 (sha256
1403 (base32
1404 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1405 (file-name (string-append name "-" version "-checkout"))))
1406 (build-system cmake-build-system)
1407 (arguments `(#:tests? #f)) ; no tests included
39162ee4
RW
1408 ;; Extempore refuses to build on architectures other than x86_64
1409 (supported-systems '("x86_64-linux"))
ac2a38a5
RW
1410 (home-page "https://github.com/extemporelang/stb")
1411 (synopsis "Image library for Extempore")
1412 (description
1413 "This package is a collection of assorted single-file libraries. Of
1414all included libraries only the image loading and decoding library is
1415installed as @code{stb_image}.")
1416 (license license:public-domain))))
93117227
AI
1417
1418(define-public optipng
1419 (package
1420 (name "optipng")
bbf8832f 1421 (version "0.7.7")
93117227
AI
1422 (source
1423 (origin
1424 (method url-fetch)
1425 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1426 version ".tar.gz"))
1427 (sha256
1428 (base32
64ed4b6a
EF
1429 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1430 (modules '((guix build utils)))
1431 (snippet
1432 '(begin
1433 (delete-file-recursively "src/libpng")
1434 (delete-file-recursively "src/zlib")
1435 #t))))
93117227
AI
1436 (build-system gnu-build-system)
1437 (inputs
64ed4b6a
EF
1438 `(("libpng" ,libpng)
1439 ("zlib" ,zlib)))
93117227
AI
1440 (arguments
1441 '(#:phases
1442 (modify-phases %standard-phases
93117227
AI
1443 (replace 'configure
1444 (lambda* (#:key outputs #:allow-other-keys)
bbf8832f
TGR
1445 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1446 (invoke "sh" "configure"
64ed4b6a
EF
1447 (string-append "--prefix=" (assoc-ref outputs "out"))
1448 "-with-system-libs")
bbf8832f
TGR
1449 #t)))))
1450 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
93117227
AI
1451 (description "OptiPNG is a PNG optimizer that recompresses image
1452files to a smaller size, without losing any information. This program
1453also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1454PNG, and performs PNG integrity checks and corrections.")
1455 (home-page "http://optipng.sourceforge.net/")
1456 (license license:zlib)))
37e05d64 1457
68fea604
VC
1458(define-public pngsuite
1459 (package
1460 (name "pngsuite")
1461 (version "2017jul19")
1462 (source
1463 (origin
1464 (method url-fetch/tarbomb)
1465 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
1466 version ".tgz"))
1467 (sha256
1468 (base32
1469 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
1470 (build-system gnu-build-system)
1471 (arguments
1472 '(#:tests? #f ; there is no test target
1473 #:license-file-regexp "PngSuite.LICENSE"
1474 #:phases
1475 (modify-phases %standard-phases
1476 (replace 'install
1477 (lambda* (#:key outputs #:allow-other-keys)
1478 (let ((out (assoc-ref outputs "out")))
1479 (copy-recursively "." (string-append out "/"))
1480 #t)))
1481 (delete 'build)
1482 (delete 'configure))))
1483 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
1484 (synopsis "Example PNGs for use in test suites")
1485 (description "Collection of graphics images created to test PNG
1486applications like viewers, converters and editors. As far as that is
1487possible, all formats supported by the PNG standard are represented.")
1488 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1489use, copy, modify and distribute these images for any purpose and without fee
1490is hereby granted."))))
1491
37e05d64
TGR
1492(define-public libjpeg-turbo
1493 (package
1494 (name "libjpeg-turbo")
ceaf1805 1495 (version "2.0.4")
37e05d64
TGR
1496 (source (origin
1497 (method url-fetch)
ec92d786
MB
1498 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1499 version "/libjpeg-turbo-" version ".tar.gz"))
37e05d64
TGR
1500 (sha256
1501 (base32
ceaf1805 1502 "01ill8bgjyk582wipx7sh7gj2nidylpbzvwhx0wkcm6mxx3qbp9k"))))
6871121b 1503 (build-system cmake-build-system)
37e05d64
TGR
1504 (native-inputs
1505 `(("nasm" ,nasm)))
1506 (arguments
6871121b
MB
1507 '(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1508 "-DENABLE_STATIC=0")))
a77de47a 1509 (home-page "https://libjpeg-turbo.org/")
37e05d64
TGR
1510 (synopsis "SIMD-accelerated JPEG image handling library")
1511 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1512JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1513x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1514its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1515a significant amount.
1516libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1517but more straightforward TurboJPEG API, and provides a full-featured Java
1518interface. It supports color space extensions that allow it to compress from
1519and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
71de61c3
MB
1520 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1521 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1522 license:ijg ;the libjpeg library and associated tools
1523 license:zlib)))) ;the libjpeg-turbo SIMD extensions
21122bd7
JD
1524
1525(define-public niftilib
1526 (package
f729a4d8
RW
1527 (name "niftilib")
1528 (version "2.0.0")
1529 (source (origin
1530 (method url-fetch)
1531 (uri (list (string-append "mirror://sourceforge/niftilib/"
1532 "nifticlib/nifticlib_"
1533 (string-join (string-split version #\.) "_")
1534 "/nifticlib-" version ".tar.gz")))
1535 (sha256
1536 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1537 (build-system gnu-build-system)
1538 (arguments
1539 '(#:tests? #f ; there is no test target
1540 #:parallel-build? #f ; not supported
1541 #:make-flags
1542 (list "SHELL=bash"
1543 (string-append "ZLIB_INC="
1544 (assoc-ref %build-inputs "zlib") "/include")
1545 ;; Append "-fPIC" to CFLAGS.
1546 (string-append "CFLAGS="
1547 "-Wall -ansi -pedantic -fPIC"))
1548 #:phases
1549 (modify-phases %standard-phases
1550 (replace 'install
1551 (lambda* (#:key outputs #:allow-other-keys)
1552 (let ((out (assoc-ref outputs "out")))
1553 (for-each
1554 (lambda (dir)
1555 (copy-recursively dir (string-append out "/" dir)))
1556 '("bin" "lib" "include")))
1557 #t))
1558 (delete 'configure))))
1559 (inputs
1560 `(("zlib" ,zlib)))
1561 (synopsis "Library for reading and writing files in the nifti-1 format")
1562 (description "Niftilib is a set of i/o libraries for reading and writing
21122bd7
JD
1563files in the nifti-1 data format - a binary file format for storing
1564medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1565(fMRI) brain images.")
f729a4d8
RW
1566 (home-page "http://niftilib.sourceforge.net")
1567 (license license:public-domain)))
f2079849
JL
1568
1569(define-public gpick
1570 (package
1571 (name "gpick")
1572 (version "0.2.5")
1573 (source (origin
94be94cf
RW
1574 (method git-fetch)
1575 (uri (git-reference
1576 (url "https://github.com/thezbyg/gpick.git")
1577 (commit (string-append name "-" version))))
1578 (file-name (git-file-name name version))
f2079849
JL
1579 (sha256
1580 (base32
94be94cf 1581 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
2235abb2 1582 (build-system scons-build-system)
f2079849
JL
1583 (native-inputs
1584 `(("boost" ,boost)
1585 ("gettext" ,gnu-gettext)
2235abb2 1586 ("pkg-config" ,pkg-config)))
f2079849
JL
1587 (inputs
1588 `(("expat" ,expat)
1589 ("gtk2" ,gtk+-2)
1590 ("lua" ,lua-5.2)))
1591 (arguments
1592 `(#:tests? #f
2235abb2
AI
1593 #:scons ,scons-python2
1594 #:scons-flags (list (string-append "DESTDIR=" %output))
f2079849
JL
1595 #:phases
1596 (modify-phases %standard-phases
1597 (add-before 'build 'fix-lua-reference
1598 (lambda _
1599 (substitute* "SConscript"
1600 (("lua5.2") "lua-5.2"))
2235abb2 1601 #t)))))
f2079849
JL
1602 (home-page "http://www.gpick.org/")
1603 (synopsis "Color picker")
1604 (description "Gpick is an advanced color picker and palette editing tool.")
1605 (license license:bsd-3)))
bc806b0c
LF
1606
1607(define-public libiptcdata
1608 (package
1609 (name "libiptcdata")
a42b6848 1610 (version "1.0.5")
bc806b0c
LF
1611 (source (origin
1612 (method url-fetch)
a42b6848
TGR
1613 (uri (string-append "https://github.com/ianw/libiptcdata"
1614 "/releases/download/release_"
1615 (string-join (string-split version #\.) "_")
1616 "/" name "-" version ".tar.gz"))
bc806b0c
LF
1617 (sha256
1618 (base32
a42b6848 1619 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
bc806b0c 1620 (build-system gnu-build-system)
a42b6848 1621 (home-page "https://github.com/ianw/libiptcdata")
bc806b0c 1622 (synopsis "IPTC metadata manipulation library")
a09a2119
TGR
1623 (description
1624 "Libiptcdata is a C library for manipulating the International Press
1625Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
bc806b0c
LF
1626such as images. This metadata can include captions and keywords, often used by
1627popular photo management applications. The library provides routines for
1628parsing, viewing, modifying, and saving this metadata.")
1629 (license license:lgpl2.0+)))
84567657
OP
1630
1631(define-public flameshot
1632 (package
1633 (name "flameshot")
1634 (version "0.5.1")
1635 (source
1636 (origin
743600e9
RW
1637 (method git-fetch)
1638 (uri (git-reference
1639 (url "https://github.com/lupoDharkael/flameshot.git")
1640 (commit (string-append "v" version))))
1641 (file-name (git-file-name name version))
84567657
OP
1642 (sha256
1643 (base32
743600e9 1644 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
84567657
OP
1645 (build-system gnu-build-system)
1646 (native-inputs
1647 `(("qttools" ,qttools)))
1648 (inputs
1649 `(("qtbase" ,qtbase)))
1650 (arguments
1651 `(#:tests? #f ; no tests
1652 #:phases
1653 (modify-phases %standard-phases
1654 (replace 'configure
1655 (lambda* (#:key outputs #:allow-other-keys)
1656 (invoke "qmake"
1657 "CONFIG+=packaging"
1658 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1659 "PREFIX=/"))))))
1660 (home-page "https://github.com/lupoDharkael/flameshot")
1661 (synopsis "Powerful yet simple to use screenshot software")
1662 (description "Flameshot is a screenshot program.
1663Features:
1664
1665@itemize
1666@item Customizable appearance.
1667@item Easy to use.
1668@item In-app screenshot edition.
1669@item DBus interface.
1670@item Upload to Imgur.
1671@end itemize\n")
1672 (license license:gpl3+)))
da4dde61 1673
0d529a7c
PN
1674(define-public gifsicle
1675 (package
1676 (name "gifsicle")
5c46e1dd 1677 (version "1.92")
0d529a7c
PN
1678 (source
1679 (origin
1680 (method url-fetch)
645b6c7f 1681 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
0d529a7c
PN
1682 version ".tar.gz"))
1683 (sha256
5c46e1dd 1684 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
0d529a7c
PN
1685 (build-system gnu-build-system)
1686 (arguments
1687 '(#:phases
1688 (modify-phases %standard-phases
1689 (add-before 'check 'patch-tests
1690 (lambda _
1691 (substitute* "test/testie"
1692 (("/usr/bin/perl")
1693 (which "perl"))
1694 (("/bin/sh")
1695 (which "sh"))
1696 (("/bin/rm")
1697 (which "rm")))
1698 #t)))))
5c46e1dd 1699 (native-inputs `(("perl" ,perl))) ; only for tests
0d529a7c 1700 (inputs `(("libx11" ,libx11)))
645b6c7f 1701 (home-page "https://www.lcdf.org/gifsicle/")
0d529a7c
PN
1702 (synopsis "Edit GIF images and animations")
1703 (description "Gifsicle is a command-line GIF image manipulation tool that:
1704
1705@itemize
1706@item Provides a batch mode for changing GIFs in place.
1707@item Prints detailed information about GIFs, including comments.
1708@item Control over interlacing, comments, looping, transparency, etc.
1709@item Creates well-behaved GIFs: removes redundant colors, only uses local color
1710tables, etc.
1711@item Shrinks colormaps and change images to use the Web-safe palette.
1712@item Optimizes GIF animations, or unoptimizes them for easier editing.
1713@end itemize
1714
1715Two other programs are included with Gifsicle: @command{gifview} is a
1716lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1717identical visual appearance.")
1718 (license license:gpl2+)))
3239dcd3 1719
dc7e5783 1720;; 1.0.7 is buggy and reverted in git repository.
3239dcd3
PAR
1721(define-public jp2a
1722 (package
1723 (name "jp2a")
dc7e5783 1724 (version "1.0.6")
3239dcd3
PAR
1725 (source
1726 (origin
dc7e5783
EF
1727 (method url-fetch)
1728 (uri (string-append "mirror://debian/pool/main/j/jp2a/jp2a_"
1729 version ".orig.tar.gz"))
1730 (sha256
1731 (base32
1732 "076frk3pa16s4r1b10zgy81vdlz0385zh3ykbnkaij25jn5aqc09"))))
3239dcd3
PAR
1733 (build-system gnu-build-system)
1734 (inputs
dc7e5783
EF
1735 `(("curl" ,curl)
1736 ("libjpeg" ,libjpeg)
1737 ("ncurses" ,ncurses)))
3239dcd3
PAR
1738 (home-page "https://csl.name/jp2a/")
1739 (synopsis "Convert JPEG images to ASCII")
1740 (description
1741 "Jp2a is a small utility that converts JPEG images to ASCII.")
1742 (license license:gpl2)))
0290f533
RH
1743
1744(define-public grim
1745 (package
444c4c08 1746 (name "grim")
501d4b33 1747 (version "1.2.0")
444c4c08
RH
1748 (source
1749 (origin
90c7ea44
TGR
1750 (method git-fetch)
1751 (uri (git-reference
1752 (url "https://github.com/emersion/grim.git")
1753 (commit (string-append "v" version))))
1754 (file-name (git-file-name name version))
444c4c08 1755 (sha256
501d4b33 1756 (base32 "0brljl4zfbn5mh9hkfrfkvd27c5y9vdkgap9r1hrfy9r1x20sskn"))))
444c4c08
RH
1757 (build-system meson-build-system)
1758 (native-inputs `(("pkg-config" ,pkg-config)))
1759 (inputs `(("cairo" ,cairo)
1760 ("libjpeg-turbo" ,libjpeg-turbo)
1761 ("scdoc" ,scdoc)
1762 ("wayland" ,wayland)
1763 ("wayland-protocols" ,wayland-protocols)))
1764 (home-page "https://github.com/emersion/grim")
1765 (synopsis "Create screenshots from a Wayland compositor")
1766 (description "grim can create screenshots from a Wayland compositor.")
1767 ;; MIT license.
1768 (license license:expat)))
bd86a1be
RH
1769
1770(define-public slurp
1771 (package
1772 (name "slurp")
7d5113e5 1773 (version "1.2.0")
bd86a1be
RH
1774 (source
1775 (origin
1776 (method git-fetch)
1777 (uri (git-reference
1778 (url "https://github.com/emersion/slurp.git")
1779 (commit (string-append "v" version))))
1780 (file-name (git-file-name name version))
1781 (sha256
7d5113e5 1782 (base32 "0580m6kaiilgsrcj608r837r37sl6a25y7w21p7d6ij20fs3gvg1"))))
bd86a1be
RH
1783 (build-system meson-build-system)
1784 (native-inputs `(("pkg-config" ,pkg-config)))
1785 (inputs `(("cairo" ,cairo)
1786 ("scdoc" ,scdoc)
1787 ("wayland" ,wayland)
1788 ("wayland-protocols" ,wayland-protocols)))
1789 (home-page "https://github.com/emersion/slurp")
1790 (synopsis "Select a region in a Wayland compositor")
1791 (description "Slurp can select a region in a Wayland compositor and print it
1792to the standard output. It works well together with grim.")
1793 ;; MIT license.
1794 (license license:expat)))
d54ca1cd
VC
1795
1796(define-public sng
1797 (package
1798 (name "sng")
1799 (version "1.1.0")
1800 (source
1801 (origin
1802 (method url-fetch)
1803 (uri (string-append "mirror://sourceforge/sng/sng-"
1804 version ".tar.gz"))
1805 (sha256
1806 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
1807 (build-system gnu-build-system)
1808 (arguments
1809 `(#:phases
1810 (modify-phases %standard-phases
1811 (add-before 'check 'link-pngsuite
1812 ;; tests expect pngsuite in source dir
1813 (lambda* (#:key inputs #:allow-other-keys)
1814 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
1815 #t)))
1816 #:configure-flags
1817 (list (string-append "--with-rgbtxt="
1818 (assoc-ref %build-inputs "xorg-rgb")
1819 "/share/X11/rgb.txt"))))
1820 (inputs `(("xorg-rgb" ,xorg-rgb)
1821 ("libpng" ,libpng)))
1822 (native-inputs `(("pngsuite" ,pngsuite)))
1823 (home-page "http://sng.sourceforge.net")
1824 (synopsis "Markup language for representing PNG contents")
1825 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
1826specifically to represent the entire contents of a PNG (Portable Network
1827Graphics) file in an editable form. Thus, SNGs representing elaborate
1828graphics images and ancillary chunk data can be readily generated or modified
1829using only text tools.
1830
1831SNG is implemented by a compiler/decompiler called sng that
1832losslessly translates between SNG and PNG.")
1833 (license license:zlib)))