gnu: r-maldiquant: Move to (gnu packages cran).
[jackhill/guix/guix.git] / gnu / packages / image.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2014, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
9 ;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2016, 2017, 2018, 2020 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2016, 2017, 2020 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2017 Nikita <nikita@n0.is>
17 ;;; Copyright © 2017,2019,2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
18 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
19 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
20 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
21 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
22 ;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
23 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
24 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
25 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
26 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
27 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
28 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
29 ;;;
30 ;;; This file is part of GNU Guix.
31 ;;;
32 ;;; GNU Guix is free software; you can redistribute it and/or modify it
33 ;;; under the terms of the GNU General Public License as published by
34 ;;; the Free Software Foundation; either version 3 of the License, or (at
35 ;;; your option) any later version.
36 ;;;
37 ;;; GNU Guix is distributed in the hope that it will be useful, but
38 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 ;;; GNU General Public License for more details.
41 ;;;
42 ;;; You should have received a copy of the GNU General Public License
43 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44
45 (define-module (gnu packages image)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages algebra)
48 #:use-module (gnu packages assembly)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages boost)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages cmake)
54 #:use-module (gnu packages curl)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages documentation)
57 #:use-module (gnu packages fontutils)
58 #:use-module (gnu packages freedesktop)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages ghostscript)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages graphics)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages lua)
66 #:use-module (gnu packages man)
67 #:use-module (gnu packages maths)
68 #:use-module (gnu packages mcrypt)
69 #:use-module (gnu packages mp3)
70 #:use-module (gnu packages ncurses)
71 #:use-module (gnu packages perl)
72 #:use-module (gnu packages photo)
73 #:use-module (gnu packages pkg-config)
74 #:use-module (gnu packages python)
75 #:use-module (gnu packages python-xyz)
76 #:use-module (gnu packages qt)
77 #:use-module (gnu packages sphinx)
78 #:use-module (gnu packages textutils)
79 #:use-module (gnu packages video)
80 #:use-module (gnu packages web)
81 #:use-module (gnu packages xml)
82 #:use-module (gnu packages xorg)
83 #:use-module ((guix licenses) #:prefix license:)
84 #:use-module (guix packages)
85 #:use-module (guix download)
86 #:use-module (guix git-download)
87 #:use-module (guix utils)
88 #:use-module (guix build-system gnu)
89 #:use-module (guix build-system cmake)
90 #:use-module (guix build-system copy)
91 #:use-module (guix build-system meson)
92 #:use-module (guix build-system python)
93 #:use-module (guix build-system scons)
94 #:use-module (guix deprecation)
95 #:use-module (srfi srfi-1))
96
97 (define-public iqa
98 (package
99 (name "iqa")
100 (version "1.1.2")
101 (source
102 (origin
103 (method url-fetch)
104 (uri
105 (string-append "https://sourceforge.net/projects/iqa/files/"
106 "1.1.2%20Release/iqa_1.1.2_src.tar.gz/download"))
107 (sha256
108 (base32 "00mgwy031ammab6bwmd1whhvqv3fxy1cs1igabq0n3ag12zhjs77"))))
109 (build-system gnu-build-system)
110 (arguments
111 `(#:test-target "test"
112 #:phases
113 (modify-phases %standard-phases
114 (delete 'configure)
115 (replace 'install
116 (lambda* (#:key outputs #:allow-other-keys)
117 (let* ((out (assoc-ref outputs "out"))
118 (lib (string-append out "/lib")))
119 (install-file "build/debug/libiqa.a" lib)
120 #t))))))
121 (synopsis "Image Quality Assessment")
122 (description "IQA is a C library for objectively measuring image/video
123 quality. It implements many popular algorithms, such as MS-SSIM, MS-SSIM*,
124 SIMM, MSE, and PSNR. It is designed to be fast, accurate, and reliable. All
125 code is Valgrind-clean and unit tested.")
126 (home-page "https://sourceforge.net/projects/iqa/")
127 (license license:bsd-4)))
128
129 (define-public libpng
130 (package
131 (name "libpng")
132 (version "1.6.37")
133 (source (origin
134 (method url-fetch)
135 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
136 version "/libpng-" version ".tar.xz")
137 (string-append
138 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
139 "/libpng16/libpng-" version ".tar.xz")
140 (string-append
141 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
142 "/libpng16/libpng-" version ".tar.xz")))
143 (sha256
144 (base32
145 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
146 (build-system gnu-build-system)
147 (arguments
148 `(#:configure-flags '("--disable-static")))
149
150 ;; libpng.la says "-lz", so propagate it.
151 (propagated-inputs `(("zlib" ,zlib)))
152
153 (synopsis "Library for handling PNG files")
154 (description
155 "Libpng is the official PNG (Portable Network Graphics) reference
156 library. It supports almost all PNG features and is extensible.")
157 (license license:zlib)
158 (home-page "http://www.libpng.org/pub/png/libpng.html")))
159
160 ;; libpng-apng should be updated when the APNG patch is released:
161 ;; <https://bugs.gnu.org/27556>
162 (define-public libpng-apng
163 (package
164 (name "libpng-apng")
165 (version "1.6.28")
166 (source
167 (origin
168 (method url-fetch)
169 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
170 version "/libpng-" version ".tar.xz")
171 (string-append
172 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
173 "/libpng16/libpng-" version ".tar.xz")
174 (string-append
175 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
176 "/libpng16/libpng-" version ".tar.xz")))
177 (sha256
178 (base32
179 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
180 (build-system gnu-build-system)
181 (arguments
182 `(#:modules ((guix build gnu-build-system)
183 (guix build utils)
184 (srfi srfi-1))
185 #:phases
186 (modify-phases %standard-phases
187 (add-after 'unpack 'patch-apng
188 (lambda* (#:key inputs #:allow-other-keys)
189 (define (apply-patch file)
190 (invoke "patch" "-p1" "--force"
191 "--input" file))
192 (let ((apng.gz (assoc-ref inputs "apng")))
193 (format #t "Applying APNG patch '~a'...~%"
194 apng.gz)
195 (invoke "sh" "-c"
196 (string-append "gunzip < " apng.gz " > the-patch"))
197 (apply-patch "the-patch")
198 #t)))
199 (add-before 'configure 'no-checks
200 (lambda _
201 (substitute* "Makefile.in"
202 (("^scripts/symbols.chk") "")
203 (("check: scripts/symbols.chk") ""))
204 #t)))))
205 (inputs
206 `(("apng" ,(origin
207 (method url-fetch)
208 (uri
209 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
210 version "/libpng-" version "-apng.patch.gz"))
211 (sha256
212 (base32
213 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
214 (native-inputs
215 `(("libtool" ,libtool)))
216 ;; libpng.la says "-lz", so propagate it.
217 (propagated-inputs
218 `(("zlib" ,zlib)))
219 (synopsis "APNG patch for libpng")
220 (description
221 "APNG (Animated Portable Network Graphics) is an unofficial
222 extension of the APNG (Portable Network Graphics) format.
223 APNG patch provides APNG support to libpng.")
224 (home-page "https://sourceforge.net/projects/libpng-apng/")
225 (license license:zlib)))
226
227 (define-public libpng-1.2
228 (package
229 (inherit libpng)
230 (version "1.2.59")
231 (source
232 (origin
233 (method url-fetch)
234 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
235 version "/libpng-" version ".tar.xz")
236 (string-append
237 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
238 "/libpng12/libpng-" version ".tar.xz")
239 (string-append
240 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
241 "/libpng12/libpng-" version ".tar.xz")))
242 (sha256
243 (base32
244 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
245
246 (define-public pngcrush
247 (package
248 (name "pngcrush")
249 (version "1.8.13")
250 (source (origin
251 (method url-fetch)
252 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
253 version "/pngcrush-" version "-nolib.tar.xz"))
254 (sha256 (base32
255 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
256 (build-system gnu-build-system)
257 (arguments
258 '(#:tests? #f ; no check target
259 #:phases
260 (modify-phases %standard-phases
261 (replace 'configure
262 (lambda* (#:key inputs outputs #:allow-other-keys)
263 (substitute* "Makefile"
264 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
265 (string-append vardef (assoc-ref inputs "libpng") "/"))
266 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
267 (string-append vardef (assoc-ref inputs "zlib") "/"))
268 ;; The Makefile is written by hand and not using $PREFIX
269 (("\\$\\(DESTDIR\\)/usr/")
270 (string-append (assoc-ref outputs "out") "/")))
271 #t)))))
272 (inputs
273 `(("libpng" ,libpng)
274 ("zlib" , zlib)))
275 (home-page "https://pmt.sourceforge.io/pngcrush")
276 (synopsis "Utility to compress PNG files")
277 (description "Pngcrush optimizes @acronym{PNG, Portable Network Graphics}
278 images. It can further losslessly compress them by as much as 40%.")
279 (license license:zlib)))
280
281 (define-public pnglite
282 (let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
283 (revision "1"))
284 (package
285 (name "pnglite")
286 ;; The project was moved from sourceforge to github.
287 ;; The latest version in sourceforge was 0.1.17:
288 ;; https://sourceforge.net/projects/pnglite/files/pnglite/
289 ;; No releases are made in github.
290 (version (git-version "0.1.17" revision commit))
291 (source (origin
292 (method git-fetch)
293 (uri (git-reference
294 (url "https://github.com/dankar/pnglite")
295 (commit commit)))
296 (sha256
297 (base32
298 "1lmmkdxby5b8z9kx3zrpgpk33njpcf2xx8z9bgqag855sjsqbbby"))
299 (file-name (git-file-name name version))))
300 (build-system gnu-build-system)
301 (arguments
302 `(#:tests? #f ; no tests
303 #:phases
304 (modify-phases %standard-phases
305 (delete 'configure)
306 (replace 'build
307 (lambda _
308 ;; common build flags for building shared libraries
309 (let ((cflags '("-O2" "-g" "-fPIC"))
310 (ldflags '("-shared")))
311 (apply invoke
312 `("gcc"
313 "-o" "libpnglite.so"
314 ,@cflags
315 ,@ldflags
316 "pnglite.c"))
317 #t)))
318 (replace 'install
319 (lambda* (#:key outputs #:allow-other-keys)
320 (let* ((out (assoc-ref outputs "out"))
321 (lib (string-append out "/lib/"))
322 (include (string-append out "/include/"))
323 (doc (string-append out "/share/doc/"
324 ,name "-" ,version "/")))
325 (install-file "libpnglite.so" lib)
326 (install-file "pnglite.h" include)
327 (install-file "README.md" doc)
328 #t))))))
329 (inputs `(("zlib" ,zlib)))
330 (home-page "https://github.com/dankar/pnglite")
331 (synopsis "Pretty small png library")
332 (description "A pretty small png library.
333 Currently all documentation resides in @file{pnglite.h}.")
334 (license license:zlib))))
335
336 (define-public libimagequant
337 (package
338 (name "libimagequant")
339 (version "2.12.5")
340 (source
341 (origin
342 (method git-fetch)
343 (uri (git-reference
344 (url "https://github.com/ImageOptim/libimagequant")
345 (commit version)))
346 (file-name (git-file-name name version))
347 (sha256
348 (base32 "0cp68w04ja5pv77ssfafsn958w9hh9zb8crrlb5j3gsrcmdc032k"))))
349 (build-system gnu-build-system)
350 (arguments
351 '(#:tests? #f)) ; no check target
352 (home-page "https://pngquant.org/lib/")
353 (synopsis "Image palette quantization library")
354 (description "libimagequant is a small, portable C library for
355 high-quality conversion of RGBA images to 8-bit indexed-color (palette)
356 images. This library can significantly reduces file sizes and powers pngquant
357 and other PNG optimizers.")
358 (license license:gpl3+)))
359
360 (define-public pngquant
361 (package
362 (name "pngquant")
363 (version "2.12.6")
364 (source
365 (origin
366 (method git-fetch)
367 (uri (git-reference
368 (url "https://github.com/kornelski/pngquant")
369 (commit version)))
370 (file-name (git-file-name name version))
371 (sha256
372 (base32 "15hanshahxqs6s9fyc3aym02251dcys7bf78g3inp0y233amdbl3"))))
373 (build-system gnu-build-system)
374 (arguments
375 `(#:test-target "test"
376 #:configure-flags
377 '("--with-openmp" "--with-lcms2")))
378 (native-inputs
379 `(("pkg-config" ,pkg-config)))
380 (inputs
381 `(("libpng" ,libpng)
382 ("zlib" , zlib)
383 ("lcms" ,lcms)
384 ("libimagequant" ,libimagequant)))
385 (home-page "https://pngquant.org/")
386 (synopsis "Utility and library for lossy compressing PNG images")
387 (description "pngquant is a PNG compressor that significantly reduces file
388 sizes by converting images to a more efficient 8-bit PNG format with alpha
389 channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images
390 are fully standards-compliant and are supported by all web browsers and
391 operating systems.
392
393 Features:
394 @enumerate
395 @item High-quality palette generation using a combination of vector
396 quantization algorithms.
397 @item Unique adaptive dithering algorithm that adds less noise to images
398 than the standard Floyd-Steinberg.
399 @item Easy to integrate with shell scripts, GUIs and server-side software.
400 @item Fast mode for real-time processing/large numbers of images.
401 @end enumerate")
402 (license license:gpl3+)))
403
404 (define-public ijg-libjpeg
405 (package
406 (name "libjpeg")
407 (version "9d")
408 (source (origin
409 (method url-fetch)
410 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
411 version ".tar.gz"))
412 (sha256 (base32
413 "0clwys9lcqlxqgcw8s1gwfm5ix2zjlqpklmd3mbvqmj5ibj51jwr"))))
414 (build-system gnu-build-system)
415 (synopsis "Library for handling JPEG files")
416 (description
417 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
418 JPEG is a standardized compression method for full-color and gray-scale
419 images.
420 It also includes programs that provide conversion between the JPEG format and
421 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats, as well as
422 lossless JPEG manipulations such as rotation, scaling or cropping:
423 @enumerate
424 @item cjpeg
425 @item djpeg
426 @item jpegtran
427 @item rdjpgcom
428 @item wrjpgcom
429 @end enumerate")
430 (license license:ijg)
431 (home-page "https://www.ijg.org/")))
432
433 (define-public libjxr
434 (package
435 (name "libjxr")
436 (version "1.1")
437 (source (origin
438 ;; We are using the Debian source because CodePlex does not
439 ;; deliver an easily downloadable tarball.
440 (method url-fetch)
441 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
442 version ".orig.tar.gz"))
443 (sha256
444 (base32
445 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
446 (patch-flags '("-p1" "--binary"))
447 (patches (search-patches "libjxr-fix-function-signature.patch"
448 "libjxr-fix-typos.patch"))))
449 (build-system gnu-build-system)
450 (arguments
451 '(#:make-flags
452 (list "CC=gcc"
453 ;; A substitute* procedure call would be enough to add the -fPIC
454 ;; flag if there was no file decoding error.
455 ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
456 ;; terminators" according to the file(1) utility.
457 (string-append "CFLAGS=-I. -Icommon/include -Iimage/sys -fPIC "
458 "-D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O "))
459 #:tests? #f ; no check target
460 #:phases
461 (modify-phases %standard-phases
462 (delete 'configure) ; no configure script
463 (add-after 'build 'build-shared-library
464 (lambda _
465 ;; The Makefile uses optimization level 1, so the same
466 ;; level is used here for consistency.
467 (invoke "gcc" "-shared" "-fPIC" "-O"
468 ;; Common files.
469 "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
470 "strTransform.o" "perfTimerANSI.o"
471 ;; Decoding files.
472 "decode.o" "postprocess.o" "segdec.o" "strdec.o"
473 "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
474 ;; Encoding files.
475 "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
476 "strPredQuantEnc.o"
477 "-o" "libjpegxr.so")
478 (invoke "gcc" "-shared" "-fPIC" "-O"
479 ;; Glue files.
480 "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
481 ;; Test files.
482 "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
483 "JXRTestTif.o" "JXRTestYUV.o"
484 "-o" "libjxrglue.so")))
485 ;; The upstream makefile does not include an install phase.
486 (replace 'install
487 (lambda* (#:key outputs #:allow-other-keys)
488 (let* ((out (assoc-ref outputs "out"))
489 (bin (string-append out "/bin"))
490 (lib (string-append out "/lib"))
491 (include (string-append out "/include/jxrlib")))
492 (for-each (lambda (file)
493 (install-file file include)
494 (delete-file file))
495 (append
496 '("jxrgluelib/JXRGlue.h"
497 "jxrgluelib/JXRMeta.h"
498 "jxrtestlib/JXRTest.h"
499 "image/sys/windowsmediaphoto.h")
500 (find-files "common/include" "\\.h$")))
501 (for-each (lambda (file)
502 (install-file file lib)
503 (delete-file file))
504 (find-files "." "\\.(a|so)$"))
505 (for-each (lambda (file)
506 (install-file file bin)
507 (delete-file file))
508 '("JxrDecApp" "JxrEncApp")))
509 #t)))))
510 (synopsis "Implementation of the JPEG XR standard")
511 (description "JPEG XR is an approved ISO/IEC International standard (its
512 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
513 (license
514 (license:non-copyleft
515 "file://Makefile"
516 "See the header of the Makefile in the distribution."))
517 (home-page "https://jxrlib.codeplex.com/")))
518
519 (define-public jpegoptim
520 (package
521 (name "jpegoptim")
522 (version "1.4.6")
523 (source (origin
524 (method url-fetch)
525 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
526 version ".tar.gz"))
527 (sha256 (base32
528 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
529 (build-system gnu-build-system)
530 (inputs `(("libjpeg" ,libjpeg-turbo)))
531 (arguments
532 '(#:tests? #f)) ; no tests
533 (synopsis "Optimize JPEG images")
534 (description
535 "jpegoptim provides lossless optimization (based on optimizing
536 the Huffman tables) and \"lossy\" optimization based on setting
537 maximum quality factor.")
538 (license license:gpl2+)
539 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
540
541 (define-public libicns
542 (package
543 (name "libicns")
544 (version "0.8.1")
545 (source (origin
546 (method url-fetch)
547 (uri (string-append
548 "mirror://sourceforge/icns/"
549 "libicns-" version ".tar.gz"))
550 (sha256
551 (base32
552 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
553 (build-system gnu-build-system)
554 (inputs
555 `(("libpng" ,libpng)
556 ("jasper" ,jasper)))
557 (arguments
558 `(#:tests? #t)) ; No tests.
559 (home-page "http://icns.sourceforge.net/")
560 (synopsis "Library for handling Mac OS icns resource files")
561 (description
562 "Libicns is a library for the manipulation of Mac OS IconFamily resource
563 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
564 convert between PNG and ICNS. @command{icns2png} will extract image files from
565 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
566 with .desktop files. Additionally, @command{icontainer2png} is provided for
567 extracting icontainer icon files.")
568 (license (list license:lgpl2.1+ ; libicns
569 license:lgpl2.0+ ; src/apidocs.*
570 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
571
572 (define-public libtiff
573 (package
574 (name "libtiff")
575 (version "4.1.0")
576 (source
577 (origin
578 (method url-fetch)
579 (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
580 version ".tar.gz"))
581 (sha256
582 (base32
583 "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"))))
584 (build-system gnu-build-system)
585 (outputs '("out"
586 "doc")) ;1.3 MiB of HTML documentation
587 (arguments
588 ;; Instead of using --docdir, this package has its own --with-docdir.
589 `(#:configure-flags (list (string-append "--with-docdir="
590 (assoc-ref %outputs "doc")
591 "/share/doc/"
592 ,name "-" ,version)
593 "--disable-static")))
594 (inputs `(("zlib" ,zlib)
595 ("libjpeg" ,libjpeg-turbo)))
596 (synopsis "Library for handling TIFF files")
597 (description
598 "Libtiff provides support for the Tag Image File Format (TIFF), a format
599 used for storing image data.
600 Included are a library, libtiff, for reading and writing TIFF and a small
601 collection of tools for doing simple manipulations of TIFF images.")
602 (license (license:non-copyleft "file://COPYRIGHT"
603 "See COPYRIGHT in the distribution."))
604 (home-page "http://www.simplesystems.org/libtiff/")))
605
606 (define-public leptonica
607 (package
608 (name "leptonica")
609 (version "1.74.4")
610 (source
611 (origin
612 (method git-fetch)
613 (uri (git-reference
614 (url "https://github.com/DanBloomberg/leptonica")
615 (commit version)))
616 (file-name (git-file-name name version))
617 (sha256
618 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
619 (build-system gnu-build-system)
620 (native-inputs
621 `(("gnuplot" ,gnuplot) ;needed for test suite
622 ("autoconf" ,autoconf)
623 ("automake" ,automake)
624 ("libtool" ,libtool)
625 ("pkg-config" ,pkg-config)))
626 (inputs
627 `(("giflib" ,giflib)
628 ("libjpeg" ,libjpeg-turbo)
629 ("libpng" ,libpng)
630 ("libtiff" ,libtiff)
631 ("libwebp" ,libwebp)
632 ("openjpeg" ,openjpeg)
633 ("zlib" ,zlib)))
634 (arguments
635 '(#:phases
636 (modify-phases %standard-phases
637 (add-after 'unpack 'patch-reg-wrapper
638 (lambda _
639 (substitute* "prog/reg_wrapper.sh"
640 ((" /bin/sh ")
641 (string-append " " (which "sh") " "))
642 (("which gnuplot")
643 "true"))
644 #t))
645 (add-after 'install 'provide-absolute-giflib-reference
646 (lambda* (#:key inputs outputs #:allow-other-keys)
647 (let ((out (assoc-ref outputs "out"))
648 (giflib (assoc-ref inputs "giflib")))
649 ;; Add an absolute reference to giflib to avoid propagation.
650 (with-directory-excursion (string-append out "/lib")
651 (substitute* '("liblept.la" "pkgconfig/lept.pc")
652 (("-lgif") (string-append "-L" giflib "/lib -lgif"))))
653 #t))))))
654 (home-page "http://www.leptonica.com/")
655 (synopsis "Library and tools for image processing and analysis")
656 (description
657 "Leptonica is a C library and set of command-line tools for efficient
658 image processing and image analysis operations. It supports rasterop, affine
659 transformations, binary and grayscale morphology, rank order, and convolution,
660 seedfill and connected components, image transformations combining changes in
661 scale and pixel depth, and pixelwise masking, blending, enhancement, and
662 arithmetic ops.")
663 (license license:bsd-2)))
664
665 (define-public jbig2dec
666 (package
667 (name "jbig2dec")
668 (version "0.18")
669 (source (origin
670 (method url-fetch)
671 (uri (string-append "https://github.com/ArtifexSoftware"
672 "/ghostpdl-downloads/releases/download"
673 "/gs951/" name "-" version ".tar.gz"))
674 (sha256
675 (base32
676 "0pigfw2v0ppvr0lbysm69gx0zsa5q2q92yrb8af2j3im6x97f6cy"))))
677 (build-system gnu-build-system)
678 (arguments '(#:configure-flags '("--disable-static")
679 #:phases (modify-phases %standard-phases
680 (add-before 'bootstrap 'force-bootstrap
681 (lambda _
682 ;; XXX: jbig2dec 0.18 was released with
683 ;; a broken configure script, so we
684 ;; recreate the build system here.
685 ;; Remove the autoconf inputs below
686 ;; when deleting this code.
687 (delete-file "configure")
688 (delete-file "autogen.sh")
689 #t)))))
690 (native-inputs
691 `(("autoconf" ,autoconf)
692 ("automake" ,automake)
693 ("libtool" ,libtool)
694 ("python" ,python-wrapper))) ;for tests
695 (synopsis "Decoder of the JBIG2 image compression format")
696 (description
697 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
698 monochrome) images at moderately high resolution, and in particular scanned
699 paper documents. In this domain it is very efficient, offering compression
700 ratios on the order of 100:1.
701
702 This is a decoder only implementation, and currently is in the alpha
703 stage, meaning it doesn't completely work yet. However, it is
704 maintaining parity with available encoders, so it is useful for real
705 work.")
706 (home-page "https://jbig2dec.com")
707 (license license:gpl2+)))
708
709 (define-public jbigkit
710 (package
711 (name "jbigkit")
712 (version "2.1")
713 (source
714 (origin
715 (method url-fetch)
716 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
717 "download/jbigkit-" version ".tar.gz"))
718 (sha256
719 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
720 (modules '((guix build utils)))
721 (snippet
722 '(begin
723 ;; Remove files without clear licence information.
724 (for-each delete-file-recursively
725 (list "contrib" "examples"))
726 #t))))
727 (build-system gnu-build-system)
728 (outputs (list "out" "pbmtools"))
729 (arguments
730 `(#:modules ((srfi srfi-26)
731 ,@%gnu-build-system-modules)
732 #:phases
733 (modify-phases %standard-phases
734 (delete 'configure) ; no configure script
735 (replace 'install ; no ‘make install’ target
736 (lambda* (#:key outputs #:allow-other-keys)
737 (let* ((out (assoc-ref outputs "out"))
738 (lib (string-append out "/lib"))
739 (include (string-append out "/include")))
740 (with-directory-excursion "libjbig"
741 (for-each (cut install-file <> include)
742 (find-files "." "\\.h$"))
743 (for-each (cut install-file <> lib)
744 (find-files "." "\\.a$")))
745 #t)))
746 (add-after 'install 'install-pbmtools
747 (lambda* (#:key outputs #:allow-other-keys)
748 (let* ((out (assoc-ref outputs "pbmtools"))
749 (bin (string-append out "/bin"))
750 (man1 (string-append out "/share/man/man1"))
751 (man5 (string-append out "/share/man/man5")))
752 (with-directory-excursion "pbmtools"
753 (for-each (cut install-file <> bin)
754 (list "jbgtopbm" "jbgtopbm85"
755 "pbmtojbg" "pbmtojbg85"))
756
757 (for-each (cut install-file <> man1)
758 (find-files "." "\\.1$"))
759 (for-each (cut install-file <> man5)
760 (find-files "." "\\.5$"))
761 #t)))))
762 #:test-target "test"
763 #:tests? #f)) ; tests depend on examples/
764 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
765 (synopsis "Lossless compression for bi-level high-resolution images")
766 (description
767 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
768 ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
769 black-and-white scanned documents. It is widely used in fax products, printer
770 firmware and drivers, document management systems, and imaging software.
771
772 This package provides a static C library of (de)compression functions and some
773 simple command-line converters similar to those provided by netpbm.
774
775 Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
776 options of the standard but has to keep the full uncompressed image in memory.
777 The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
778 memory management optimized for embedded and fax applications. It buffers
779 only a few lines of the uncompressed image in memory and is able to stream
780 images of initially unknown height.")
781 (license (list license:isc ; pbmtools/p?m.5
782 license:gpl2+)))) ; the rest
783
784 (define-public openjpeg-data
785 (package
786 (name "openjpeg-data")
787 (version "2020.05.19")
788 (source
789 (origin
790 (method git-fetch)
791 (uri
792 (git-reference
793 (url "https://github.com/uclouvain/openjpeg-data.git")
794 (commit "c5c4a8c")))
795 (file-name (git-file-name name version))
796 (sha256
797 (base32 "1jp84gbhw8q5b8mhc322ql9410hjf32w9hg10x4isfa9j59mnncb"))))
798 (build-system copy-build-system)
799 (synopsis "Test files for OpenJPEG")
800 (description "OpenJPEG-Data contains all files required to run the openjpeg
801 test suite, including conformance tests (following Rec. ITU-T T.803 | ISO/IEC
802 15444-4 procedures), non-regression tests and unit tests.")
803 (home-page "https://github.com/uclouvain/openjpeg-data")
804 (license license:bsd-2)))
805
806 (define-public openjpeg
807 (package
808 (name "openjpeg")
809 (version "2.3.1")
810 (source (origin
811 (method git-fetch)
812 (uri (git-reference
813 (url "https://github.com/uclouvain/openjpeg")
814 (commit (string-append "v" version))))
815 (file-name (git-file-name "openjpeg" version))
816 (sha256
817 (base32
818 "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb"))))
819 (build-system cmake-build-system)
820 (arguments
821 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
822 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
823 (inputs
824 `(("lcms" ,lcms)
825 ("libpng" ,libpng)
826 ("libtiff" ,libtiff)
827 ("zlib" ,zlib)))
828 (synopsis "JPEG 2000 codec")
829 (description
830 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
831 been developed in order to promote the use of JPEG 2000, the new
832 still-image compression standard from the Joint Photographic Experts
833 Group (JPEG).
834
835 In addition to the basic codec, various other features are under
836 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
837 an indexing tool useful for the JPIP protocol, JPWL-tools for
838 error-resilience, a Java-viewer for j2k-images, ...")
839 (home-page "https://github.com/uclouvain/openjpeg")
840 (license license:bsd-2)))
841
842 (define-public openjpeg-1
843 (package (inherit openjpeg)
844 (name "openjpeg")
845 (version "1.5.2")
846 (source
847 (origin
848 (method url-fetch)
849 (uri
850 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
851 name "-" version ".tar.gz"))
852 (sha256
853 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
854
855 (define-public giflib
856 (package
857 (name "giflib")
858 (version "5.2.1")
859 (source (origin
860 (method url-fetch)
861 (uri (string-append "mirror://sourceforge/giflib/giflib-"
862 version ".tar.gz"))
863 (sha256
864 (base32
865 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
866 (build-system gnu-build-system)
867 (outputs '("bin" ; utility programs
868 "out")) ; library
869 (arguments
870 '(#:make-flags (list "CC=gcc"
871 (string-append "PREFIX="
872 (assoc-ref %outputs "out"))
873 (string-append "BINDIR="
874 (assoc-ref %outputs "bin") "/bin"))
875 #:phases
876 (modify-phases %standard-phases
877 (add-after 'unpack 'disable-html-doc-gen
878 (lambda _
879 (substitute* "doc/Makefile"
880 (("^all: allhtml manpages") ""))
881 #t))
882 (delete 'configure)
883 (add-after 'install 'install-manpages
884 (lambda* (#:key outputs #:allow-other-keys)
885 (let* ((bin (assoc-ref outputs "bin"))
886 (man1dir (string-append bin "/share/man/man1")))
887 (mkdir-p man1dir)
888 (for-each (lambda (file)
889 (let ((base (basename file)))
890 (format #t "installing `~a' to `~a'~%"
891 base man1dir)
892 (copy-file file
893 (string-append
894 man1dir "/" base))))
895 (find-files "doc" "\\.1"))
896 #t))))))
897 (synopsis "Tools and library for working with GIF images")
898 (description
899 "GIFLIB is a library for reading and writing GIF images. It is API and
900 ABI compatible with libungif which was in wide use while the LZW compression
901 algorithm was patented. Tools are also included to convert, manipulate,
902 compose, and analyze GIF images.")
903 (home-page "http://giflib.sourceforge.net/")
904 (license license:x11)))
905
906 (define-public libuemf
907 (package
908 (name "libuemf")
909 (version "0.2.7")
910 (source (origin
911 (method url-fetch)
912 (uri (string-append "mirror://sourceforge/libuemf/libUEMF-"
913 version ".tar.gz"))
914 (sha256
915 (base32
916 "05djs99vqf067x81xfpskh7a66y5x7b4mmjavybcy7swnm0swg7v"))))
917 (build-system cmake-build-system)
918 (arguments
919 `(#:phases
920 (modify-phases %standard-phases
921 ;; Overriding CMAKE_INSTALL_PREFIX is not a good idea.
922 (add-after 'unpack 'fix-CMakeLists.txt
923 (lambda _
924 (substitute* "CMakeLists.txt"
925 ((".*SET\\(CMAKE_INSTALL_PREFIX.*") ""))
926 #t))
927 (delete 'check)
928 (add-after 'install 'check
929 (lambda* (#:key inputs outputs #:allow-other-keys)
930 (let* ((out (assoc-ref outputs "out"))
931 (bin (string-append out "/bin"))
932 (sources (string-append "../libUEMF-" ,version))
933 (drm-tools (assoc-ref inputs "drm-tools"))
934 (extract (string-append drm-tools "/bin/extract"))
935 (execinput (string-append drm-tools "/bin/execinput")))
936 (with-directory-excursion sources
937 (substitute* "testit.sh"
938 (("^EPATH=.*")
939 (format #f "EPATH=~a~%" bin))
940 (("`which diff`")
941 "diff")
942 (("^EXTRACT=.*")
943 (format #f "EXTRACT=~a~%" extract))
944 (("^EXECINPUT=.*")
945 (format #f "EXECINPUT=~a~%" execinput)))
946 (invoke "sh" "testit.sh"))))))))
947 (native-inputs `(("drm-tools" ,drm-tools))) ;for tests
948 (home-page "http://libuemf.sourceforge.net/")
949 (synopsis "Library for working with WFM, EMF and EMF+ images")
950 (description "The libUEMF library is a portable C99 implementation for
951 reading and writing @acronym{WFM, Windows Metafile}, @acronym{EMF, Enhanced
952 Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
953 (license license:gpl2+)))
954
955 (define-public libungif
956 (package
957 (name "libungif")
958 (version "4.1.4")
959 (source (origin
960 (method url-fetch)
961 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
962 "libungif-" version "/libungif-"
963 version ".tar.bz2"))
964 (sha256
965 (base32
966 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
967 (build-system gnu-build-system)
968 (inputs `(("perl" ,perl))) ;package ships some perl tools
969 (home-page "http://giflib.sourceforge.net/")
970 (synopsis "GIF decompression library")
971 (description
972 "libungif is the old GIF decompression library by the GIFLIB project.")
973 (license license:expat)))
974
975 (define-public imlib2
976 (package
977 (name "imlib2")
978 (version "1.6.1")
979 (source (origin
980 (method url-fetch)
981 (uri (string-append
982 "mirror://sourceforge/enlightenment/imlib2-src/" version
983 "/imlib2-" version ".tar.bz2"))
984 (sha256
985 (base32
986 "0v8n3dswx7rxqfd0q03xwc7j2w1mv8lv18rdxv487a1xw5vklfad"))))
987 (build-system gnu-build-system)
988 (native-inputs
989 `(("pkgconfig" ,pkg-config)))
990 (inputs
991 `(("bzip2" ,bzip2)
992 ("freetype" ,freetype)
993 ("giflib" ,giflib)
994 ("libid3tag" ,libid3tag)
995 ("libjpeg" ,libjpeg-turbo)
996 ("libpng" ,libpng)
997 ("libtiff" ,libtiff)
998 ("libx11" ,libx11)
999 ("libxext" ,libxext)
1000 ("libwebp" ,libwebp)))
1001 (home-page "https://sourceforge.net/projects/enlightenment/")
1002 (synopsis
1003 "Loading, saving, rendering and manipulating image files")
1004 (description
1005 "Imlib2 is a library that does image file loading and saving as well as
1006 rendering, manipulation, arbitrary polygon support, etc.
1007
1008 It does ALL of these operations FAST. Imlib2 also tries to be highly
1009 intelligent about doing them, so writing naive programs can be done easily,
1010 without sacrificing speed.
1011
1012 This is a complete rewrite over the Imlib 1.x series. The architecture is
1013 more modular, simple, and flexible.")
1014 (license license:imlib2)))
1015
1016 (define-public giblib
1017 (package
1018 (name "giblib")
1019 (version "1.2.4")
1020 (source (origin
1021 (method url-fetch)
1022 (uri (list
1023 (string-append
1024 "http://linuxbrit.co.uk/downloads/giblib-"
1025 version ".tar.gz")
1026 (string-append
1027 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
1028 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
1029 version ".tar.gz")
1030 (string-append
1031 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
1032 "files/giblib/giblib-" version ".tar.gz")))
1033 (sha256
1034 (base32
1035 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
1036 (build-system gnu-build-system)
1037 (inputs
1038 `(("libx11" ,libx11)
1039 ("imlib2" ,imlib2)))
1040 (home-page
1041 ;; This vanished page is universally accepted as giblib's home despite not
1042 ;; mentioning the package once.
1043 (string-append "https://web.archive.org/web/20140907071208/"
1044 "https://linuxbrit.co.uk/software/"))
1045 (synopsis "Wrapper library for imlib2")
1046 (description
1047 "Giblib is a simple library which wraps imlib2's context API, avoiding
1048 all the context_get/set calls, adds fontstyles to the truetype renderer and
1049 supplies a generic doubly-linked list and some string functions.")
1050 ;; This license removes a clause about X Consortium from the original
1051 ;; X11 license.
1052 (license (license:x11-style "file://COPYING"
1053 "See 'COPYING' in the distribution."))))
1054
1055 (define-public freeimage
1056 (package
1057 (name "freeimage")
1058 (version "3.18.0")
1059 (source (origin
1060 (method url-fetch)
1061 (uri (string-append
1062 "mirror://sourceforge/freeimage/Source%20Distribution/"
1063 version "/FreeImage"
1064 (string-concatenate (string-split version #\.))
1065 ".zip"))
1066 (sha256
1067 (base32
1068 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
1069 (modules '((guix build utils)))
1070 (snippet
1071 '(begin
1072 (for-each
1073 (lambda (dir)
1074 (delete-file-recursively (string-append "Source/" dir)))
1075 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
1076 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
1077 (patches
1078 (append
1079 (search-patches "freeimage-unbundle.patch")
1080 ;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility.
1081 (list (origin
1082 (method url-fetch)
1083 (uri "https://raw.githubusercontent.com/archlinux\
1084 /svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\
1085 /freeimage-libraw-0.20.patch")
1086 (file-name "freeimage-libraw-compat.patch")
1087 (sha256
1088 (base32
1089 "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
1090 (build-system gnu-build-system)
1091 (arguments
1092 '(#:phases
1093 (modify-phases %standard-phases
1094 ;; According to Fedora these files depend on private headers, but their
1095 ;; presence is required for building, so we replace them with empty files.
1096 (add-after 'unpack 'delete-unbuildable-files
1097 (lambda _
1098 (for-each (lambda (file)
1099 (delete-file file)
1100 (close (open file O_CREAT)))
1101 '("Source/FreeImage/PluginG3.cpp"
1102 "Source/FreeImageToolkit/JPEGTransform.cpp"))
1103 #t))
1104 ;; These scripts generate the Makefiles.
1105 (replace 'configure
1106 (lambda _
1107 (invoke "sh" "gensrclist.sh")
1108 (invoke "sh" "genfipsrclist.sh")))
1109 (add-before 'build 'patch-makefile
1110 (lambda* (#:key outputs #:allow-other-keys)
1111 (substitute* "Makefile.gnu"
1112 (("/usr") (assoc-ref outputs "out"))
1113 (("-o root -g root") ""))
1114 #t)))
1115 #:make-flags
1116 (list "CC=gcc"
1117 ;; We need '-fpermissive' for Source/FreeImage.h.
1118 ;; libjxr doesn't have a pkg-config file.
1119 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
1120 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
1121 #:tests? #f)) ; no check target
1122 (native-inputs
1123 `(("pkg-config" ,pkg-config)
1124 ("unzip" ,unzip)))
1125 (inputs
1126 `(("libjpeg" ,libjpeg-turbo)
1127 ("libjxr" ,libjxr)
1128 ("libpng" ,libpng)
1129 ("libraw" ,libraw)
1130 ("libtiff" ,libtiff)
1131 ("libwebp" ,libwebp)
1132 ("openexr" ,openexr)
1133 ("openjpeg" ,openjpeg)
1134 ("zlib" ,zlib)))
1135 (synopsis "Library for handling popular graphics image formats")
1136 (description
1137 "FreeImage is a library for developers who would like to support popular
1138 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1139 (license license:gpl2+)
1140 (home-page "http://freeimage.sourceforge.net")))
1141
1142 (define-public vigra
1143 (package
1144 (name "vigra")
1145 (version "1.11.1")
1146 (source
1147 (origin
1148 (method url-fetch)
1149 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
1150 "Version-" (string-join (string-split version #\.) "-")
1151 "/vigra-" version "-src.tar.gz"))
1152 (patches (search-patches "vigra-python-compat.patch"))
1153 (sha256 (base32
1154 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
1155 (build-system cmake-build-system)
1156 (inputs
1157 `(("boost" ,boost)
1158 ("fftw" ,fftw)
1159 ("fftwf" ,fftwf)
1160 ("hdf5" ,hdf5)
1161 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
1162 ; to create a configure-flag
1163 ("libjpeg" ,libjpeg-turbo)
1164 ("libpng" ,libpng)
1165 ("libtiff" ,libtiff)
1166 ("openexr" ,openexr)
1167 ("python" ,python-wrapper)
1168 ("python-numpy" ,python-numpy)
1169 ("zlib" ,zlib)))
1170 (native-inputs
1171 `(("doxygen" ,doxygen)
1172 ("python-nose" ,python-nose)
1173 ("sphinx" ,python-sphinx)))
1174 (arguments
1175 `(#:test-target "check"
1176 #:phases
1177 (modify-phases %standard-phases
1178 (add-after 'unpack 'disable-broken-tests
1179 (lambda _
1180 ;; See https://github.com/ukoethe/vigra/issues/432
1181 (substitute* "test/fourier/CMakeLists.txt"
1182 (("VIGRA_ADD_TEST.*") ""))
1183 ;; This test fails with Numpy 1.15:
1184 ;; <https://github.com/ukoethe/vigra/issues/436>.
1185 (substitute* "vigranumpy/test/CMakeLists.txt"
1186 (("test1\\.py") ""))
1187 #t)))
1188 #:configure-flags
1189 (list "-Wno-dev" ; suppress developer mode with lots of warnings
1190 (string-append "-DVIGRANUMPY_INSTALL_DIR="
1191 (assoc-ref %outputs "out")
1192 "/lib/python"
1193 ,(version-major+minor (package-version python))
1194 "/site-packages")
1195 ;; OpenEXR is not enabled by default.
1196 "-DWITH_OPENEXR=1"
1197 ;; Fix rounding error on 32-bit machines
1198 "-DCMAKE_C_FLAGS=-ffloat-store"
1199 ;; The header files of ilmbase are not found when included
1200 ;; by the header files of openexr, and an explicit flag
1201 ;; needs to be set.
1202 (string-append "-DCMAKE_CXX_FLAGS=-I"
1203 (assoc-ref %build-inputs "ilmbase")
1204 "/include/OpenEXR"
1205 " -ffloat-store"))))
1206 (synopsis "Computer vision library")
1207 (description
1208 "VIGRA stands for Vision with Generic Algorithms. It is an image
1209 processing and analysis library that puts its main emphasis on customizable
1210 algorithms and data structures. It is particularly strong for
1211 multi-dimensional image processing.")
1212 (license license:expat)
1213 (home-page "https://ukoethe.github.io/vigra/")))
1214
1215 (define-public vigra-c
1216 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1217 (revision "1"))
1218 (package
1219 (name "vigra-c")
1220 (version (git-version "0.0.0" revision commit))
1221 (home-page "https://github.com/BSeppke/vigra_c")
1222 (source (origin
1223 (method git-fetch)
1224 (uri (git-reference
1225 (url home-page)
1226 (commit commit)))
1227 (sha256
1228 (base32
1229 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
1230 (file-name (git-file-name name version))))
1231 (build-system cmake-build-system)
1232 (arguments
1233 `(#:tests? #f)) ; No test target.
1234 (native-inputs
1235 `(("doxygen" ,doxygen)))
1236 (inputs
1237 `(("fftw" ,fftw)
1238 ("fftwf" ,fftwf)
1239 ("hdf5" ,hdf5)
1240 ("vigra" ,vigra)))
1241 (synopsis "C interface to the VIGRA computer vision library")
1242 (description
1243 "This package provides a C interface to the VIGRA C++ computer vision
1244 library. It is designed primarily to ease the implementation of higher-level
1245 language bindings to VIGRA.")
1246 (license license:expat))))
1247
1248 (define-public libwebp
1249 (package
1250 (name "libwebp")
1251 (version "1.1.0")
1252 (source
1253 (origin
1254 ;; No tarballs are provided for >0.6.1.
1255 (method git-fetch)
1256 (uri (git-reference
1257 (url "https://chromium.googlesource.com/webm/libwebp")
1258 (commit (string-append "v" version))))
1259 (file-name (git-file-name name version))
1260 (sha256
1261 (base32
1262 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
1263 (build-system gnu-build-system)
1264 (inputs
1265 `(("freeglut" ,freeglut)
1266 ("giflib" ,giflib)
1267 ("libjpeg" ,libjpeg-turbo)
1268 ("libpng" ,libpng)
1269 ("libtiff" ,libtiff)))
1270 (native-inputs
1271 `(("autoconf" ,autoconf)
1272 ("automake" ,automake)
1273 ("libtool" ,libtool)))
1274 (arguments
1275 '(#:configure-flags '("--enable-libwebpmux"
1276 "--enable-libwebpdemux"
1277 "--enable-libwebpdecoder"
1278 "--disable-static")))
1279 (home-page "https://developers.google.com/speed/webp/")
1280 (synopsis "Lossless and lossy image compression")
1281 (description
1282 "WebP is a new image format that provides lossless and lossy compression
1283 for images. WebP lossless images are 26% smaller in size compared to
1284 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1285 equivalent SSIM index. WebP supports lossless transparency (also known as
1286 alpha channel) with just 22% additional bytes. Transparency is also supported
1287 with lossy compression and typically provides 3x smaller file sizes compared
1288 to PNG when lossy compression is acceptable for the red/green/blue color
1289 channels.")
1290 (license license:bsd-3)))
1291
1292 (define-public libmng
1293 (package
1294 (name "libmng")
1295 (version "2.0.3")
1296 (source (origin
1297 (method url-fetch)
1298 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1299 version "/" name "-" version ".tar.xz"))
1300 (sha256
1301 (base32
1302 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1303 (build-system gnu-build-system)
1304 (propagated-inputs
1305 ;; These are all in the 'Libs.private' field of libmng.pc.
1306 `(("lcms" ,lcms)
1307 ("libjpeg" ,libjpeg-turbo)
1308 ("zlib" ,zlib)))
1309 (home-page "https://www.libmng.com/")
1310 (synopsis "Library for handling MNG files")
1311 (description
1312 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1313 (license license:bsd-3)))
1314
1315 (define-public exiv2
1316 (package
1317 (name "exiv2")
1318 (version "0.27.3")
1319 (source
1320 (origin
1321 (method url-fetch)
1322 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
1323 "-Source.tar.gz"))
1324 (sha256
1325 (base32 "0y77wfadjsrcxijdqgkr3q88b6mm9y3rg8kqsmaig8iah49md7x7"))))
1326 (build-system cmake-build-system)
1327 (arguments '(#:tests? #f)) ; no test suite
1328 (propagated-inputs
1329 `(("expat" ,expat)
1330 ("zlib" ,zlib)))
1331 (home-page "https://www.exiv2.org/")
1332 (synopsis "Library and command-line utility to manage image metadata")
1333 (description
1334 "Exiv2 is a C++ library and a command line utility to manage image
1335 metadata. It provides fast and easy read and write access to the Exif, IPTC
1336 and XMP metadata of images in various formats.")
1337
1338 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1339 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1340 ;; The core is GPLv2+:
1341 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1342 (license license:gpl2+)))
1343
1344 (define-public exiv2-0.26
1345 (package
1346 (inherit exiv2)
1347 (version "0.26")
1348 (source (origin
1349 (method url-fetch)
1350 (uri (list (string-append "https://www.exiv2.org/builds/exiv2-"
1351 version "-trunk.tar.gz")
1352 (string-append "https://www.exiv2.org/exiv2-"
1353 version ".tar.gz")
1354 (string-append "https://fossies.org/linux/misc/exiv2-"
1355 version ".tar.gz")))
1356 (patches (search-patches "exiv2-CVE-2017-14860.patch"
1357 "exiv2-CVE-2017-14859-14862-14864.patch"))
1358 (sha256
1359 (base32
1360 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
1361 (build-system gnu-build-system)
1362 (arguments '(#:tests? #f)) ; no `check' target
1363 (propagated-inputs
1364 `(("expat" ,expat)
1365 ("zlib" ,zlib)))
1366 (native-inputs
1367 `(("intltool" ,intltool)))
1368
1369 ;; People should rely on the newer version, so don't expose it.
1370 (properties `((hidden? . #t)))))
1371
1372 (define-public devil
1373 (package
1374 (name "devil")
1375 (version "1.8.0")
1376 (source (origin
1377 (method url-fetch)
1378 (uri (string-append "http://downloads.sourceforge.net/openil/"
1379 "DevIL-" version ".tar.gz"))
1380 (sha256
1381 (base32
1382 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1383 (build-system cmake-build-system)
1384 (arguments
1385 '(;; XXX: Not supported in the released CMakeLists.txt.
1386 ;; Enable this for > 1.8.0.
1387 #:tests? #f
1388 #:phases
1389 (modify-phases %standard-phases
1390 (add-before 'configure 'change-directory
1391 (lambda _ (chdir "DevIL") #t)))))
1392 (native-inputs
1393 `(("pkg-config" ,pkg-config)))
1394 (inputs
1395 `(("lcms" ,lcms)
1396 ("libjpeg" ,libjpeg-turbo)
1397 ("libmng" ,libmng)
1398 ("libpng" ,libpng)
1399 ("libtiff" ,libtiff)
1400 ("openexr" ,openexr)
1401 ("zlib" ,zlib)))
1402 (synopsis "Library for manipulating many image formats")
1403 (description "Developer's Image Library (DevIL) is a library to develop
1404 applications with support for many types of images. DevIL can load, save,
1405 convert, manipulate, filter and display a wide variety of image formats.")
1406 (home-page "http://openil.sourceforge.net")
1407 (license license:lgpl2.1+)))
1408
1409 (define-public jasper
1410 (package
1411 (name "jasper")
1412 (version "2.0.19")
1413 (source (origin
1414 (method git-fetch)
1415 (uri (git-reference
1416 (url "https://github.com/mdadams/jasper")
1417 (commit (string-append "version-" version))))
1418 (file-name (git-file-name name version))
1419 (sha256
1420 (base32
1421 "036rcr0wkz9gzmvk1jb96piznk0c0bwxgf31z1zrlg8js4zl1n84"))))
1422 (build-system cmake-build-system)
1423 (inputs `(("libjpeg" ,libjpeg-turbo)))
1424 (synopsis "JPEG-2000 library")
1425 (description "The JasPer Project is an initiative to provide a reference
1426 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1427 ISO/IEC 15444-1).")
1428 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1429 (license (license:x11-style "file://LICENSE"))))
1430
1431 (define-public zimg
1432 (package
1433 (name "zimg")
1434 (version "2.9.3")
1435 (source
1436 (origin
1437 (method git-fetch)
1438 (uri (git-reference
1439 (url "https://github.com/sekrit-twc/zimg")
1440 (commit (string-append "release-" version))))
1441 (file-name (git-file-name name version))
1442 (sha256
1443 (base32 "1dqyrq3p8bkgvj4ci50ac342hjnhyz6xxvhiwp7wpi3v3nbj7s02"))))
1444 (build-system gnu-build-system)
1445 (native-inputs
1446 `(("autoconf" ,autoconf)
1447 ("automake" ,automake)
1448 ("libtool" ,libtool)))
1449 (synopsis "Scaling, colorspace conversion, and dithering library")
1450 (description "Zimg implements the commonly required image processing basics
1451 of scaling, colorspace conversion, and depth conversion. A simple API enables
1452 conversion between any supported formats to operate with minimal knowledge from
1453 the programmer.")
1454 (home-page "https://github.com/sekrit-twc/zimg")
1455 ;; test/extra/ contains musl-libm,
1456 ;; which is MIT/expat licensed, but only used for tests
1457 (license license:wtfpl2)))
1458
1459 (define-public perceptualdiff
1460 (package
1461 (name "perceptualdiff")
1462 (version "1.3")
1463 (source
1464 (origin
1465 (method git-fetch)
1466 (uri (git-reference
1467 (url "https://github.com/myint/perceptualdiff")
1468 (commit (string-append "v" version))))
1469 (file-name (git-file-name name version))
1470 (sha256
1471 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
1472 (build-system cmake-build-system)
1473 (inputs `(("freeimage" ,freeimage)))
1474 (arguments
1475 '(#:phases (modify-phases %standard-phases
1476 (add-after 'unpack 'fix-tests
1477 ;; cmake-build-system uses a build/ directory outside
1478 ;; of the source tree, one level higher than expected
1479 (lambda _
1480 (substitute* "test/run_tests.bash"
1481 (("../build") "../../build"))
1482 #t)))))
1483 (home-page "https://github.com/myint/perceptualdiff")
1484 (synopsis "Perceptual image comparison utility")
1485 (description "PerceptualDiff visually compares two images to determine
1486 whether they look alike. It uses a computational model of the human visual
1487 system to detect similarities. This allows it too see beyond irrelevant
1488 differences in file encoding, image quality, and other small variations.")
1489 (license license:gpl2+)))
1490
1491 (define-public steghide
1492 (package
1493 (name "steghide")
1494 (version "0.5.1")
1495 (source (origin
1496 (method url-fetch)
1497 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1498 version "/steghide-" version ".tar.bz2"))
1499 (sha256
1500 (base32
1501 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1502 (patches (list (search-patch "steghide-fixes.patch")))))
1503 (build-system gnu-build-system)
1504 (native-inputs
1505 `(("gettext" ,gettext-minimal)
1506 ("libtool" ,libtool)
1507 ("perl" ,perl))) ;for tests
1508 (inputs
1509 `(("libmhash" ,libmhash)
1510 ("libmcrypt" ,libmcrypt)
1511 ("libjpeg" ,libjpeg-turbo)
1512 ("zlib" ,zlib)))
1513 (arguments
1514 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1515
1516 #:phases (modify-phases %standard-phases
1517 (add-before 'configure 'set-perl-search-path
1518 (lambda _
1519 ;; Work around "dotless @INC" build failure.
1520 (setenv "PERL5LIB"
1521 (string-append (getcwd) "/tests:"
1522 (getenv "PERL5LIB")))
1523 #t)))))
1524 (home-page "http://steghide.sourceforge.net")
1525 (synopsis "Image and audio steganography")
1526 (description
1527 "Steghide is a program to hide data in various kinds of image and audio
1528 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1529 changed, making the embedding resistant against first-order statistical tests.")
1530 (license license:gpl2+)))
1531
1532 (define-public stb-image-for-extempore
1533 (let ((revision "1")
1534 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1535 (package
1536 (name "stb-image-for-extempore")
1537 (version (string-append "0-" revision "." (string-take commit 9)))
1538 (source
1539 (origin (method git-fetch)
1540 (uri (git-reference
1541 (url "https://github.com/extemporelang/stb")
1542 (commit commit)))
1543 (sha256
1544 (base32
1545 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1546 (file-name (string-append name "-" version "-checkout"))))
1547 (build-system cmake-build-system)
1548 (arguments `(#:tests? #f)) ; no tests included
1549 ;; Extempore refuses to build on architectures other than x86_64
1550 (supported-systems '("x86_64-linux"))
1551 (home-page "https://github.com/extemporelang/stb")
1552 (synopsis "Image library for Extempore")
1553 (description
1554 "This package is a collection of assorted single-file libraries. Of
1555 all included libraries only the image loading and decoding library is
1556 installed as @code{stb_image}.")
1557 (license license:public-domain))))
1558
1559 (define-public optipng
1560 (package
1561 (name "optipng")
1562 (version "0.7.7")
1563 (source
1564 (origin
1565 (method url-fetch)
1566 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1567 version ".tar.gz"))
1568 (sha256
1569 (base32
1570 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1571 (modules '((guix build utils)))
1572 (snippet
1573 '(begin
1574 (delete-file-recursively "src/libpng")
1575 (delete-file-recursively "src/zlib")
1576 #t))))
1577 (build-system gnu-build-system)
1578 (inputs
1579 `(("libpng" ,libpng)
1580 ("zlib" ,zlib)))
1581 (arguments
1582 '(#:phases
1583 (modify-phases %standard-phases
1584 (replace 'configure
1585 (lambda* (#:key outputs #:allow-other-keys)
1586 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1587 (invoke "sh" "configure"
1588 (string-append "--prefix=" (assoc-ref outputs "out"))
1589 "-with-system-libs")
1590 #t)))))
1591 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1592 (description "OptiPNG is a PNG optimizer that recompresses image
1593 files to a smaller size, without losing any information. This program
1594 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1595 PNG, and performs PNG integrity checks and corrections.")
1596 (home-page "http://optipng.sourceforge.net/")
1597 (license license:zlib)))
1598
1599 (define-public pngsuite
1600 (package
1601 (name "pngsuite")
1602 (version "2017jul19")
1603 (source
1604 (origin
1605 (method url-fetch/tarbomb)
1606 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
1607 version ".tgz"))
1608 (sha256
1609 (base32
1610 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
1611 (build-system gnu-build-system)
1612 (arguments
1613 '(#:tests? #f ; there is no test target
1614 #:license-file-regexp "PngSuite.LICENSE"
1615 #:phases
1616 (modify-phases %standard-phases
1617 (replace 'install
1618 (lambda* (#:key outputs #:allow-other-keys)
1619 (let ((out (assoc-ref outputs "out")))
1620 (copy-recursively "." (string-append out "/"))
1621 #t)))
1622 (delete 'build)
1623 (delete 'configure))))
1624 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
1625 (synopsis "Example PNGs for use in test suites")
1626 (description "Collection of graphics images created to test PNG
1627 applications like viewers, converters and editors. As far as that is
1628 possible, all formats supported by the PNG standard are represented.")
1629 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1630 use, copy, modify and distribute these images for any purpose and without fee
1631 is hereby granted."))))
1632
1633 (define-public libjpeg-turbo
1634 (package
1635 (name "libjpeg-turbo")
1636 (version "2.0.4")
1637 (replacement libjpeg-turbo/fixed)
1638 (source (origin
1639 (method url-fetch)
1640 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1641 version "/libjpeg-turbo-" version ".tar.gz"))
1642 (sha256
1643 (base32
1644 "01ill8bgjyk582wipx7sh7gj2nidylpbzvwhx0wkcm6mxx3qbp9k"))))
1645 (build-system cmake-build-system)
1646 (native-inputs
1647 `(("nasm" ,nasm)))
1648 (arguments
1649 `(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1650 "-DENABLE_STATIC=0"
1651 ;; djpeg-shared-3x2-float-prog-cmp fails on 32-bit PPC.
1652 ,@(if (string=? "powerpc-linux" (%current-system))
1653 `("-DFLOATTEST=NO")
1654 '())
1655 ;; The build system probes for the current CPU, but
1656 ;; that fails when cross-compiling.
1657 ,@(let ((target (%current-target-system)))
1658 (if target
1659 (cond
1660 ((string-prefix? "arm" target)
1661 `("-DCMAKE_SYSTEM_PROCESSOR=arm"))
1662 ((string-prefix? "aarch64" target)
1663 `("-DCMAKE_SYSTEM_PROCESSOR=aarch64"))
1664 ((string-prefix? "i686" target)
1665 `("-DCMAKE_SYSTEM_PROCESSOR=x86"))
1666 ((string-prefix? "x86_64" target)
1667 `("-DCMAKE_SYSTEM_PROCESSOR=x86_64"))
1668 ;; 32-bit and 64-bit
1669 ((string-prefix? "powerpc" target)
1670 `("-DCMAKE_SYSTEM_PROCESSOR=powerpc"))
1671 (else '()))
1672 '())))
1673 ,@(if (%current-target-system)
1674 '()
1675 ;; Use a special "bootstrap" CMake for the native build to work
1676 ;; around a circular dependency between CMake and this package.
1677 `(#:cmake ,cmake-bootstrap))))
1678 (home-page "https://libjpeg-turbo.org/")
1679 (synopsis "SIMD-accelerated JPEG image handling library")
1680 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1681 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1682 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1683 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1684 a significant amount.
1685 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1686 but more straightforward TurboJPEG API, and provides a full-featured Java
1687 interface. It supports color space extensions that allow it to compress from
1688 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1689 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1690 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1691 license:ijg ;the libjpeg library and associated tools
1692 license:zlib)))) ;the libjpeg-turbo SIMD extensions
1693
1694 (define libjpeg-turbo/fixed
1695 (package
1696 (inherit libjpeg-turbo)
1697 (version "2.0.5")
1698 (source (origin
1699 (method url-fetch)
1700 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1701 version "/libjpeg-turbo-" version ".tar.gz"))
1702 (sha256
1703 (base32
1704 "0pbv6pc97kbj7ib31qcwi7lnmm9xg5y3b11aasmkhfjvf7rgdy0n"))))))
1705
1706 (define-deprecated libjpeg libjpeg-turbo)
1707 (export libjpeg)
1708
1709 (define-public niftilib
1710 (package
1711 (name "niftilib")
1712 (version "2.0.0")
1713 (source (origin
1714 (method url-fetch)
1715 (uri (list (string-append "mirror://sourceforge/niftilib/"
1716 "nifticlib/nifticlib_"
1717 (string-join (string-split version #\.) "_")
1718 "/nifticlib-" version ".tar.gz")))
1719 (sha256
1720 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1721 (build-system gnu-build-system)
1722 (arguments
1723 '(#:tests? #f ; there is no test target
1724 #:parallel-build? #f ; not supported
1725 #:make-flags
1726 (list "SHELL=bash"
1727 (string-append "ZLIB_INC="
1728 (assoc-ref %build-inputs "zlib") "/include")
1729 ;; Append "-fPIC" to CFLAGS.
1730 (string-append "CFLAGS="
1731 "-Wall -ansi -pedantic -fPIC"))
1732 #:phases
1733 (modify-phases %standard-phases
1734 (replace 'install
1735 (lambda* (#:key outputs #:allow-other-keys)
1736 (let ((out (assoc-ref outputs "out")))
1737 (for-each
1738 (lambda (dir)
1739 (copy-recursively dir (string-append out "/" dir)))
1740 '("bin" "lib" "include")))
1741 #t))
1742 (delete 'configure))))
1743 (inputs
1744 `(("zlib" ,zlib)))
1745 (synopsis "Library for reading and writing files in the nifti-1 format")
1746 (description "Niftilib is a set of i/o libraries for reading and writing
1747 files in the nifti-1 data format - a binary file format for storing
1748 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1749 (fMRI) brain images.")
1750 (home-page "http://niftilib.sourceforge.net")
1751 (license license:public-domain)))
1752
1753 (define-public gpick
1754 (package
1755 (name "gpick")
1756 (version "0.2.5")
1757 (source (origin
1758 (method git-fetch)
1759 (uri (git-reference
1760 (url "https://github.com/thezbyg/gpick")
1761 (commit (string-append name "-" version))))
1762 (file-name (git-file-name name version))
1763 (sha256
1764 (base32
1765 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
1766 (build-system scons-build-system)
1767 (native-inputs
1768 `(("boost" ,boost)
1769 ("gettext" ,gettext-minimal)
1770 ("pkg-config" ,pkg-config)))
1771 (inputs
1772 `(("expat" ,expat)
1773 ("gtk2" ,gtk+-2)
1774 ("lua" ,lua-5.2)))
1775 (arguments
1776 `(#:tests? #f
1777 #:scons ,scons-python2
1778 #:scons-flags (list (string-append "DESTDIR=" %output))
1779 #:phases
1780 (modify-phases %standard-phases
1781 (add-before 'build 'fix-lua-reference
1782 (lambda _
1783 (substitute* "SConscript"
1784 (("lua5.2") "lua-5.2"))
1785 #t)))))
1786 (home-page "http://www.gpick.org/")
1787 (synopsis "Color picker")
1788 (description "Gpick is an advanced color picker and palette editing tool.")
1789 (license license:bsd-3)))
1790
1791 (define-public libiptcdata
1792 (package
1793 (name "libiptcdata")
1794 (version "1.0.5")
1795 (source (origin
1796 (method url-fetch)
1797 (uri (string-append "https://github.com/ianw/libiptcdata"
1798 "/releases/download/release_"
1799 (string-join (string-split version #\.) "_")
1800 "/" name "-" version ".tar.gz"))
1801 (sha256
1802 (base32
1803 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
1804 (build-system gnu-build-system)
1805 (home-page "https://github.com/ianw/libiptcdata")
1806 (synopsis "IPTC metadata manipulation library")
1807 (description
1808 "Libiptcdata is a C library for manipulating the International Press
1809 Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
1810 such as images. This metadata can include captions and keywords, often used by
1811 popular photo management applications. The library provides routines for
1812 parsing, viewing, modifying, and saving this metadata.")
1813 (license license:lgpl2.0+)))
1814
1815 (define-public flameshot
1816 (package
1817 (name "flameshot")
1818 (version "0.5.1")
1819 (source
1820 (origin
1821 (method git-fetch)
1822 (uri (git-reference
1823 (url "https://github.com/lupoDharkael/flameshot")
1824 (commit (string-append "v" version))))
1825 (file-name (git-file-name name version))
1826 (sha256
1827 (base32
1828 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
1829 (build-system gnu-build-system)
1830 (native-inputs
1831 `(("qttools" ,qttools)))
1832 (inputs
1833 `(("qtbase" ,qtbase)))
1834 (arguments
1835 `(#:tests? #f ; no tests
1836 #:phases
1837 (modify-phases %standard-phases
1838 (replace 'configure
1839 (lambda* (#:key outputs #:allow-other-keys)
1840 (invoke "qmake"
1841 "CONFIG+=packaging"
1842 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1843 "PREFIX=/"))))))
1844 (home-page "https://github.com/lupoDharkael/flameshot")
1845 (synopsis "Powerful yet simple to use screenshot software")
1846 (description "Flameshot is a screenshot program.
1847 Features:
1848
1849 @itemize
1850 @item Customizable appearance.
1851 @item Easy to use.
1852 @item In-app screenshot edition.
1853 @item DBus interface.
1854 @item Upload to Imgur.
1855 @end itemize\n")
1856 (license license:gpl3+)))
1857
1858 (define-public gifsicle
1859 (package
1860 (name "gifsicle")
1861 (version "1.92")
1862 (source
1863 (origin
1864 (method url-fetch)
1865 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
1866 version ".tar.gz"))
1867 (sha256
1868 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
1869 (build-system gnu-build-system)
1870 (arguments
1871 '(#:phases
1872 (modify-phases %standard-phases
1873 (add-before 'check 'patch-tests
1874 (lambda _
1875 (substitute* "test/testie"
1876 (("/usr/bin/perl")
1877 (which "perl"))
1878 (("/bin/sh")
1879 (which "sh"))
1880 (("/bin/rm")
1881 (which "rm")))
1882 #t)))))
1883 (native-inputs `(("perl" ,perl))) ; only for tests
1884 (inputs `(("libx11" ,libx11)))
1885 (home-page "https://www.lcdf.org/gifsicle/")
1886 (synopsis "Edit GIF images and animations")
1887 (description "Gifsicle is a command-line GIF image manipulation tool that:
1888
1889 @itemize
1890 @item Provides a batch mode for changing GIFs in place.
1891 @item Prints detailed information about GIFs, including comments.
1892 @item Control over interlacing, comments, looping, transparency, etc.
1893 @item Creates well-behaved GIFs: removes redundant colors, only uses local color
1894 tables, etc.
1895 @item Shrinks colormaps and change images to use the Web-safe palette.
1896 @item Optimizes GIF animations, or unoptimizes them for easier editing.
1897 @end itemize
1898
1899 Two other programs are included with Gifsicle: @command{gifview} is a
1900 lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1901 identical visual appearance.")
1902 (license license:gpl2+)))
1903
1904 ;; 1.0.7 is buggy and reverted in git repository.
1905 (define-public jp2a
1906 (package
1907 (name "jp2a")
1908 (version "1.0.6")
1909 (source
1910 (origin
1911 (method url-fetch)
1912 (uri (string-append "mirror://debian/pool/main/j/jp2a/jp2a_"
1913 version ".orig.tar.gz"))
1914 (sha256
1915 (base32
1916 "076frk3pa16s4r1b10zgy81vdlz0385zh3ykbnkaij25jn5aqc09"))))
1917 (build-system gnu-build-system)
1918 (inputs
1919 `(("curl" ,curl)
1920 ("libjpeg" ,libjpeg-turbo)
1921 ("ncurses" ,ncurses)))
1922 (home-page "https://csl.name/jp2a/")
1923 (synopsis "Convert JPEG images to ASCII")
1924 (description
1925 "Jp2a is a small utility that converts JPEG images to ASCII.")
1926 (license license:gpl2)))
1927
1928 (define-public grim
1929 (package
1930 (name "grim")
1931 (version "1.3.1")
1932 (source
1933 (origin
1934 (method git-fetch)
1935 (uri (git-reference
1936 (url "https://github.com/emersion/grim")
1937 (commit (string-append "v" version))))
1938 (file-name (git-file-name name version))
1939 (sha256
1940 (base32 "0fjmjq0ws9rlblkcqxxw2lv7zvvyi618jqzlnz5z9zb477jwdfib"))))
1941 (build-system meson-build-system)
1942 (native-inputs `(("pkg-config" ,pkg-config)
1943 ("scdoc" ,scdoc)))
1944 (inputs `(("cairo" ,cairo)
1945 ("libjpeg-turbo" ,libjpeg-turbo)
1946 ("wayland" ,wayland)
1947 ("wayland-protocols" ,wayland-protocols)))
1948 (home-page "https://github.com/emersion/grim")
1949 (synopsis "Create screenshots from a Wayland compositor")
1950 (description "grim can create screenshots from a Wayland compositor.")
1951 ;; MIT license.
1952 (license license:expat)))
1953
1954 (define-public slurp
1955 (package
1956 (name "slurp")
1957 (version "1.2.0")
1958 (source
1959 (origin
1960 (method git-fetch)
1961 (uri (git-reference
1962 (url "https://github.com/emersion/slurp")
1963 (commit (string-append "v" version))))
1964 (file-name (git-file-name name version))
1965 (sha256
1966 (base32 "0580m6kaiilgsrcj608r837r37sl6a25y7w21p7d6ij20fs3gvg1"))))
1967 (build-system meson-build-system)
1968 (native-inputs `(("pkg-config" ,pkg-config)))
1969 (inputs `(("cairo" ,cairo)
1970 ("scdoc" ,scdoc)
1971 ("wayland" ,wayland)
1972 ("wayland-protocols" ,wayland-protocols)))
1973 (home-page "https://github.com/emersion/slurp")
1974 (synopsis "Select a region in a Wayland compositor")
1975 (description "Slurp can select a region in a Wayland compositor and print it
1976 to the standard output. It works well together with grim.")
1977 ;; MIT license.
1978 (license license:expat)))
1979
1980 (define-public sng
1981 (package
1982 (name "sng")
1983 (version "1.1.0")
1984 (source
1985 (origin
1986 (method url-fetch)
1987 (uri (string-append "mirror://sourceforge/sng/sng-"
1988 version ".tar.gz"))
1989 (sha256
1990 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
1991 (build-system gnu-build-system)
1992 (arguments
1993 `(#:phases
1994 (modify-phases %standard-phases
1995 (add-before 'check 'link-pngsuite
1996 ;; tests expect pngsuite in source dir
1997 (lambda* (#:key inputs #:allow-other-keys)
1998 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
1999 #t)))
2000 #:configure-flags
2001 (list (string-append "--with-rgbtxt="
2002 (assoc-ref %build-inputs "xorg-rgb")
2003 "/share/X11/rgb.txt"))))
2004 (inputs `(("xorg-rgb" ,xorg-rgb)
2005 ("libpng" ,libpng)))
2006 (native-inputs `(("pngsuite" ,pngsuite)))
2007 (home-page "http://sng.sourceforge.net")
2008 (synopsis "Markup language for representing PNG contents")
2009 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
2010 specifically to represent the entire contents of a PNG (Portable Network
2011 Graphics) file in an editable form. Thus, SNGs representing elaborate
2012 graphics images and ancillary chunk data can be readily generated or modified
2013 using only text tools.
2014
2015 SNG is implemented by a compiler/decompiler called sng that
2016 losslessly translates between SNG and PNG.")
2017 (license license:zlib)))
2018
2019 (define-public lodepng
2020 ;; There are no tags in the repository, so we take the version as defined in
2021 ;; lodepng.cpp.
2022 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
2023 (revision "1")
2024 (version "20200215"))
2025 (package
2026 (name "lodepng")
2027 (version (git-version version revision commit))
2028 (source (origin
2029 (method git-fetch)
2030 (uri (git-reference
2031 (url "https://github.com/lvandeve/lodepng")
2032 (commit commit)))
2033 (sha256
2034 (base32
2035 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
2036 (file-name (git-file-name name version))))
2037 (build-system gnu-build-system)
2038 (arguments
2039 '(#:phases
2040 (modify-phases %standard-phases
2041 (delete 'configure)
2042 (replace 'build
2043 (lambda _
2044 (setenv "CXXFLAGS" "-fPIC")
2045 (invoke "make" "lodepng.o")
2046 (invoke "make" "lodepng_util.o")
2047 (invoke "g++" "-fPIC" "-O3"
2048 "-o" "liblodepng.so"
2049 "-shared" "lodepng.o" "lodepng_util.o")
2050 #t))
2051 (replace 'check
2052 (lambda _
2053 (invoke "make" "unittest")
2054 (invoke "./unittest")
2055 #t))
2056 (replace 'install
2057 (lambda* (#:key outputs #:allow-other-keys)
2058 (let* ((out (assoc-ref outputs "out"))
2059 (doc (string-append out "/share/doc"))
2060 (lib (string-append out "/lib"))
2061 (include (string-append out "/include")))
2062 (install-file "lodepng.h" include)
2063 (install-file "lodepng_util.h" include)
2064 (install-file "liblodepng.so" lib)
2065 (install-file "README.md" doc)
2066 #t))))))
2067 (home-page "https://lodev.org/lodepng/")
2068 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
2069 (description "LodePNG is a PNG image decoder and encoder, all in one,
2070 no dependency or linkage required. It's made for C (ISO C90), and has a C++
2071 wrapper with a more convenient interface on top.")
2072 (license license:zlib))))
2073
2074 (define-public icoutils
2075 (package
2076 (name "icoutils")
2077 (version "0.32.3")
2078 (source
2079 (origin
2080 (method url-fetch)
2081 (uri (string-append
2082 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
2083 (sha256
2084 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
2085 (build-system gnu-build-system)
2086 (inputs
2087 `(("libpng" ,libpng)
2088 ("perl" ,perl)))
2089 (propagated-inputs
2090 `(("perl-libwww" ,perl-libwww)))
2091 (home-page "https://www.nongnu.org/icoutils/")
2092 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
2093 (description "Icoutils are a set of program for extracting and converting
2094 bitmaps from Microsoft Windows icon and cursor files. These files usually
2095 have the extension @code{.ico} or @code{.cur}, but they can also be embedded
2096 in executables and libraries (@code{.dll}-files). (Such embedded files are
2097 referred to as resources.)
2098
2099 Conversion of these files to and from PNG images is done @command{icotool}.
2100 @command{extresso} automates these tasks with the help of special resource
2101 scripts. Resources such can be extracted from MS Windows executable and
2102 library files with @command{wrestool}.
2103
2104 This package can be used to create @code{favicon.ico} files for web sites.")
2105 (license license:gpl3+)))
2106
2107 (define-public libavif
2108 (package
2109 (name "libavif")
2110 (version "0.7.3")
2111 (source (origin
2112 (method git-fetch)
2113 (uri (git-reference
2114 (url "https://github.com/AOMediaCodec/libavif")
2115 (commit (string-append "v" version))))
2116 (file-name (git-file-name name version))
2117 (sha256
2118 (base32
2119 "17hagdngpc4xzrr0aa48nx399y5lawyyx9cpcdhpds1mqk6p77lp"))))
2120 (build-system cmake-build-system)
2121 (arguments
2122 `(#:configure-flags '("-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
2123 "-DAVIF_CODEC_RAV1E=OFF" ; not packaged yet
2124 "-DAVIF_BUILD_TESTS=ON")
2125 #:phases
2126 (modify-phases %standard-phases
2127 (replace 'check
2128 (lambda _
2129 (invoke "./aviftest" "../source/tests/data")))
2130 (add-after 'install 'install-readme
2131 (lambda* (#:key outputs #:allow-other-keys)
2132 (let* ((out (assoc-ref outputs "out"))
2133 (doc (string-append out "/share/doc/libavif-" ,version)))
2134 (install-file "../source/README.md" doc)
2135 #t))))))
2136 (inputs
2137 `(("libaom" ,libaom)
2138 ("dav1d" ,dav1d)))
2139 (synopsis "Encode and decode AVIF files")
2140 (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
2141 File Format}. It can encode and decode all YUV formats and bit depths supported
2142 by AOM, including with alpha.")
2143 (home-page "https://github.com/AOMediaCodec/libavif")
2144 (license (list license:bsd-2 ; libavif itself
2145 license:expat)))) ; cJSON in the test suite
2146
2147 (define-public mtpaint
2148 (package
2149 (name "mtpaint")
2150 ;; The author neither releases tarballs nor uses git version tags.
2151 ;; Instead, author puts version in git commit title.
2152 (version "3.49.27")
2153 (source
2154 (origin
2155 (method git-fetch)
2156 (uri (git-reference
2157 (url "https://github.com/wjaguar/mtPaint")
2158 (commit "26751cd0336414e2f16cbe25c9fe2702f34e7b5c")))
2159 (file-name (git-file-name name version))
2160 (sha256
2161 (base32 "12mzai9pqvyb342m21rjz0jxiy75q24sjw6ax147pzy8frzkgd54"))))
2162 (build-system gnu-build-system)
2163 (native-inputs
2164 `(("gettext" ,gettext-minimal)
2165 ("pkg-config" ,pkg-config)
2166 ("which" ,which)))
2167 (inputs
2168 `(("imlib2" ,imlib2)
2169 ("libtiff" ,libtiff)
2170 ("libpng" ,libpng)
2171 ("libungif", libungif)
2172 ("libjpeg", libjpeg-turbo)
2173 ("libwebp" ,libwebp)
2174 ("openjpeg" ,openjpeg)
2175 ("lcms" ,lcms)
2176 ("zlib", zlib)
2177 ("glib" ,glib)
2178 ;; Support for gtk3 is in the testing stage.
2179 ("gtk+" ,gtk+-2)))
2180 (arguments
2181 `(#:configure-flags
2182 (list "intl" ; build internationalized version
2183 "man") ; build the man page
2184 #:tests? #f)) ; no test suite
2185 (home-page "http://mtpaint.sourceforge.net/")
2186 (synopsis "Create pixel art and manipulate digital images")
2187 (description
2188 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
2189 It can create and edit indexed palette or 24bit RGB images, offers basic
2190 painting and palette manipulation tools. It also handles JPEG, JPEG2000,
2191 GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
2192 (license license:gpl3+)))
2193
2194 (define-public phockup
2195 (package
2196 (name "phockup")
2197 (version "1.5.9")
2198 (source
2199 (origin
2200 (method git-fetch)
2201 (uri (git-reference
2202 (url "https://github.com/ivandokov/phockup")
2203 (commit version)))
2204 (file-name (git-file-name name version))
2205 (sha256
2206 (base32
2207 "13ajj0xch7yfqaaxbw0awxs0fz17n1rxir4gqh2wcgxjysqk1j2y"))))
2208 (build-system copy-build-system)
2209 (arguments
2210 `(#:install-plan '(("src" "share/phockup/")
2211 ("phockup.py" "share/phockup/"))
2212 #:phases
2213 (modify-phases %standard-phases
2214 (add-after 'unpack 'configure
2215 (lambda* (#:key inputs #:allow-other-keys)
2216 (substitute* (list "src/dependency.py" "src/exif.py")
2217 (("exiftool")
2218 (string-append (assoc-ref inputs "perl-image-exiftool")
2219 "/bin/exiftool")))
2220 #t))
2221 (add-before 'install 'check
2222 (lambda _
2223 (invoke "pytest")))
2224 (add-after 'install 'install-bin
2225 (lambda* (#:key outputs #:allow-other-keys)
2226 (let ((out (assoc-ref outputs "out")))
2227 (mkdir (string-append out "/bin"))
2228 (symlink (string-append out "/share/phockup/phockup.py")
2229 (string-append out "/bin/phockup")))
2230 #t)))))
2231 (inputs
2232 `(("perl-image-exiftool" ,perl-image-exiftool)
2233 ("python" ,python)))
2234 (native-inputs
2235 `(("python-pytest" ,python-pytest)
2236 ("python-pytest-mock" ,python-pytest-mock)))
2237 (home-page "https://github.com/ivandokov/phockup")
2238 (synopsis "Organize photos and videos in folders")
2239 (description "Phockup is a media sorting tool that uses creation date and
2240 time information in photos and videos to organize them into folders by year,
2241 month and day. All files which are not images or videos or those which do not
2242 have creation date information will be placed in a folder called
2243 @file{unknown}.")
2244 (license license:expat)))