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