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