gnu: webkitgtk: Update to 2.28.2.
[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>
fecd608f 10;;; Copyright © 2016, 2017, 2018, 2020 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>
14138912 17;;; Copyright © 2017,2019,2020 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>
0fa9f29a 22;;; Copyright © 2018, 2019 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>
7eed5845 26;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
95b800e6 27;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
e55354b8
DT
28;;;
29;;; This file is part of GNU Guix.
30;;;
31;;; GNU Guix is free software; you can redistribute it and/or modify it
32;;; under the terms of the GNU General Public License as published by
33;;; the Free Software Foundation; either version 3 of the License, or (at
34;;; your option) any later version.
35;;;
36;;; GNU Guix is distributed in the hope that it will be useful, but
37;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39;;; GNU General Public License for more details.
40;;;
41;;; You should have received a copy of the GNU General Public License
42;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
43
44(define-module (gnu packages image)
45 #:use-module (gnu packages)
97039f6e 46 #:use-module (gnu packages algebra)
37e05d64 47 #:use-module (gnu packages assembly)
894e2cba 48 #:use-module (gnu packages autotools)
95b800e6 49 #:use-module (gnu packages base)
97039f6e 50 #:use-module (gnu packages boost)
ac257f12 51 #:use-module (gnu packages check)
3239dcd3 52 #:use-module (gnu packages curl)
e55354b8 53 #:use-module (gnu packages compression)
99828fa7 54 #:use-module (gnu packages documentation)
efa77baf 55 #:use-module (gnu packages fontutils)
0290f533 56 #:use-module (gnu packages freedesktop)
1fa3e336 57 #:use-module (gnu packages gettext)
97039f6e 58 #:use-module (gnu packages ghostscript)
060ad3de 59 #:use-module (gnu packages gl)
023f0fb0 60 #:use-module (gnu packages glib)
ced7cc92 61 #:use-module (gnu packages graphics)
f2079849
JL
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages lua)
0290f533 64 #:use-module (gnu packages man)
97039f6e 65 #:use-module (gnu packages maths)
1fa3e336 66 #:use-module (gnu packages mcrypt)
115ace6b 67 #:use-module (gnu packages mp3)
dc7e5783 68 #:use-module (gnu packages ncurses)
97039f6e 69 #:use-module (gnu packages perl)
a5d4c96b 70 #:use-module (gnu packages photo)
efa77baf 71 #:use-module (gnu packages pkg-config)
97039f6e 72 #:use-module (gnu packages python)
44d10b1f 73 #:use-module (gnu packages python-xyz)
14138912 74 #:use-module (gnu packages qt)
9d0c291e 75 #:use-module (gnu packages sphinx)
fecd608f 76 #:use-module (gnu packages video)
14138912 77 #:use-module (gnu packages web)
efa77baf 78 #:use-module (gnu packages xml)
76d88cfa 79 #:use-module (gnu packages xorg)
b5b73a82 80 #:use-module ((guix licenses) #:prefix license:)
e55354b8
DT
81 #:use-module (guix packages)
82 #:use-module (guix download)
ac2a38a5 83 #:use-module (guix git-download)
38c55e5c 84 #:use-module (guix build-system gnu)
e596ab0f 85 #:use-module (guix build-system cmake)
0290f533 86 #:use-module (guix build-system meson)
f2079849 87 #:use-module (guix build-system python)
2235abb2 88 #:use-module (guix build-system scons)
e596ab0f 89 #:use-module (srfi srfi-1))
e55354b8
DT
90
91(define-public libpng
92 (package
93 (name "libpng")
8b5b3aca 94 (version "1.6.37")
e55354b8
DT
95 (source (origin
96 (method url-fetch)
a2f3c614 97 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
21ef9843
MW
98 version "/libpng-" version ".tar.xz")
99 (string-append
100 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
913059a1
EF
101 "/libpng16/libpng-" version ".tar.xz")
102 (string-append
103 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
104 "/libpng16/libpng-" version ".tar.xz")))
e55354b8 105 (sha256
8fda37bc 106 (base32
8b5b3aca 107 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
e55354b8 108 (build-system gnu-build-system)
420b0137
MB
109 (arguments
110 `(#:configure-flags '("--disable-static")))
e55354b8
DT
111
112 ;; libpng.la says "-lz", so propagate it.
113 (propagated-inputs `(("zlib" ,zlib)))
114
115 (synopsis "Library for handling PNG files")
116 (description
117 "Libpng is the official PNG (Portable Network Graphics) reference
35b9e423 118library. It supports almost all PNG features and is extensible.")
e55354b8
DT
119 (license license:zlib)
120 (home-page "http://www.libpng.org/pub/png/libpng.html")))
121
e0958c2d 122;; libpng-apng should be updated when the APNG patch is released:
123;; <https://bugs.gnu.org/27556>
114a325e 124(define-public libpng-apng
125 (package
114a325e 126 (name "libpng-apng")
e0958c2d 127 (version "1.6.28")
128 (source
129 (origin
130 (method url-fetch)
131 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
132 version "/libpng-" version ".tar.xz")
133 (string-append
134 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
135 "/libpng16/libpng-" version ".tar.xz")
136 (string-append
137 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
138 "/libpng16/libpng-" version ".tar.xz")))
139 (sha256
140 (base32
141 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
142 (build-system gnu-build-system)
114a325e 143 (arguments
696f1d0f
LF
144 `(#:modules ((guix build gnu-build-system)
145 (guix build utils)
146 (srfi srfi-1))
147 #:phases
114a325e 148 (modify-phases %standard-phases
149 (add-after 'unpack 'patch-apng
150 (lambda* (#:key inputs #:allow-other-keys)
151 (define (apply-patch file)
fccacffb
MW
152 (invoke "patch" "-p1" "--force"
153 "--input" file))
114a325e 154 (let ((apng.gz (assoc-ref inputs "apng")))
155 (format #t "Applying APNG patch '~a'...~%"
156 apng.gz)
fccacffb
MW
157 (invoke "sh" "-c"
158 (string-append "gunzip < " apng.gz " > the-patch"))
159 (apply-patch "the-patch")
160 #t)))
114a325e 161 (add-before 'configure 'no-checks
162 (lambda _
163 (substitute* "Makefile.in"
164 (("^scripts/symbols.chk") "")
165 (("check: scripts/symbols.chk") ""))
114a325e 166 #t)))))
167 (inputs
168 `(("apng" ,(origin
169 (method url-fetch)
170 (uri
171 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
172 version "/libpng-" version "-apng.patch.gz"))
173 (sha256
174 (base32
e0958c2d 175 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
114a325e 176 (native-inputs
177 `(("libtool" ,libtool)))
e0958c2d 178 ;; libpng.la says "-lz", so propagate it.
179 (propagated-inputs
180 `(("zlib" ,zlib)))
114a325e 181 (synopsis "APNG patch for libpng")
182 (description
183 "APNG (Animated Portable Network Graphics) is an unofficial
184extension of the APNG (Portable Network Graphics) format.
185APNG patch provides APNG support to libpng.")
e0958c2d 186 (home-page "https://sourceforge.net/projects/libpng-apng/")
187 (license license:zlib)))
114a325e 188
2df831a7
RW
189(define-public libpng-1.2
190 (package
191 (inherit libpng)
6cdd8c97 192 (version "1.2.59")
2df831a7
RW
193 (source
194 (origin
195 (method url-fetch)
2df831a7
RW
196 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
197 version "/libpng-" version ".tar.xz")
198 (string-append
199 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
913059a1
EF
200 "/libpng12/libpng-" version ".tar.xz")
201 (string-append
202 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
2df831a7
RW
203 "/libpng12/libpng-" version ".tar.xz")))
204 (sha256
6cdd8c97
LF
205 (base32
206 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
2df831a7 207
1ee13e01 208(define-public pngcrush
2f8b9c46 209 (package
1ee13e01 210 (name "pngcrush")
211 (version "1.8.13")
2f8b9c46
HG
212 (source (origin
213 (method url-fetch)
214 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
1ee13e01 215 version "/pngcrush-" version "-nolib.tar.xz"))
2f8b9c46 216 (sha256 (base32
1ee13e01 217 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
2f8b9c46
HG
218 (build-system gnu-build-system)
219 (arguments
1ee13e01 220 '(#:tests? #f ; no check target
2f8b9c46
HG
221 #:phases
222 (modify-phases %standard-phases
223 (replace 'configure
224 (lambda* (#:key inputs outputs #:allow-other-keys)
1ee13e01 225 (substitute* "Makefile"
2f8b9c46
HG
226 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
227 (string-append vardef (assoc-ref inputs "libpng") "/"))
228 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
229 (string-append vardef (assoc-ref inputs "zlib") "/"))
230 ;; The Makefile is written by hand and not using $PREFIX
231 (("\\$\\(DESTDIR\\)/usr/")
fccacffb
MW
232 (string-append (assoc-ref outputs "out") "/")))
233 #t)))))
2f8b9c46
HG
234 (inputs
235 `(("libpng" ,libpng)
236 ("zlib" , zlib)))
1ee13e01 237 (home-page "https://pmt.sourceforge.io/pngcrush")
2f8b9c46 238 (synopsis "Utility to compress PNG files")
85a4531f
AB
239 (description "Pngcrush optimizes @acronym{PNG, Portable Network Graphics}
240images. It can further losslessly compress them by as much as 40%.")
2f8b9c46
HG
241 (license license:zlib)))
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")
3f2848a5 547 (version "4.0.10")
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
3f2848a5 555 "1r4np635gr6zlc0bic38dzvxia6iqzcrary4n1ylarzpr8fd2lic"))))
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/"
564 ,name "-" ,version))))
e55354b8 565 (inputs `(("zlib" ,zlib)
1de0afd5 566 ("libjpeg" ,libjpeg)))
35b9e423 567 (synopsis "Library for handling TIFF files")
e55354b8
DT
568 (description
569 "Libtiff provides support for the Tag Image File Format (TIFF), a format
570used for storing image data.
571Included are a library, libtiff, for reading and writing TIFF and a small
572collection of tools for doing simple manipulations of TIFF images.")
166191b3
LC
573 (license (license:non-copyleft "file://COPYRIGHT"
574 "See COPYRIGHT in the distribution."))
0bd1097c 575 (home-page "http://www.simplesystems.org/libtiff/")))
ed5940b6 576
894e2cba
TUBK
577(define-public leptonica
578 (package
579 (name "leptonica")
340502ba 580 (version "1.74.4")
894e2cba
TUBK
581 (source
582 (origin
69f7d3f4
RW
583 (method git-fetch)
584 (uri (git-reference
585 (url "https://github.com/DanBloomberg/leptonica.git")
586 (commit version)))
587 (file-name (git-file-name name version))
894e2cba 588 (sha256
69f7d3f4 589 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
894e2cba
TUBK
590 (build-system gnu-build-system)
591 (native-inputs
d02fb7ce
TUBK
592 `(("gnuplot" ,gnuplot) ;needed for test suite
593 ("autoconf" ,autoconf)
594 ("automake" ,automake)
595 ("libtool" ,libtool)
596 ("pkg-config" ,pkg-config)))
894e2cba
TUBK
597 (inputs
598 `(("giflib" ,giflib)
599 ("libjpeg" ,libjpeg)
600 ("libpng" ,libpng)
601 ("libtiff" ,libtiff)
602 ("libwebp" ,libwebp)))
603 (propagated-inputs
d02fb7ce 604 ;; Linking a program with leptonica also requires these.
894e2cba
TUBK
605 `(("openjpeg" ,openjpeg)
606 ("zlib" ,zlib)))
607 (arguments
d02fb7ce 608 '(#:phases
894e2cba 609 (modify-phases %standard-phases
d02fb7ce
TUBK
610 (add-after 'unpack 'patch-reg-wrapper
611 (lambda _
612 (substitute* "prog/reg_wrapper.sh"
613 ((" /bin/sh ")
614 (string-append " " (which "sh") " "))
615 (("which gnuplot")
fccacffb
MW
616 "true"))
617 #t)))))
894e2cba
TUBK
618 (home-page "http://www.leptonica.com/")
619 (synopsis "Library and tools for image processing and analysis")
620 (description
621 "Leptonica is a C library and set of command-line tools for efficient
622image processing and image analysis operations. It supports rasterop, affine
623transformations, binary and grayscale morphology, rank order, and convolution,
624seedfill and connected components, image transformations combining changes in
625scale and pixel depth, and pixelwise masking, blending, enhancement, and
626arithmetic ops.")
627 (license license:bsd-2)))
628
8d9872b5
MB
629(define-public jbig2dec
630 (package
631 (name "jbig2dec")
b70ffe4e 632 (version "0.16")
fb94354a
MB
633 (source (origin
634 (method url-fetch)
635 (uri (string-append "https://github.com/ArtifexSoftware"
636 "/ghostpdl-downloads/releases/download"
b70ffe4e 637 "/gs927/" name "-" version ".tar.gz"))
fb94354a
MB
638 (sha256
639 (base32
b70ffe4e 640 "00h61y7bh3z6mqfzxyb318gyh0f8jwarg4hvlrm83rqps8avzxm4"))
fb94354a 641 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
8d9872b5 642 (build-system gnu-build-system)
5e537222 643 (arguments '(#:configure-flags '("--disable-static")))
8d9872b5
MB
644 (synopsis "Decoder of the JBIG2 image compression format")
645 (description
36a4366d 646 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
7c125ce0
AK
647monochrome) images at moderately high resolution, and in particular scanned
648paper documents. In this domain it is very efficient, offering compression
649ratios on the order of 100:1.
8d9872b5
MB
650
651This is a decoder only implementation, and currently is in the alpha
652stage, meaning it doesn't completely work yet. However, it is
653maintaining parity with available encoders, so it is useful for real
654work.")
6acc671b 655 (home-page "https://jbig2dec.com")
8d9872b5 656 (license license:gpl2+)))
38c55e5c 657
8f685df2
TGR
658(define-public jbigkit
659 (package
660 (name "jbigkit")
661 (version "2.1")
662 (source
663 (origin
664 (method url-fetch)
665 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
666 "download/jbigkit-" version ".tar.gz"))
667 (sha256
668 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
669 (modules '((guix build utils)))
670 (snippet
671 '(begin
672 ;; Remove files without clear licence information.
673 (for-each delete-file-recursively
674 (list "contrib" "examples"))
675 #t))))
676 (build-system gnu-build-system)
677 (outputs (list "out" "pbmtools"))
678 (arguments
679 `(#:modules ((srfi srfi-26)
680 ,@%gnu-build-system-modules)
681 #:phases
682 (modify-phases %standard-phases
683 (delete 'configure) ; no configure script
684 (replace 'install ; no ‘make install’ target
685 (lambda* (#:key outputs #:allow-other-keys)
686 (let* ((out (assoc-ref outputs "out"))
687 (lib (string-append out "/lib"))
688 (include (string-append out "/include")))
689 (with-directory-excursion "libjbig"
690 (for-each (cut install-file <> include)
691 (find-files "." "\\.h$"))
692 (for-each (cut install-file <> lib)
693 (find-files "." "\\.a$")))
694 #t)))
695 (add-after 'install 'install-pbmtools
696 (lambda* (#:key outputs #:allow-other-keys)
697 (let* ((out (assoc-ref outputs "pbmtools"))
698 (bin (string-append out "/bin"))
699 (man1 (string-append out "/share/man/man1"))
700 (man5 (string-append out "/share/man/man5")))
701 (with-directory-excursion "pbmtools"
702 (for-each (cut install-file <> bin)
703 (list "jbgtopbm" "jbgtopbm85"
704 "pbmtojbg" "pbmtojbg85"))
705
706 (for-each (cut install-file <> man1)
707 (find-files "." "\\.1$"))
708 (for-each (cut install-file <> man5)
709 (find-files "." "\\.5$"))
710 #t)))))
711 #:test-target "test"
712 #:tests? #f)) ; tests depend on examples/
713 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
714 (synopsis "Lossless compression for bi-level high-resolution images")
715 (description
716 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
717ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
718black-and-white scanned documents. It is widely used in fax products, printer
719firmware and drivers, document management systems, and imaging software.
720
721This package provides a static C library of (de)compression functions and some
722simple command-line converters similar to those provided by netpbm.
723
724Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
725options of the standard but has to keep the full uncompressed image in memory.
726The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
727memory management optimized for embedded and fax applications. It buffers
728only a few lines of the uncompressed image in memory and is able to stream
729images of initially unknown height.")
730 (license (list license:isc ; pbmtools/p?m.5
731 license:gpl2+)))) ; the rest
732
38c55e5c
MB
733(define-public openjpeg
734 (package
735 (name "openjpeg")
de1b5e49
MB
736 (version "2.3.1")
737 (source (origin
738 (method git-fetch)
739 (uri (git-reference
740 (url "https://github.com/uclouvain/openjpeg")
741 (commit (string-append "v" version))))
742 (file-name (git-file-name "openjpeg" version))
743 (sha256
744 (base32
745 "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb"))))
38c55e5c
MB
746 (build-system cmake-build-system)
747 (arguments
8de1979d
MB
748 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
749 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
38c55e5c
MB
750 (inputs
751 `(("lcms" ,lcms)
752 ("libpng" ,libpng)
753 ("libtiff" ,libtiff)
754 ("zlib" ,zlib)))
755 (synopsis "JPEG 2000 codec")
756 (description
757 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
758been developed in order to promote the use of JPEG 2000, the new
759still-image compression standard from the Joint Photographic Experts
760Group (JPEG).
761
762In addition to the basic codec, various other features are under
763development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
764an indexing tool useful for the JPIP protocol, JPWL-tools for
765error-resilience, a Java-viewer for j2k-images, ...")
b9270582 766 (home-page "https://github.com/uclouvain/openjpeg")
38c55e5c 767 (license license:bsd-2)))
76d88cfa 768
6140b9d8
RW
769(define-public openjpeg-1
770 (package (inherit openjpeg)
771 (name "openjpeg")
772 (version "1.5.2")
773 (source
774 (origin
775 (method url-fetch)
776 (uri
de67e922
LF
777 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
778 name "-" version ".tar.gz"))
6140b9d8
RW
779 (sha256
780 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
781
e596ab0f
AK
782(define-public giflib
783 (package
784 (name "giflib")
3fdb2a84 785 (version "5.1.4")
e596ab0f
AK
786 (source (origin
787 (method url-fetch)
788 (uri (string-append "mirror://sourceforge/giflib/giflib-"
de67e922 789 version ".tar.bz2"))
e596ab0f 790 (sha256
44c5f025 791 (base32
7ac43c44
HG
792 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))
793 (patches (search-patches
794 "giflib-make-reallocarray-private.patch"))))
e596ab0f
AK
795 (build-system gnu-build-system)
796 (outputs '("bin" ; utility programs
797 "out")) ; library
798 (inputs `(("libx11" ,libx11)
799 ("libice" ,libice)
800 ("libsm" ,libsm)
801 ("perl" ,perl)))
802 (arguments
44c5f025
EF
803 `(#:phases
804 (modify-phases %standard-phases
805 (add-after 'unpack 'disable-html-doc-gen
806 (lambda _
807 (substitute* "doc/Makefile.in"
4a3ee3fb
MW
808 (("^all: allhtml manpages") ""))
809 #t))
44c5f025
EF
810 (add-after 'install 'install-manpages
811 (lambda* (#:key outputs #:allow-other-keys)
812 (let* ((bin (assoc-ref outputs "bin"))
813 (man1dir (string-append bin "/share/man/man1")))
814 (mkdir-p man1dir)
815 (for-each (lambda (file)
816 (let ((base (basename file)))
817 (format #t "installing `~a' to `~a'~%"
818 base man1dir)
819 (copy-file file
820 (string-append
821 man1dir "/" base))))
4a3ee3fb
MW
822 (find-files "doc" "\\.1"))
823 #t))))))
e596ab0f
AK
824 (synopsis "Tools and library for working with GIF images")
825 (description
35b9e423 826 "GIFLIB is a library for reading and writing GIF images. It is API and
e596ab0f
AK
827ABI compatible with libungif which was in wide use while the LZW compression
828algorithm was patented. Tools are also included to convert, manipulate,
829compose, and analyze GIF images.")
830 (home-page "http://giflib.sourceforge.net/")
831 (license license:x11)))
832
0731a47c
TUBK
833(define-public libungif
834 (package
835 (name "libungif")
836 (version "4.1.4")
837 (source (origin
838 (method url-fetch)
de67e922
LF
839 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
840 "libungif-" version "/libungif-"
0731a47c
TUBK
841 version ".tar.bz2"))
842 (sha256
843 (base32
844 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
845 (build-system gnu-build-system)
846 (inputs `(("perl" ,perl))) ;package ships some perl tools
847 (home-page "http://giflib.sourceforge.net/")
848 (synopsis "GIF decompression library")
849 (description
850 "libungif is the old GIF decompression library by the GIFLIB project.")
851 (license license:expat)))
852
76d88cfa
AK
853(define-public imlib2
854 (package
855 (name "imlib2")
c45fdf90 856 (version "1.6.1")
76d88cfa
AK
857 (source (origin
858 (method url-fetch)
859 (uri (string-append
de67e922
LF
860 "mirror://sourceforge/enlightenment/imlib2-src/" version
861 "/imlib2-" version ".tar.bz2"))
76d88cfa
AK
862 (sha256
863 (base32
c45fdf90 864 "0v8n3dswx7rxqfd0q03xwc7j2w1mv8lv18rdxv487a1xw5vklfad"))))
76d88cfa 865 (build-system gnu-build-system)
76d88cfa
AK
866 (native-inputs
867 `(("pkgconfig" ,pkg-config)))
868 (inputs
e56d02a0 869 `(("bzip2" ,bzip2)
76d88cfa 870 ("freetype" ,freetype)
e56d02a0
EF
871 ("giflib" ,giflib)
872 ("libid3tag" ,libid3tag)
76d88cfa
AK
873 ("libjpeg" ,libjpeg)
874 ("libpng" ,libpng)
875 ("libtiff" ,libtiff)
e56d02a0
EF
876 ("libx11" ,libx11)
877 ("libxext" ,libxext)
878 ("libwebp" ,libwebp)))
3b3b60d0 879 (home-page "https://sourceforge.net/projects/enlightenment/")
76d88cfa
AK
880 (synopsis
881 "Loading, saving, rendering and manipulating image files")
882 (description
883 "Imlib2 is a library that does image file loading and saving as well as
884rendering, manipulation, arbitrary polygon support, etc.
885
886It does ALL of these operations FAST. Imlib2 also tries to be highly
887intelligent about doing them, so writing naive programs can be done easily,
888without sacrificing speed.
889
890This is a complete rewrite over the Imlib 1.x series. The architecture is
891more modular, simple, and flexible.")
8835aed4 892 (license license:imlib2)))
f7d28082
AK
893
894(define-public giblib
895 (package
896 (name "giblib")
897 (version "1.2.4")
898 (source (origin
899 (method url-fetch)
bf512da1
EF
900 (uri (list
901 (string-append
902 "http://linuxbrit.co.uk/downloads/giblib-"
903 version ".tar.gz")
904 (string-append
1a045954
TGR
905 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
906 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
907 version ".tar.gz")
908 (string-append
bf512da1
EF
909 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
910 "files/giblib/giblib-" version ".tar.gz")))
f7d28082
AK
911 (sha256
912 (base32
913 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
914 (build-system gnu-build-system)
915 (inputs
916 `(("libx11" ,libx11)
917 ("imlib2" ,imlib2)))
30e8cf5f
TGR
918 (home-page
919 ;; This vanished page is universally accepted as giblib's home despite not
920 ;; mentioning the package once.
921 (string-append "https://web.archive.org/web/20140907071208"
922 "https://linuxbrit.co.uk/software/"))
f7d28082
AK
923 (synopsis "Wrapper library for imlib2")
924 (description
35b9e423 925 "Giblib is a simple library which wraps imlib2's context API, avoiding
f7d28082
AK
926all the context_get/set calls, adds fontstyles to the truetype renderer and
927supplies a generic doubly-linked list and some string functions.")
928 ;; This license removes a clause about X Consortium from the original
929 ;; X11 license.
930 (license (license:x11-style "file://COPYING"
931 "See 'COPYING' in the distribution."))))
43402c5c
DT
932
933(define-public freeimage
934 (package
935 (name "freeimage")
8dc3c2a7 936 (version "3.18.0")
43402c5c
DT
937 (source (origin
938 (method url-fetch)
939 (uri (string-append
940 "mirror://sourceforge/freeimage/Source%20Distribution/"
941 version "/FreeImage"
bcc09d9a 942 (string-concatenate (string-split version #\.))
43402c5c
DT
943 ".zip"))
944 (sha256
945 (base32
8dc3c2a7 946 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
a5d4c96b
EF
947 (modules '((guix build utils)))
948 (snippet
949 '(begin
950 (for-each
951 (lambda (dir)
952 (delete-file-recursively (string-append "Source/" dir)))
f347c24a 953 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
8dc3c2a7
KK
954 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
955 (patches (search-patches "freeimage-unbundle.patch"))))
43402c5c
DT
956 (build-system gnu-build-system)
957 (arguments
4a2798e0
EF
958 '(#:phases
959 (modify-phases %standard-phases
a5d4c96b
EF
960 ;; According to Fedora these files depend on private headers, but their
961 ;; presence is required for building, so we replace them with empty files.
962 (add-after 'unpack 'delete-unbuildable-files
963 (lambda _
964 (for-each (lambda (file)
965 (delete-file file)
966 (close (open file O_CREAT)))
967 '("Source/FreeImage/PluginG3.cpp"
968 "Source/FreeImageToolkit/JPEGTransform.cpp"))
969 #t))
970 ;; These scripts generate the Makefiles.
971 (replace 'configure
972 (lambda _
973 (invoke "sh" "gensrclist.sh")
974 (invoke "sh" "genfipsrclist.sh")))
4a2798e0
EF
975 (add-before 'build 'patch-makefile
976 (lambda* (#:key outputs #:allow-other-keys)
977 (substitute* "Makefile.gnu"
978 (("/usr") (assoc-ref outputs "out"))
979 (("-o root -g root") ""))
980 #t)))
a5d4c96b
EF
981 #:make-flags
982 (list "CC=gcc"
983 ;; We need '-fpermissive' for Source/FreeImage.h.
984 ;; libjxr doesn't have a pkg-config file.
985 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
0fe041bd 986 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
43402c5c
DT
987 #:tests? #f)) ; no check target
988 (native-inputs
a5d4c96b
EF
989 `(("pkg-config" ,pkg-config)
990 ("unzip" ,unzip)))
991 (inputs
992 `(("libjpeg" ,libjpeg)
8dc3c2a7 993 ("libjxr" ,libjxr)
a5d4c96b
EF
994 ("libpng" ,libpng)
995 ("libraw" ,libraw)
996 ("libtiff" ,libtiff)
997 ("libwebp" ,libwebp)
998 ("openexr" ,openexr)
999 ("openjpeg" ,openjpeg)
1000 ("zlib" ,zlib)))
43402c5c
DT
1001 (synopsis "Library for handling popular graphics image formats")
1002 (description
1003 "FreeImage is a library for developers who would like to support popular
1004graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1005 (license license:gpl2+)
1006 (home-page "http://freeimage.sourceforge.net")))
97039f6e
AE
1007
1008(define-public vigra
019b3875
AE
1009 (package
1010 (name "vigra")
83273596 1011 (version "1.11.1")
019b3875
AE
1012 (source
1013 (origin
1014 (method url-fetch)
1015 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
83273596
MB
1016 "Version-" (string-join (string-split version #\.) "-")
1017 "/vigra-" version "-src.tar.gz"))
019b3875 1018 (sha256 (base32
83273596 1019 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
019b3875
AE
1020 (build-system cmake-build-system)
1021 (inputs
1022 `(("boost" ,boost)
1023 ("fftw" ,fftw)
1024 ("fftwf" ,fftwf)
1025 ("hdf5" ,hdf5)
1026 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
1027 ; to create a configure-flag
1028 ("libjpeg" ,libjpeg)
1029 ("libpng" ,libpng)
1030 ("libtiff" ,libtiff)
1031 ("openexr" ,openexr)
1032 ("python" ,python-2) ; print syntax
1033 ("python2-numpy" ,python2-numpy)
1034 ("zlib" ,zlib)))
1035 (native-inputs
1036 `(("doxygen" ,doxygen)
1037 ("python2-nose" ,python2-nose)
556530c9 1038 ("sphinx" ,python-sphinx)))
019b3875
AE
1039 (arguments
1040 `(#:test-target "check"
e32db0fa
RW
1041 #:phases
1042 (modify-phases %standard-phases
43696990 1043 (add-after 'unpack 'disable-broken-tests
e32db0fa 1044 (lambda _
43696990 1045 ;; See https://github.com/ukoethe/vigra/issues/432
e32db0fa
RW
1046 (substitute* "test/fourier/CMakeLists.txt"
1047 (("VIGRA_ADD_TEST.*") ""))
43696990
MB
1048 ;; This test fails with Numpy 1.15:
1049 ;; <https://github.com/ukoethe/vigra/issues/436>.
1050 (substitute* "vigranumpy/test/CMakeLists.txt"
1051 (("test1\\.py") ""))
e32db0fa 1052 #t)))
019b3875
AE
1053 #:configure-flags
1054 (list "-Wno-dev" ; suppress developer mode with lots of warnings
1055 (string-append "-DVIGRANUMPY_INSTALL_DIR="
1056 (assoc-ref %outputs "out")
1057 "/lib/python2.7/site-packages")
1058 ;; OpenEXR is not enabled by default.
1059 "-DWITH_OPENEXR=1"
f803f775
LF
1060 ;; Fix rounding error on 32-bit machines
1061 "-DCMAKE_C_FLAGS=-ffloat-store"
019b3875
AE
1062 ;; The header files of ilmbase are not found when included
1063 ;; by the header files of openexr, and an explicit flag
1064 ;; needs to be set.
1065 (string-append "-DCMAKE_CXX_FLAGS=-I"
1066 (assoc-ref %build-inputs "ilmbase")
f803f775
LF
1067 "/include/OpenEXR"
1068 " -ffloat-store"))))
019b3875
AE
1069 (synopsis "Computer vision library")
1070 (description
1071 "VIGRA stands for Vision with Generic Algorithms. It is an image
97039f6e
AE
1072processing and analysis library that puts its main emphasis on customizable
1073algorithms and data structures. It is particularly strong for
1074multi-dimensional image processing.")
019b3875 1075 (license license:expat)
83273596 1076 (home-page "https://ukoethe.github.io/vigra/")))
060ad3de 1077
62813c10 1078(define-public vigra-c
4526bd07
RW
1079 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1080 (revision "1"))
62813c10
FT
1081 (package
1082 (name "vigra-c")
4526bd07 1083 (version (git-version "0.0.0" revision commit))
62813c10
FT
1084 (home-page "https://github.com/BSeppke/vigra_c")
1085 (source (origin
1086 (method git-fetch)
1087 (uri (git-reference
1088 (url home-page)
1089 (commit commit)))
1090 (sha256
1091 (base32
4526bd07 1092 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
62813c10
FT
1093 (file-name (git-file-name name version))))
1094 (build-system cmake-build-system)
1095 (arguments
1096 `(#:tests? #f)) ; No test target.
1097 (native-inputs
1098 `(("doxygen" ,doxygen)))
1099 (inputs
1100 `(("fftw" ,fftw)
1101 ("fftwf" ,fftwf)
4526bd07 1102 ("hdf5" ,hdf5)
62813c10
FT
1103 ("vigra" ,vigra)))
1104 (synopsis "C interface to the VIGRA computer vision library")
1105 (description
1106 "This package provides a C interface to the VIGRA C++ computer vision
1107library. It is designed primarily to ease the implementation of higher-level
1108language bindings to VIGRA.")
1109 (license license:expat))))
1110
060ad3de
TUBK
1111(define-public libwebp
1112 (package
1113 (name "libwebp")
ad7287b2 1114 (version "1.1.0")
060ad3de
TUBK
1115 (source
1116 (origin
b981f777
MB
1117 ;; No tarballs are provided for >0.6.1.
1118 (method git-fetch)
1119 (uri (git-reference
1120 (url "https://chromium.googlesource.com/webm/libwebp")
1121 (commit (string-append "v" version))))
1122 (file-name (git-file-name name version))
060ad3de 1123 (sha256
b2ed5ca7 1124 (base32
ad7287b2 1125 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
060ad3de
TUBK
1126 (build-system gnu-build-system)
1127 (inputs
1128 `(("freeglut" ,freeglut)
1129 ("giflib" ,giflib)
1130 ("libjpeg" ,libjpeg)
1131 ("libpng" ,libpng)
1132 ("libtiff" ,libtiff)))
b981f777
MB
1133 (native-inputs
1134 `(("autoconf" ,autoconf)
1135 ("automake" ,automake)
1136 ("libtool" ,libtool)))
060ad3de
TUBK
1137 (arguments
1138 '(#:configure-flags '("--enable-libwebpmux"
1139 "--enable-libwebpdemux"
371d95eb
MB
1140 "--enable-libwebpdecoder"
1141 "--disable-static")))
060ad3de
TUBK
1142 (home-page "https://developers.google.com/speed/webp/")
1143 (synopsis "Lossless and lossy image compression")
1144 (description
1145 "WebP is a new image format that provides lossless and lossy compression
1eefe4a8
LC
1146for images. WebP lossless images are 26% smaller in size compared to
1147PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1148equivalent SSIM index. WebP supports lossless transparency (also known as
1149alpha channel) with just 22% additional bytes. Transparency is also supported
060ad3de
TUBK
1150with lossy compression and typically provides 3x smaller file sizes compared
1151to PNG when lossy compression is acceptable for the red/green/blue color
1152channels.")
1153 (license license:bsd-3)))
b9ecd5ae
SB
1154
1155(define-public libmng
1156 (package
1157 (name "libmng")
1158 (version "2.0.3")
1159 (source (origin
1160 (method url-fetch)
0f971a04
LF
1161 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1162 version "/" name "-" version ".tar.xz"))
b9ecd5ae
SB
1163 (sha256
1164 (base32
1165 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1166 (build-system gnu-build-system)
1167 (propagated-inputs
1168 ;; These are all in the 'Libs.private' field of libmng.pc.
1169 `(("lcms" ,lcms)
1170 ("libjpeg" ,libjpeg)
1171 ("zlib" ,zlib)))
ce91eeac 1172 (home-page "https://www.libmng.com/")
b9ecd5ae
SB
1173 (synopsis "Library for handling MNG files")
1174 (description
1175 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1176 (license license:bsd-3)))
3aab2c83 1177
023f0fb0
AK
1178(define-public exiv2
1179 (package
1180 (name "exiv2")
febbe431 1181 (version "0.27.2")
0e1c5ccc
TGR
1182 (source
1183 (origin
1184 (method url-fetch)
1185 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
1186 "-Source.tar.gz"))
1187 (sha256
febbe431 1188 (base32 "0gqminvj14xm3rgbnydbywf22608js80rp7nmxxk4497j5mzali6"))))
0e1c5ccc
TGR
1189 (build-system cmake-build-system)
1190 (arguments '(#:tests? #f)) ; no test suite
023f0fb0
AK
1191 (propagated-inputs
1192 `(("expat" ,expat)
1193 ("zlib" ,zlib)))
993d8164 1194 (home-page "https://www.exiv2.org/")
023f0fb0
AK
1195 (synopsis "Library and command-line utility to manage image metadata")
1196 (description
1197 "Exiv2 is a C++ library and a command line utility to manage image
1198metadata. It provides fast and easy read and write access to the Exif, IPTC
1199and XMP metadata of images in various formats.")
1200
1201 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1202 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1203 ;; The core is GPLv2+:
1204 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1205 (license license:gpl2+)))
1206
eafd0390
LC
1207(define-public exiv2-0.26
1208 (package
1209 (inherit exiv2)
1210 (version "0.26")
1211 (source (origin
1212 (method url-fetch)
1213 (uri (list (string-append "https://www.exiv2.org/builds/exiv2-"
1214 version "-trunk.tar.gz")
1215 (string-append "https://www.exiv2.org/exiv2-"
1216 version ".tar.gz")
1217 (string-append "https://fossies.org/linux/misc/exiv2-"
1218 version ".tar.gz")))
1219 (patches (search-patches "exiv2-CVE-2017-14860.patch"
1220 "exiv2-CVE-2017-14859-14862-14864.patch"))
1221 (sha256
1222 (base32
1223 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
1224 (build-system gnu-build-system)
1225 (arguments '(#:tests? #f)) ; no `check' target
1226 (propagated-inputs
1227 `(("expat" ,expat)
1228 ("zlib" ,zlib)))
1229 (native-inputs
1230 `(("intltool" ,intltool)))
1231
1232 ;; People should rely on the newer version, so don't expose it.
1233 (properties `((hidden? . #t)))))
1234
3aab2c83
DT
1235(define-public devil
1236 (package
1237 (name "devil")
77ab6983 1238 (version "1.8.0")
3aab2c83
DT
1239 (source (origin
1240 (method url-fetch)
1241 (uri (string-append "http://downloads.sourceforge.net/openil/"
1242 "DevIL-" version ".tar.gz"))
1243 (sha256
1244 (base32
77ab6983
MB
1245 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1246 (build-system cmake-build-system)
3aab2c83 1247 (arguments
77ab6983
MB
1248 '(;; XXX: Not supported in the released CMakeLists.txt.
1249 ;; Enable this for > 1.8.0.
1250 #:tests? #f
3aab2c83
DT
1251 #:phases
1252 (modify-phases %standard-phases
77ab6983
MB
1253 (add-before 'configure 'change-directory
1254 (lambda _ (chdir "DevIL") #t)))))
3aab2c83
DT
1255 (native-inputs
1256 `(("pkg-config" ,pkg-config)))
1257 (inputs
1258 `(("lcms" ,lcms)
77ab6983 1259 ("libjpeg" ,libjpeg-turbo)
3aab2c83
DT
1260 ("libmng" ,libmng)
1261 ("libpng" ,libpng)
1262 ("libtiff" ,libtiff)
1263 ("openexr" ,openexr)
1264 ("zlib" ,zlib)))
1265 (synopsis "Library for manipulating many image formats")
1266 (description "Developer's Image Library (DevIL) is a library to develop
1267applications with support for many types of images. DevIL can load, save,
1268convert, manipulate, filter and display a wide variety of image formats.")
1269 (home-page "http://openil.sourceforge.net")
1270 (license license:lgpl2.1+)))
b0b23e52
DT
1271
1272(define-public jasper
1273 (package
1274 (name "jasper")
8cc3983a 1275 (version "2.0.16")
b0b23e52 1276 (source (origin
d57b017c
RW
1277 (method git-fetch)
1278 (uri (git-reference
1279 (url "https://github.com/mdadams/jasper.git")
1280 (commit (string-append "version-" version))))
1281 (file-name (git-file-name name version))
b0b23e52
DT
1282 (sha256
1283 (base32
8cc3983a 1284 "05l75yd1zsxwv25ykwwwjs8961szv7iywf16nc6vc6qpby27ckv6"))))
c7a70c33 1285 (build-system cmake-build-system)
d87c201f 1286 (inputs `(("libjpeg" ,libjpeg)))
b0b23e52
DT
1287 (synopsis "JPEG-2000 library")
1288 (description "The JasPer Project is an initiative to provide a reference
1289implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1290ISO/IEC 15444-1).")
1291 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1292 (license (license:x11-style "file://LICENSE"))))
365a4a7f
EF
1293
1294(define-public zimg
1295 (package
1296 (name "zimg")
fc103869 1297 (version "2.9.3")
365a4a7f
EF
1298 (source
1299 (origin
ba185e2a
RW
1300 (method git-fetch)
1301 (uri (git-reference
1302 (url "https://github.com/sekrit-twc/zimg.git")
1303 (commit (string-append "release-" version))))
1304 (file-name (git-file-name name version))
365a4a7f 1305 (sha256
b08c4f5f 1306 (base32 "1dqyrq3p8bkgvj4ci50ac342hjnhyz6xxvhiwp7wpi3v3nbj7s02"))))
365a4a7f
EF
1307 (build-system gnu-build-system)
1308 (native-inputs
1309 `(("autoconf" ,autoconf)
1310 ("automake" ,automake)
1311 ("libtool" ,libtool)))
365a4a7f
EF
1312 (synopsis "Scaling, colorspace conversion, and dithering library")
1313 (description "Zimg implements the commonly required image processing basics
1314of scaling, colorspace conversion, and depth conversion. A simple API enables
1315conversion between any supported formats to operate with minimal knowledge from
1316the programmer.")
1317 (home-page "https://github.com/sekrit-twc/zimg")
8ee04627 1318 ;; test/extra/ contains musl-libm,
365a4a7f 1319 ;; which is MIT/expat licensed, but only used for tests
f62e7ce4 1320 (license license:wtfpl2)))
af7aaaeb
TGR
1321
1322(define-public perceptualdiff
1323 (package
1324 (name "perceptualdiff")
1325 (version "1.3")
1326 (source
1327 (origin
be59c48d
TGR
1328 (method git-fetch)
1329 (uri (git-reference
1330 (url "https://github.com/myint/perceptualdiff.git")
1331 (commit (string-append "v" version))))
1332 (file-name (git-file-name name version))
1333 (sha256
1334 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
af7aaaeb
TGR
1335 (build-system cmake-build-system)
1336 (inputs `(("freeimage" ,freeimage)))
1337 (arguments
1338 '(#:phases (modify-phases %standard-phases
1339 (add-after 'unpack 'fix-tests
1340 ;; cmake-build-system uses a build/ directory outside
1341 ;; of the source tree, one level higher than expected
1342 (lambda _
1343 (substitute* "test/run_tests.bash"
fccacffb
MW
1344 (("../build") "../../build"))
1345 #t)))))
af7aaaeb
TGR
1346 (home-page "https://github.com/myint/perceptualdiff")
1347 (synopsis "Perceptual image comparison utility")
1348 (description "PerceptualDiff visually compares two images to determine
1349whether they look alike. It uses a computational model of the human visual
1350system to detect similarities. This allows it too see beyond irrelevant
1351differences in file encoding, image quality, and other small variations.")
1352 (license license:gpl2+)))
1fa3e336
EB
1353
1354(define-public steghide
1355 (package
1356 (name "steghide")
1357 (version "0.5.1")
1358 (source (origin
1359 (method url-fetch)
1360 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1361 version "/steghide-" version ".tar.bz2"))
1362 (sha256
1363 (base32
1364 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1365 (patches (list (search-patch "steghide-fixes.patch")))))
1366 (build-system gnu-build-system)
1367 (native-inputs
7c90d0f4 1368 `(("gettext" ,gettext-minimal)
1fa3e336
EB
1369 ("libtool" ,libtool)
1370 ("perl" ,perl))) ;for tests
1371 (inputs
1372 `(("libmhash" ,libmhash)
1373 ("libmcrypt" ,libmcrypt)
1374 ("libjpeg" ,libjpeg)
1375 ("zlib" ,zlib)))
1376 (arguments
a56bf101
LC
1377 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1378
1379 #:phases (modify-phases %standard-phases
1380 (add-before 'configure 'set-perl-search-path
1381 (lambda _
1382 ;; Work around "dotless @INC" build failure.
1383 (setenv "PERL5LIB"
1384 (string-append (getcwd) "/tests:"
1385 (getenv "PERL5LIB")))
1386 #t)))))
1fa3e336
EB
1387 (home-page "http://steghide.sourceforge.net")
1388 (synopsis "Image and audio steganography")
1389 (description
7832785d
TGR
1390 "Steghide is a program to hide data in various kinds of image and audio
1391files (known as @dfn{steganography}). Neither color nor sample frequencies are
1392changed, making the embedding resistant against first-order statistical tests.")
1fa3e336 1393 (license license:gpl2+)))
ac2a38a5
RW
1394
1395(define-public stb-image-for-extempore
1396 (let ((revision "1")
1397 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1398 (package
1399 (name "stb-image-for-extempore")
1400 (version (string-append "0-" revision "." (string-take commit 9)))
1401 (source
1402 (origin (method git-fetch)
1403 (uri (git-reference
1404 (url "https://github.com/extemporelang/stb.git")
1405 (commit commit)))
1406 (sha256
1407 (base32
1408 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1409 (file-name (string-append name "-" version "-checkout"))))
1410 (build-system cmake-build-system)
1411 (arguments `(#:tests? #f)) ; no tests included
39162ee4
RW
1412 ;; Extempore refuses to build on architectures other than x86_64
1413 (supported-systems '("x86_64-linux"))
ac2a38a5
RW
1414 (home-page "https://github.com/extemporelang/stb")
1415 (synopsis "Image library for Extempore")
1416 (description
1417 "This package is a collection of assorted single-file libraries. Of
1418all included libraries only the image loading and decoding library is
1419installed as @code{stb_image}.")
1420 (license license:public-domain))))
93117227
AI
1421
1422(define-public optipng
1423 (package
1424 (name "optipng")
bbf8832f 1425 (version "0.7.7")
93117227
AI
1426 (source
1427 (origin
1428 (method url-fetch)
1429 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1430 version ".tar.gz"))
1431 (sha256
1432 (base32
64ed4b6a
EF
1433 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1434 (modules '((guix build utils)))
1435 (snippet
1436 '(begin
1437 (delete-file-recursively "src/libpng")
1438 (delete-file-recursively "src/zlib")
1439 #t))))
93117227
AI
1440 (build-system gnu-build-system)
1441 (inputs
64ed4b6a
EF
1442 `(("libpng" ,libpng)
1443 ("zlib" ,zlib)))
93117227
AI
1444 (arguments
1445 '(#:phases
1446 (modify-phases %standard-phases
93117227
AI
1447 (replace 'configure
1448 (lambda* (#:key outputs #:allow-other-keys)
bbf8832f
TGR
1449 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1450 (invoke "sh" "configure"
64ed4b6a
EF
1451 (string-append "--prefix=" (assoc-ref outputs "out"))
1452 "-with-system-libs")
bbf8832f
TGR
1453 #t)))))
1454 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
93117227
AI
1455 (description "OptiPNG is a PNG optimizer that recompresses image
1456files to a smaller size, without losing any information. This program
1457also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1458PNG, and performs PNG integrity checks and corrections.")
1459 (home-page "http://optipng.sourceforge.net/")
1460 (license license:zlib)))
37e05d64 1461
68fea604
VC
1462(define-public pngsuite
1463 (package
1464 (name "pngsuite")
1465 (version "2017jul19")
1466 (source
1467 (origin
1468 (method url-fetch/tarbomb)
1469 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
1470 version ".tgz"))
1471 (sha256
1472 (base32
1473 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
1474 (build-system gnu-build-system)
1475 (arguments
1476 '(#:tests? #f ; there is no test target
1477 #:license-file-regexp "PngSuite.LICENSE"
1478 #:phases
1479 (modify-phases %standard-phases
1480 (replace 'install
1481 (lambda* (#:key outputs #:allow-other-keys)
1482 (let ((out (assoc-ref outputs "out")))
1483 (copy-recursively "." (string-append out "/"))
1484 #t)))
1485 (delete 'build)
1486 (delete 'configure))))
1487 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
1488 (synopsis "Example PNGs for use in test suites")
1489 (description "Collection of graphics images created to test PNG
1490applications like viewers, converters and editors. As far as that is
1491possible, all formats supported by the PNG standard are represented.")
1492 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1493use, copy, modify and distribute these images for any purpose and without fee
1494is hereby granted."))))
1495
37e05d64
TGR
1496(define-public libjpeg-turbo
1497 (package
1498 (name "libjpeg-turbo")
9b070277 1499 (version "2.0.2")
0fa9f29a 1500 (replacement libjpeg-turbo/fixed)
37e05d64
TGR
1501 (source (origin
1502 (method url-fetch)
ec92d786
MB
1503 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1504 version "/libjpeg-turbo-" version ".tar.gz"))
37e05d64
TGR
1505 (sha256
1506 (base32
9b070277 1507 "1v9gx1gdzgxf51nd55ncq7rghmj4x9x91rby50ag36irwngmkf5c"))))
6871121b 1508 (build-system cmake-build-system)
37e05d64
TGR
1509 (native-inputs
1510 `(("nasm" ,nasm)))
1511 (arguments
6871121b
MB
1512 '(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1513 "-DENABLE_STATIC=0")))
a77de47a 1514 (home-page "https://libjpeg-turbo.org/")
37e05d64
TGR
1515 (synopsis "SIMD-accelerated JPEG image handling library")
1516 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1517JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1518x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1519its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1520a significant amount.
1521libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1522but more straightforward TurboJPEG API, and provides a full-featured Java
1523interface. It supports color space extensions that allow it to compress from
1524and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
71de61c3
MB
1525 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1526 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1527 license:ijg ;the libjpeg library and associated tools
1528 license:zlib)))) ;the libjpeg-turbo SIMD extensions
21122bd7 1529
0fa9f29a
MB
1530;; Replacement package to fix CVE-2019-13960 and CVE-2019-2201.
1531(define libjpeg-turbo/fixed
1532 (package
1533 (inherit libjpeg-turbo)
1534 (version "2.0.3")
1535 (source (origin
1536 (method url-fetch)
1537 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1538 version "/libjpeg-turbo-" version ".tar.gz"))
1539 (sha256
1540 (base32
1541 "1ds16bnj17v6hzd43w8pzijz3imd9am4hw75ir0fxm240m8dwij2"))
1542 (patches (search-patches "libjpeg-turbo-CVE-2019-2201.patch"))))))
1543
21122bd7
JD
1544(define-public niftilib
1545 (package
f729a4d8
RW
1546 (name "niftilib")
1547 (version "2.0.0")
1548 (source (origin
1549 (method url-fetch)
1550 (uri (list (string-append "mirror://sourceforge/niftilib/"
1551 "nifticlib/nifticlib_"
1552 (string-join (string-split version #\.) "_")
1553 "/nifticlib-" version ".tar.gz")))
1554 (sha256
1555 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1556 (build-system gnu-build-system)
1557 (arguments
1558 '(#:tests? #f ; there is no test target
1559 #:parallel-build? #f ; not supported
1560 #:make-flags
1561 (list "SHELL=bash"
1562 (string-append "ZLIB_INC="
1563 (assoc-ref %build-inputs "zlib") "/include")
1564 ;; Append "-fPIC" to CFLAGS.
1565 (string-append "CFLAGS="
1566 "-Wall -ansi -pedantic -fPIC"))
1567 #:phases
1568 (modify-phases %standard-phases
1569 (replace 'install
1570 (lambda* (#:key outputs #:allow-other-keys)
1571 (let ((out (assoc-ref outputs "out")))
1572 (for-each
1573 (lambda (dir)
1574 (copy-recursively dir (string-append out "/" dir)))
1575 '("bin" "lib" "include")))
1576 #t))
1577 (delete 'configure))))
1578 (inputs
1579 `(("zlib" ,zlib)))
1580 (synopsis "Library for reading and writing files in the nifti-1 format")
1581 (description "Niftilib is a set of i/o libraries for reading and writing
21122bd7
JD
1582files in the nifti-1 data format - a binary file format for storing
1583medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1584(fMRI) brain images.")
f729a4d8
RW
1585 (home-page "http://niftilib.sourceforge.net")
1586 (license license:public-domain)))
f2079849
JL
1587
1588(define-public gpick
1589 (package
1590 (name "gpick")
1591 (version "0.2.5")
1592 (source (origin
94be94cf
RW
1593 (method git-fetch)
1594 (uri (git-reference
1595 (url "https://github.com/thezbyg/gpick.git")
1596 (commit (string-append name "-" version))))
1597 (file-name (git-file-name name version))
f2079849
JL
1598 (sha256
1599 (base32
94be94cf 1600 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
2235abb2 1601 (build-system scons-build-system)
f2079849
JL
1602 (native-inputs
1603 `(("boost" ,boost)
f2d97d57 1604 ("gettext" ,gettext-minimal)
2235abb2 1605 ("pkg-config" ,pkg-config)))
f2079849
JL
1606 (inputs
1607 `(("expat" ,expat)
1608 ("gtk2" ,gtk+-2)
1609 ("lua" ,lua-5.2)))
1610 (arguments
1611 `(#:tests? #f
2235abb2
AI
1612 #:scons ,scons-python2
1613 #:scons-flags (list (string-append "DESTDIR=" %output))
f2079849
JL
1614 #:phases
1615 (modify-phases %standard-phases
1616 (add-before 'build 'fix-lua-reference
1617 (lambda _
1618 (substitute* "SConscript"
1619 (("lua5.2") "lua-5.2"))
2235abb2 1620 #t)))))
f2079849
JL
1621 (home-page "http://www.gpick.org/")
1622 (synopsis "Color picker")
1623 (description "Gpick is an advanced color picker and palette editing tool.")
1624 (license license:bsd-3)))
bc806b0c
LF
1625
1626(define-public libiptcdata
1627 (package
1628 (name "libiptcdata")
a42b6848 1629 (version "1.0.5")
bc806b0c
LF
1630 (source (origin
1631 (method url-fetch)
a42b6848
TGR
1632 (uri (string-append "https://github.com/ianw/libiptcdata"
1633 "/releases/download/release_"
1634 (string-join (string-split version #\.) "_")
1635 "/" name "-" version ".tar.gz"))
bc806b0c
LF
1636 (sha256
1637 (base32
a42b6848 1638 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
bc806b0c 1639 (build-system gnu-build-system)
a42b6848 1640 (home-page "https://github.com/ianw/libiptcdata")
bc806b0c 1641 (synopsis "IPTC metadata manipulation library")
a09a2119
TGR
1642 (description
1643 "Libiptcdata is a C library for manipulating the International Press
1644Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
bc806b0c
LF
1645such as images. This metadata can include captions and keywords, often used by
1646popular photo management applications. The library provides routines for
1647parsing, viewing, modifying, and saving this metadata.")
1648 (license license:lgpl2.0+)))
84567657
OP
1649
1650(define-public flameshot
1651 (package
1652 (name "flameshot")
1653 (version "0.5.1")
1654 (source
1655 (origin
743600e9
RW
1656 (method git-fetch)
1657 (uri (git-reference
1658 (url "https://github.com/lupoDharkael/flameshot.git")
1659 (commit (string-append "v" version))))
1660 (file-name (git-file-name name version))
84567657
OP
1661 (sha256
1662 (base32
743600e9 1663 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
84567657
OP
1664 (build-system gnu-build-system)
1665 (native-inputs
1666 `(("qttools" ,qttools)))
1667 (inputs
1668 `(("qtbase" ,qtbase)))
1669 (arguments
1670 `(#:tests? #f ; no tests
1671 #:phases
1672 (modify-phases %standard-phases
1673 (replace 'configure
1674 (lambda* (#:key outputs #:allow-other-keys)
1675 (invoke "qmake"
1676 "CONFIG+=packaging"
1677 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1678 "PREFIX=/"))))))
1679 (home-page "https://github.com/lupoDharkael/flameshot")
1680 (synopsis "Powerful yet simple to use screenshot software")
1681 (description "Flameshot is a screenshot program.
1682Features:
1683
1684@itemize
1685@item Customizable appearance.
1686@item Easy to use.
1687@item In-app screenshot edition.
1688@item DBus interface.
1689@item Upload to Imgur.
1690@end itemize\n")
1691 (license license:gpl3+)))
da4dde61 1692
0d529a7c
PN
1693(define-public gifsicle
1694 (package
1695 (name "gifsicle")
5c46e1dd 1696 (version "1.92")
0d529a7c
PN
1697 (source
1698 (origin
1699 (method url-fetch)
645b6c7f 1700 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
0d529a7c
PN
1701 version ".tar.gz"))
1702 (sha256
5c46e1dd 1703 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
0d529a7c
PN
1704 (build-system gnu-build-system)
1705 (arguments
1706 '(#:phases
1707 (modify-phases %standard-phases
1708 (add-before 'check 'patch-tests
1709 (lambda _
1710 (substitute* "test/testie"
1711 (("/usr/bin/perl")
1712 (which "perl"))
1713 (("/bin/sh")
1714 (which "sh"))
1715 (("/bin/rm")
1716 (which "rm")))
1717 #t)))))
5c46e1dd 1718 (native-inputs `(("perl" ,perl))) ; only for tests
0d529a7c 1719 (inputs `(("libx11" ,libx11)))
645b6c7f 1720 (home-page "https://www.lcdf.org/gifsicle/")
0d529a7c
PN
1721 (synopsis "Edit GIF images and animations")
1722 (description "Gifsicle is a command-line GIF image manipulation tool that:
1723
1724@itemize
1725@item Provides a batch mode for changing GIFs in place.
1726@item Prints detailed information about GIFs, including comments.
1727@item Control over interlacing, comments, looping, transparency, etc.
1728@item Creates well-behaved GIFs: removes redundant colors, only uses local color
1729tables, etc.
1730@item Shrinks colormaps and change images to use the Web-safe palette.
1731@item Optimizes GIF animations, or unoptimizes them for easier editing.
1732@end itemize
1733
1734Two other programs are included with Gifsicle: @command{gifview} is a
1735lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1736identical visual appearance.")
1737 (license license:gpl2+)))
3239dcd3 1738
dc7e5783 1739;; 1.0.7 is buggy and reverted in git repository.
3239dcd3
PAR
1740(define-public jp2a
1741 (package
1742 (name "jp2a")
dc7e5783 1743 (version "1.0.6")
3239dcd3
PAR
1744 (source
1745 (origin
dc7e5783
EF
1746 (method url-fetch)
1747 (uri (string-append "mirror://debian/pool/main/j/jp2a/jp2a_"
1748 version ".orig.tar.gz"))
1749 (sha256
1750 (base32
1751 "076frk3pa16s4r1b10zgy81vdlz0385zh3ykbnkaij25jn5aqc09"))))
3239dcd3
PAR
1752 (build-system gnu-build-system)
1753 (inputs
dc7e5783
EF
1754 `(("curl" ,curl)
1755 ("libjpeg" ,libjpeg)
1756 ("ncurses" ,ncurses)))
3239dcd3
PAR
1757 (home-page "https://csl.name/jp2a/")
1758 (synopsis "Convert JPEG images to ASCII")
1759 (description
1760 "Jp2a is a small utility that converts JPEG images to ASCII.")
1761 (license license:gpl2)))
0290f533
RH
1762
1763(define-public grim
1764 (package
444c4c08 1765 (name "grim")
501d4b33 1766 (version "1.2.0")
444c4c08
RH
1767 (source
1768 (origin
90c7ea44
TGR
1769 (method git-fetch)
1770 (uri (git-reference
1771 (url "https://github.com/emersion/grim.git")
1772 (commit (string-append "v" version))))
1773 (file-name (git-file-name name version))
444c4c08 1774 (sha256
501d4b33 1775 (base32 "0brljl4zfbn5mh9hkfrfkvd27c5y9vdkgap9r1hrfy9r1x20sskn"))))
444c4c08 1776 (build-system meson-build-system)
355dd713
BT
1777 (native-inputs `(("pkg-config" ,pkg-config)
1778 ("scdoc" ,scdoc)))
444c4c08
RH
1779 (inputs `(("cairo" ,cairo)
1780 ("libjpeg-turbo" ,libjpeg-turbo)
444c4c08
RH
1781 ("wayland" ,wayland)
1782 ("wayland-protocols" ,wayland-protocols)))
1783 (home-page "https://github.com/emersion/grim")
1784 (synopsis "Create screenshots from a Wayland compositor")
1785 (description "grim can create screenshots from a Wayland compositor.")
1786 ;; MIT license.
1787 (license license:expat)))
bd86a1be
RH
1788
1789(define-public slurp
1790 (package
1791 (name "slurp")
7d5113e5 1792 (version "1.2.0")
bd86a1be
RH
1793 (source
1794 (origin
1795 (method git-fetch)
1796 (uri (git-reference
1797 (url "https://github.com/emersion/slurp.git")
1798 (commit (string-append "v" version))))
1799 (file-name (git-file-name name version))
1800 (sha256
7d5113e5 1801 (base32 "0580m6kaiilgsrcj608r837r37sl6a25y7w21p7d6ij20fs3gvg1"))))
bd86a1be
RH
1802 (build-system meson-build-system)
1803 (native-inputs `(("pkg-config" ,pkg-config)))
1804 (inputs `(("cairo" ,cairo)
1805 ("scdoc" ,scdoc)
1806 ("wayland" ,wayland)
1807 ("wayland-protocols" ,wayland-protocols)))
1808 (home-page "https://github.com/emersion/slurp")
1809 (synopsis "Select a region in a Wayland compositor")
1810 (description "Slurp can select a region in a Wayland compositor and print it
1811to the standard output. It works well together with grim.")
1812 ;; MIT license.
1813 (license license:expat)))
d54ca1cd
VC
1814
1815(define-public sng
1816 (package
1817 (name "sng")
1818 (version "1.1.0")
1819 (source
1820 (origin
1821 (method url-fetch)
1822 (uri (string-append "mirror://sourceforge/sng/sng-"
1823 version ".tar.gz"))
1824 (sha256
1825 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
1826 (build-system gnu-build-system)
1827 (arguments
1828 `(#:phases
1829 (modify-phases %standard-phases
1830 (add-before 'check 'link-pngsuite
1831 ;; tests expect pngsuite in source dir
1832 (lambda* (#:key inputs #:allow-other-keys)
1833 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
1834 #t)))
1835 #:configure-flags
1836 (list (string-append "--with-rgbtxt="
1837 (assoc-ref %build-inputs "xorg-rgb")
1838 "/share/X11/rgb.txt"))))
1839 (inputs `(("xorg-rgb" ,xorg-rgb)
1840 ("libpng" ,libpng)))
1841 (native-inputs `(("pngsuite" ,pngsuite)))
1842 (home-page "http://sng.sourceforge.net")
1843 (synopsis "Markup language for representing PNG contents")
1844 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
1845specifically to represent the entire contents of a PNG (Portable Network
1846Graphics) file in an editable form. Thus, SNGs representing elaborate
1847graphics images and ancillary chunk data can be readily generated or modified
1848using only text tools.
1849
1850SNG is implemented by a compiler/decompiler called sng that
1851losslessly translates between SNG and PNG.")
1852 (license license:zlib)))
7eed5845
GL
1853
1854(define-public lodepng
1855 ;; There are no tags in the repository, so we take the version as defined in
1856 ;; lodepng.cpp.
1857 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
1858 (revision "1")
1859 (version "20200215"))
1860 (package
1861 (name "lodepng")
1862 (version (git-version version revision commit))
1863 (source (origin
1864 (method git-fetch)
1865 (uri (git-reference
1866 (url "https://github.com/lvandeve/lodepng")
1867 (commit commit)))
1868 (sha256
1869 (base32
1870 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
1871 (file-name (git-file-name name version))))
1872 (build-system gnu-build-system)
1873 (arguments
1874 '(#:phases
1875 (modify-phases %standard-phases
1876 (delete 'configure)
1877 (replace 'build
1878 (lambda _
1879 (setenv "CXXFLAGS" "-fPIC")
1880 (invoke "make" "lodepng.o")
1881 (invoke "make" "lodepng_util.o")
1882 (invoke "g++" "-fPIC" "-O3"
1883 "-o" "liblodepng.so"
1884 "-shared" "lodepng.o" "lodepng_util.o")
1885 #t))
1886 (replace 'check
1887 (lambda _
1888 (invoke "make" "unittest")
1889 (invoke "./unittest")
1890 #t))
1891 (replace 'install
1892 (lambda* (#:key outputs #:allow-other-keys)
1893 (let* ((out (assoc-ref outputs "out"))
1894 (doc (string-append out "/share/doc"))
1895 (lib (string-append out "/lib"))
1896 (include (string-append out "/include")))
1897 (install-file "lodepng.h" include)
1898 (install-file "lodepng_util.h" include)
1899 (install-file "liblodepng.so" lib)
1900 (install-file "README.md" doc)
1901 #t))))))
1902 (home-page "https://lodev.org/lodepng/")
1903 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
1904 (description "LodePNG is a PNG image decoder and encoder, all in one,
1905no dependency or linkage required. It's made for C (ISO C90), and has a C++
1906wrapper with a more convenient interface on top.")
1907 (license license:zlib))))
14138912
HG
1908
1909(define-public icoutils
1910 (package
1911 (name "icoutils")
1912 (version "0.32.3")
1913 (source
1914 (origin
1915 (method url-fetch)
1916 (uri (string-append
1917 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
1918 (sha256
1919 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
1920 (build-system gnu-build-system)
1921 (inputs
1922 `(("libpng" ,libpng)
1923 ("perl" ,perl)))
1924 (propagated-inputs
1925 `(("perl-libwww" ,perl-libwww)))
1926 (home-page "https://www.nongnu.org/icoutils/")
1927 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
1928 (description "Icoutils are a set of program for extracting and converting
1929bitmaps from Microsoft Windows icon and cursor files. These files usually
1930have the extension @code{.ico} or @code{.cur}, but they can also be embedded
1931in executables and libraries (@code{.dll}-files). (Such embedded files are
1932referred to as resources.)
1933
1934Conversion of these files to and from PNG images is done @command{icotool}.
1935@command{extresso} automates these tasks with the help of special resource
1936scripts. Resources such can be extracted from MS Windows executable and
1937library files with @command{wrestool}.
1938
1939This package can be used to create @code{favicon.ico} files for web sites.")
1940 (license license:gpl3+)))
fecd608f
LF
1941
1942(define-public libavif
1943 (package
1944 (name "libavif")
d7041a69 1945 (version "0.7.1")
fecd608f
LF
1946 (source (origin
1947 (method git-fetch)
1948 (uri (git-reference
1949 (url "https://github.com/AOMediaCodec/libavif")
1950 (commit (string-append "v" version))))
1951 (file-name (git-file-name name version))
1952 (sha256
1953 (base32
d7041a69 1954 "1xybjbbprvfsrwgysrn7grg6yp7v6ch5vci7zvdcdzcgyrbph172"))))
fecd608f
LF
1955 (build-system cmake-build-system)
1956 (arguments
1957 `(#:configure-flags '("-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
1958 "-DAVIF_CODEC_RAV1E=OFF" ; not packaged yet
1959 "-DAVIF_BUILD_TESTS=ON")
1960 #:phases
1961 (modify-phases %standard-phases
d7041a69
LF
1962 (replace 'check
1963 (lambda _
1964 (invoke "./aviftest" "../source/tests/data")))
fecd608f
LF
1965 (add-after 'install 'install-readme
1966 (lambda* (#:key outputs #:allow-other-keys)
1967 (let* ((out (assoc-ref outputs "out"))
d7041a69
LF
1968 (doc (string-append out "/share/doc/libavif-" ,version)))
1969 (install-file "../source/README.md" doc)
1970 #t))))))
fecd608f
LF
1971 (inputs
1972 `(("libaom" ,libaom)
1973 ("dav1d" ,dav1d)))
1974 (synopsis "Encode and decode AVIF files")
1975 (description "Libavif is a C implementation of the AV1 Image File Format
1976(AVIF). It can encode and decode all YUV formats and bit depths supported by
1977AOM, including with alpha.")
1978 (home-page "https://github.com/AOMediaCodec/libavif")
1979 (license (list license:bsd-2 ; libavif itself
1980 license:expat)))) ; cJSON in the test suite
95b800e6
VK
1981
1982(define-public mtpaint
1983 (let ((commit "03b1b0938067b88d86d9f1b1088730f1934d411e")
1984 (revision "1"))
1985 (package
1986 (name "mtpaint")
1987 ;; The author neither releases tarballs nor uses git version tags.
1988 ;; Instead, author puts version in git commit title.
1989 (version (git-version "3.49.25" revision commit))
1990 (source
1991 (origin
1992 (method git-fetch)
1993 (uri (git-reference
1994 (url "https://github.com/wjaguar/mtPaint/")
1995 (commit commit)))
1996 (file-name (git-file-name name version))
1997 (sha256
1998 (base32 "0izm2wvj26566fd8mqvypr7bmv7jnq8qhp4760m7z2wrc4y8pjn1"))))
1999 (build-system gnu-build-system)
2000 (native-inputs
2001 `(("gettext" ,gettext-minimal)
2002 ("pkg-config" ,pkg-config)
2003 ("which" ,which)))
2004 (inputs
2005 `(("imlib2" ,imlib2)
2006 ("libtiff" ,libtiff)
2007 ("libpng" ,libpng)
2008 ("libungif", libungif)
2009 ("libjpeg", libjpeg)
2010 ("libwebp" ,libwebp)
2011 ("openjpeg" ,openjpeg)
2012 ("lcms" ,lcms)
2013 ("zlib", zlib)
2014 ("glib" ,glib)
2015 ;; support for gtk3 is in testing stage
2016 ("gtk+" ,gtk+-2)))
2017 (arguments
2018 `(#:configure-flags
2019 (list
2020 ;; internationalized version
2021 "intl"
2022 ;; install man page
2023 "man")
2024 ;; no check target
2025 #:tests? #f))
2026 (home-page "http://mtpaint.sourceforge.net/")
2027 (synopsis "Create pixel art and manipulate digital images")
2028 (description
2029 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
2030It can create and edit indexed palette or 24bit RGB images, offers basic
2031painting and palette manipulation tools. It also handles JPEG, JPEG2000,
2032GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
2033 (license license:gpl3+))))