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