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>
30 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
103 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
104 version "/libpng-" version ".tar.xz")
106 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
107 "/libpng16/libpng-" version ".tar.xz")
109 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
110 "/libpng16/libpng-" version ".tar.xz")))
113 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
114 (build-system gnu-build-system)
116 `(#:configure-flags '("--disable-static")))
118 ;; libpng.la says "-lz", so propagate it.
119 (propagated-inputs `(("zlib" ,zlib)))
121 (synopsis "Library for handling PNG files")
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")))
128 ;; libpng-apng should be updated when the APNG patch is released:
129 ;; <https://bugs.gnu.org/27556>
130 (define-public libpng-apng
137 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
138 version "/libpng-" version ".tar.xz")
140 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
141 "/libpng16/libpng-" version ".tar.xz")
143 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
144 "/libpng16/libpng-" version ".tar.xz")))
147 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
148 (build-system gnu-build-system)
150 `(#:modules ((guix build gnu-build-system)
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"
160 (let ((apng.gz (assoc-ref inputs "apng")))
161 (format #t "Applying APNG patch '~a'...~%"
164 (string-append "gunzip < " apng.gz " > the-patch"))
165 (apply-patch "the-patch")
167 (add-before 'configure 'no-checks
169 (substitute* "Makefile.in"
170 (("^scripts/symbols.chk") "")
171 (("check: scripts/symbols.chk") ""))
177 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
178 version "/libpng-" version "-apng.patch.gz"))
181 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
183 `(("libtool" ,libtool)))
184 ;; libpng.la says "-lz", so propagate it.
187 (synopsis "APNG patch for libpng")
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)))
195 (define-public libpng-1.2
202 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
203 version "/libpng-" version ".tar.xz")
205 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
206 "/libpng12/libpng-" version ".tar.xz")
208 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
209 "/libpng12/libpng-" version ".tar.xz")))
212 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
214 (define-public pngcrush
220 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
221 version "/pngcrush-" version "-nolib.tar.xz"))
223 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
224 (build-system gnu-build-system)
226 '(#:tests? #f ; no check target
228 (modify-phases %standard-phases
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") "/")))
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)))
249 (define-public pnglite
250 (let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
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))
262 (url "https://github.com/dankar/pnglite")
266 "1lmmkdxby5b8z9kx3zrpgpk33njpcf2xx8z9bgqag855sjsqbbby"))
267 (file-name (git-file-name name version))))
268 (build-system gnu-build-system)
270 `(#:tests? #f ; no tests
272 (modify-phases %standard-phases
276 ;; common build flags for building shared libraries
277 (let ((cflags '("-O2" "-g" "-fPIC"))
278 (ldflags '("-shared")))
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)
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))))
304 (define-public libimagequant
306 (name "libimagequant")
312 (url "https://github.com/ImageOptim/libimagequant")
314 (file-name (git-file-name name version))
316 (base32 "0cp68w04ja5pv77ssfafsn958w9hh9zb8crrlb5j3gsrcmdc032k"))))
317 (build-system gnu-build-system)
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+)))
328 (define-public pngquant
336 (url "https://github.com/kornelski/pngquant")
338 (file-name (git-file-name name version))
340 (base32 "15hanshahxqs6s9fyc3aym02251dcys7bf78g3inp0y233amdbl3"))))
341 (build-system gnu-build-system)
343 `(#:test-target "test"
345 '("--with-openmp" "--with-lcms2")))
347 `(("pkg-config" ,pkg-config)))
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
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.
370 (license license:gpl3+)))
372 (define-public ijg-libjpeg
378 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
381 "0clwys9lcqlxqgcw8s1gwfm5ix2zjlqpklmd3mbvqmj5ibj51jwr"))))
382 (build-system gnu-build-system)
383 (synopsis "Library for handling JPEG files")
385 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
386 JPEG is a standardized compression method for full-color and gray-scale
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:
398 (license license:ijg)
399 (home-page "https://www.ijg.org/")))
401 (define-public libjxr
406 ;; We are using the Debian source because CodePlex does not
407 ;; deliver an easily downloadable tarball.
409 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
410 version ".orig.tar.gz"))
413 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
414 (patch-flags '("-p1" "--binary"))
415 (patches (search-patches "libjxr-fix-function-signature.patch"
416 "libjxr-fix-typos.patch"))))
417 (build-system gnu-build-system)
421 ;; A substitute* procedure call would be enough to add the -fPIC
422 ;; flag if there was no file decoding error.
423 ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
424 ;; terminators" according to the file(1) utility.
425 (string-append "CFLAGS=-I. -Icommon/include -Iimage/sys -fPIC "
426 "-D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O "))
427 #:tests? #f ; no check target
429 (modify-phases %standard-phases
430 (delete 'configure) ; no configure script
431 (add-after 'build 'build-shared-library
433 ;; The Makefile uses optimization level 1, so the same
434 ;; level is used here for consistency.
435 (invoke "gcc" "-shared" "-fPIC" "-O"
437 "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
438 "strTransform.o" "perfTimerANSI.o"
440 "decode.o" "postprocess.o" "segdec.o" "strdec.o"
441 "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
443 "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
446 (invoke "gcc" "-shared" "-fPIC" "-O"
448 "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
450 "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
451 "JXRTestTif.o" "JXRTestYUV.o"
452 "-o" "libjxrglue.so")))
453 ;; The upstream makefile does not include an install phase.
455 (lambda* (#:key outputs #:allow-other-keys)
456 (let* ((out (assoc-ref outputs "out"))
457 (bin (string-append out "/bin"))
458 (lib (string-append out "/lib"))
459 (include (string-append out "/include/jxrlib")))
460 (for-each (lambda (file)
461 (install-file file include)
464 '("jxrgluelib/JXRGlue.h"
465 "jxrgluelib/JXRMeta.h"
466 "jxrtestlib/JXRTest.h"
467 "image/sys/windowsmediaphoto.h")
468 (find-files "common/include" "\\.h$")))
469 (for-each (lambda (file)
470 (install-file file lib)
472 (find-files "." "\\.(a|so)$"))
473 (for-each (lambda (file)
474 (install-file file bin)
476 '("JxrDecApp" "JxrEncApp")))
478 (synopsis "Implementation of the JPEG XR standard")
479 (description "JPEG XR is an approved ISO/IEC International standard (its
480 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
482 (license:non-copyleft
484 "See the header of the Makefile in the distribution."))
485 (home-page "https://jxrlib.codeplex.com/")))
487 (define-public jpegoptim
493 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
496 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
497 (build-system gnu-build-system)
498 (inputs `(("libjpeg" ,libjpeg-turbo)))
500 '(#:tests? #f)) ; no tests
501 (synopsis "Optimize JPEG images")
503 "jpegoptim provides lossless optimization (based on optimizing
504 the Huffman tables) and \"lossy\" optimization based on setting
505 maximum quality factor.")
506 (license license:gpl2+)
507 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
509 (define-public libicns
516 "mirror://sourceforge/icns/"
517 "libicns-" version ".tar.gz"))
520 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
521 (build-system gnu-build-system)
526 `(#:tests? #t)) ; No tests.
527 (home-page "http://icns.sourceforge.net/")
528 (synopsis "Library for handling Mac OS icns resource files")
530 "Libicns is a library for the manipulation of Mac OS IconFamily resource
531 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
532 convert between PNG and ICNS. @command{icns2png} will extract image files from
533 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
534 with .desktop files. Additionally, @command{icontainer2png} is provided for
535 extracting icontainer icon files.")
536 (license (list license:lgpl2.1+ ; libicns
537 license:lgpl2.0+ ; src/apidocs.*
538 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
540 (define-public libtiff
547 (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
551 "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"))))
552 (build-system gnu-build-system)
554 "doc")) ;1.3 MiB of HTML documentation
556 ;; Instead of using --docdir, this package has its own --with-docdir.
557 `(#:configure-flags (list (string-append "--with-docdir="
558 (assoc-ref %outputs "doc")
561 "--disable-static")))
562 (inputs `(("zlib" ,zlib)
563 ("libjpeg" ,libjpeg-turbo)))
564 (synopsis "Library for handling TIFF files")
566 "Libtiff provides support for the Tag Image File Format (TIFF), a format
567 used for storing image data.
568 Included are a library, libtiff, for reading and writing TIFF and a small
569 collection of tools for doing simple manipulations of TIFF images.")
570 (license (license:non-copyleft "file://COPYRIGHT"
571 "See COPYRIGHT in the distribution."))
572 (home-page "http://www.simplesystems.org/libtiff/")))
574 (define-public leptonica
582 (url "https://github.com/DanBloomberg/leptonica")
584 (file-name (git-file-name name version))
586 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
587 (build-system gnu-build-system)
589 `(("gnuplot" ,gnuplot) ;needed for test suite
590 ("autoconf" ,autoconf)
591 ("automake" ,automake)
593 ("pkg-config" ,pkg-config)))
596 ("libjpeg" ,libjpeg-turbo)
600 ("openjpeg" ,openjpeg)
604 (modify-phases %standard-phases
605 (add-after 'unpack 'patch-reg-wrapper
607 (substitute* "prog/reg_wrapper.sh"
609 (string-append " " (which "sh") " "))
613 (add-after 'install 'provide-absolute-giflib-reference
614 (lambda* (#:key inputs outputs #:allow-other-keys)
615 (let ((out (assoc-ref outputs "out"))
616 (giflib (assoc-ref inputs "giflib")))
617 ;; Add an absolute reference to giflib to avoid propagation.
618 (with-directory-excursion (string-append out "/lib")
619 (substitute* '("liblept.la" "pkgconfig/lept.pc")
620 (("-lgif") (string-append "-L" giflib "/lib -lgif"))))
622 (home-page "http://www.leptonica.com/")
623 (synopsis "Library and tools for image processing and analysis")
625 "Leptonica is a C library and set of command-line tools for efficient
626 image processing and image analysis operations. It supports rasterop, affine
627 transformations, binary and grayscale morphology, rank order, and convolution,
628 seedfill and connected components, image transformations combining changes in
629 scale and pixel depth, and pixelwise masking, blending, enhancement, and
631 (license license:bsd-2)))
633 (define-public jbig2dec
639 (uri (string-append "https://github.com/ArtifexSoftware"
640 "/ghostpdl-downloads/releases/download"
641 "/gs951/" name "-" version ".tar.gz"))
644 "0pigfw2v0ppvr0lbysm69gx0zsa5q2q92yrb8af2j3im6x97f6cy"))))
645 (build-system gnu-build-system)
646 (arguments '(#:configure-flags '("--disable-static")
647 #:phases (modify-phases %standard-phases
648 (add-before 'bootstrap 'force-bootstrap
650 ;; XXX: jbig2dec 0.18 was released with
651 ;; a broken configure script, so we
652 ;; recreate the build system here.
653 ;; Remove the autoconf inputs below
654 ;; when deleting this code.
655 (delete-file "configure")
656 (delete-file "autogen.sh")
659 `(("autoconf" ,autoconf)
660 ("automake" ,automake)
662 ("python" ,python-wrapper))) ;for tests
663 (synopsis "Decoder of the JBIG2 image compression format")
665 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
666 monochrome) images at moderately high resolution, and in particular scanned
667 paper documents. In this domain it is very efficient, offering compression
668 ratios on the order of 100:1.
670 This is a decoder only implementation, and currently is in the alpha
671 stage, meaning it doesn't completely work yet. However, it is
672 maintaining parity with available encoders, so it is useful for real
674 (home-page "https://jbig2dec.com")
675 (license license:gpl2+)))
677 (define-public jbigkit
684 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
685 "download/jbigkit-" version ".tar.gz"))
687 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
688 (modules '((guix build utils)))
691 ;; Remove files without clear licence information.
692 (for-each delete-file-recursively
693 (list "contrib" "examples"))
695 (build-system gnu-build-system)
696 (outputs (list "out" "pbmtools"))
698 `(#:modules ((srfi srfi-26)
699 ,@%gnu-build-system-modules)
701 (modify-phases %standard-phases
702 (delete 'configure) ; no configure script
703 (replace 'install ; no ‘make install’ target
704 (lambda* (#:key outputs #:allow-other-keys)
705 (let* ((out (assoc-ref outputs "out"))
706 (lib (string-append out "/lib"))
707 (include (string-append out "/include")))
708 (with-directory-excursion "libjbig"
709 (for-each (cut install-file <> include)
710 (find-files "." "\\.h$"))
711 (for-each (cut install-file <> lib)
712 (find-files "." "\\.a$")))
714 (add-after 'install 'install-pbmtools
715 (lambda* (#:key outputs #:allow-other-keys)
716 (let* ((out (assoc-ref outputs "pbmtools"))
717 (bin (string-append out "/bin"))
718 (man1 (string-append out "/share/man/man1"))
719 (man5 (string-append out "/share/man/man5")))
720 (with-directory-excursion "pbmtools"
721 (for-each (cut install-file <> bin)
722 (list "jbgtopbm" "jbgtopbm85"
723 "pbmtojbg" "pbmtojbg85"))
725 (for-each (cut install-file <> man1)
726 (find-files "." "\\.1$"))
727 (for-each (cut install-file <> man5)
728 (find-files "." "\\.5$"))
731 #:tests? #f)) ; tests depend on examples/
732 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
733 (synopsis "Lossless compression for bi-level high-resolution images")
735 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
736 ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
737 black-and-white scanned documents. It is widely used in fax products, printer
738 firmware and drivers, document management systems, and imaging software.
740 This package provides a static C library of (de)compression functions and some
741 simple command-line converters similar to those provided by netpbm.
743 Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
744 options of the standard but has to keep the full uncompressed image in memory.
745 The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
746 memory management optimized for embedded and fax applications. It buffers
747 only a few lines of the uncompressed image in memory and is able to stream
748 images of initially unknown height.")
749 (license (list license:isc ; pbmtools/p?m.5
750 license:gpl2+)))) ; the rest
752 (define-public openjpeg
759 (url "https://github.com/uclouvain/openjpeg")
760 (commit (string-append "v" version))))
761 (file-name (git-file-name "openjpeg" version))
764 "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb"))))
765 (build-system cmake-build-system)
767 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
768 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
774 (synopsis "JPEG 2000 codec")
776 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
777 been developed in order to promote the use of JPEG 2000, the new
778 still-image compression standard from the Joint Photographic Experts
781 In addition to the basic codec, various other features are under
782 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
783 an indexing tool useful for the JPIP protocol, JPWL-tools for
784 error-resilience, a Java-viewer for j2k-images, ...")
785 (home-page "https://github.com/uclouvain/openjpeg")
786 (license license:bsd-2)))
788 (define-public openjpeg-1
789 (package (inherit openjpeg)
796 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
797 name "-" version ".tar.gz"))
799 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
801 (define-public giflib
807 (uri (string-append "mirror://sourceforge/giflib/giflib-"
811 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
812 (build-system gnu-build-system)
813 (outputs '("bin" ; utility programs
816 '(#:make-flags (list "CC=gcc"
817 (string-append "PREFIX="
818 (assoc-ref %outputs "out"))
819 (string-append "BINDIR="
820 (assoc-ref %outputs "bin") "/bin"))
822 (modify-phases %standard-phases
823 (add-after 'unpack 'disable-html-doc-gen
825 (substitute* "doc/Makefile"
826 (("^all: allhtml manpages") ""))
829 (add-after 'install 'install-manpages
830 (lambda* (#:key outputs #:allow-other-keys)
831 (let* ((bin (assoc-ref outputs "bin"))
832 (man1dir (string-append bin "/share/man/man1")))
834 (for-each (lambda (file)
835 (let ((base (basename file)))
836 (format #t "installing `~a' to `~a'~%"
841 (find-files "doc" "\\.1"))
843 (synopsis "Tools and library for working with GIF images")
845 "GIFLIB is a library for reading and writing GIF images. It is API and
846 ABI compatible with libungif which was in wide use while the LZW compression
847 algorithm was patented. Tools are also included to convert, manipulate,
848 compose, and analyze GIF images.")
849 (home-page "http://giflib.sourceforge.net/")
850 (license license:x11)))
852 (define-public libuemf
858 (uri (string-append "mirror://sourceforge/libuemf/libUEMF-"
862 "05djs99vqf067x81xfpskh7a66y5x7b4mmjavybcy7swnm0swg7v"))))
863 (build-system cmake-build-system)
866 (modify-phases %standard-phases
867 ;; Overriding CMAKE_INSTALL_PREFIX is not a good idea.
868 (add-after 'unpack 'fix-CMakeLists.txt
870 (substitute* "CMakeLists.txt"
871 ((".*SET\\(CMAKE_INSTALL_PREFIX.*") ""))
874 (add-after 'install 'check
875 (lambda* (#:key inputs outputs #:allow-other-keys)
876 (let* ((out (assoc-ref outputs "out"))
877 (bin (string-append out "/bin"))
878 (sources (string-append "../libUEMF-" ,version))
879 (drm-tools (assoc-ref inputs "drm-tools"))
880 (extract (string-append drm-tools "/bin/extract"))
881 (execinput (string-append drm-tools "/bin/execinput")))
882 (with-directory-excursion sources
883 (substitute* "testit.sh"
885 (format #f "EPATH=~a~%" bin))
889 (format #f "EXTRACT=~a~%" extract))
891 (format #f "EXECINPUT=~a~%" execinput)))
892 (invoke "sh" "testit.sh"))))))))
893 (native-inputs `(("drm-tools" ,drm-tools))) ;for tests
894 (home-page "http://libuemf.sourceforge.net/")
895 (synopsis "Library for working with WFM, EMF and EMF+ images")
896 (description "The libUEMF library is a portable C99 implementation for
897 reading and writing @acronym{WFM, Windows Metafile}, @acronym{EMF, Enhanced
898 Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
899 (license license:gpl2+)))
901 (define-public libungif
907 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
908 "libungif-" version "/libungif-"
912 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
913 (build-system gnu-build-system)
914 (inputs `(("perl" ,perl))) ;package ships some perl tools
915 (home-page "http://giflib.sourceforge.net/")
916 (synopsis "GIF decompression library")
918 "libungif is the old GIF decompression library by the GIFLIB project.")
919 (license license:expat)))
921 (define-public imlib2
928 "mirror://sourceforge/enlightenment/imlib2-src/" version
929 "/imlib2-" version ".tar.bz2"))
932 "0v8n3dswx7rxqfd0q03xwc7j2w1mv8lv18rdxv487a1xw5vklfad"))))
933 (build-system gnu-build-system)
935 `(("pkgconfig" ,pkg-config)))
938 ("freetype" ,freetype)
940 ("libid3tag" ,libid3tag)
941 ("libjpeg" ,libjpeg-turbo)
946 ("libwebp" ,libwebp)))
947 (home-page "https://sourceforge.net/projects/enlightenment/")
949 "Loading, saving, rendering and manipulating image files")
951 "Imlib2 is a library that does image file loading and saving as well as
952 rendering, manipulation, arbitrary polygon support, etc.
954 It does ALL of these operations FAST. Imlib2 also tries to be highly
955 intelligent about doing them, so writing naive programs can be done easily,
956 without sacrificing speed.
958 This is a complete rewrite over the Imlib 1.x series. The architecture is
959 more modular, simple, and flexible.")
960 (license license:imlib2)))
962 (define-public giblib
970 "http://linuxbrit.co.uk/downloads/giblib-"
973 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
974 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
977 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
978 "files/giblib/giblib-" version ".tar.gz")))
981 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
982 (build-system gnu-build-system)
987 ;; This vanished page is universally accepted as giblib's home despite not
988 ;; mentioning the package once.
989 (string-append "https://web.archive.org/web/20140907071208/"
990 "https://linuxbrit.co.uk/software/"))
991 (synopsis "Wrapper library for imlib2")
993 "Giblib is a simple library which wraps imlib2's context API, avoiding
994 all the context_get/set calls, adds fontstyles to the truetype renderer and
995 supplies a generic doubly-linked list and some string functions.")
996 ;; This license removes a clause about X Consortium from the original
998 (license (license:x11-style "file://COPYING"
999 "See 'COPYING' in the distribution."))))
1001 (define-public freeimage
1008 "mirror://sourceforge/freeimage/Source%20Distribution/"
1009 version "/FreeImage"
1010 (string-concatenate (string-split version #\.))
1014 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
1015 (modules '((guix build utils)))
1020 (delete-file-recursively (string-append "Source/" dir)))
1021 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
1022 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
1025 (search-patches "freeimage-unbundle.patch")
1026 ;; Take one patch from Arch Linux that adds LibRaw 0.20 compatibility.
1029 (uri "https://raw.githubusercontent.com/archlinux\
1030 /svntogit-community/ca3e6a52f5a46dec87cbf85e9d84fe370e282c8c/trunk\
1031 /freeimage-libraw-0.20.patch")
1032 (file-name "freeimage-libraw-compat.patch")
1035 "0cwjxjz0f4gs6igvwqg0p99mnrsrwzkal1l2n08yvz2xq9s5khki"))))))))
1036 (build-system gnu-build-system)
1039 (modify-phases %standard-phases
1040 ;; According to Fedora these files depend on private headers, but their
1041 ;; presence is required for building, so we replace them with empty files.
1042 (add-after 'unpack 'delete-unbuildable-files
1044 (for-each (lambda (file)
1046 (close (open file O_CREAT)))
1047 '("Source/FreeImage/PluginG3.cpp"
1048 "Source/FreeImageToolkit/JPEGTransform.cpp"))
1050 ;; These scripts generate the Makefiles.
1053 (invoke "sh" "gensrclist.sh")
1054 (invoke "sh" "genfipsrclist.sh")))
1055 (add-before 'build 'patch-makefile
1056 (lambda* (#:key outputs #:allow-other-keys)
1057 (substitute* "Makefile.gnu"
1058 (("/usr") (assoc-ref outputs "out"))
1059 (("-o root -g root") ""))
1063 ;; We need '-fpermissive' for Source/FreeImage.h.
1064 ;; libjxr doesn't have a pkg-config file.
1065 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
1066 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
1067 #:tests? #f)) ; no check target
1069 `(("pkg-config" ,pkg-config)
1072 `(("libjpeg" ,libjpeg-turbo)
1076 ("libtiff" ,libtiff)
1077 ("libwebp" ,libwebp)
1078 ("openexr" ,openexr)
1079 ("openjpeg" ,openjpeg)
1081 (synopsis "Library for handling popular graphics image formats")
1083 "FreeImage is a library for developers who would like to support popular
1084 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1085 (license license:gpl2+)
1086 (home-page "http://freeimage.sourceforge.net")))
1088 (define-public vigra
1095 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
1096 "Version-" (string-join (string-split version #\.) "-")
1097 "/vigra-" version "-src.tar.gz"))
1098 (patches (search-patches "vigra-python-compat.patch"))
1100 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
1101 (build-system cmake-build-system)
1107 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
1108 ; to create a configure-flag
1109 ("libjpeg" ,libjpeg-turbo)
1111 ("libtiff" ,libtiff)
1112 ("openexr" ,openexr)
1113 ("python" ,python-wrapper)
1114 ("python-numpy" ,python-numpy)
1117 `(("doxygen" ,doxygen)
1118 ("python-nose" ,python-nose)
1119 ("sphinx" ,python-sphinx)))
1121 `(#:test-target "check"
1123 (modify-phases %standard-phases
1124 (add-after 'unpack 'disable-broken-tests
1126 ;; See https://github.com/ukoethe/vigra/issues/432
1127 (substitute* "test/fourier/CMakeLists.txt"
1128 (("VIGRA_ADD_TEST.*") ""))
1129 ;; This test fails with Numpy 1.15:
1130 ;; <https://github.com/ukoethe/vigra/issues/436>.
1131 (substitute* "vigranumpy/test/CMakeLists.txt"
1132 (("test1\\.py") ""))
1135 (list "-Wno-dev" ; suppress developer mode with lots of warnings
1136 (string-append "-DVIGRANUMPY_INSTALL_DIR="
1137 (assoc-ref %outputs "out")
1139 ,(version-major+minor (package-version python))
1141 ;; OpenEXR is not enabled by default.
1143 ;; Fix rounding error on 32-bit machines
1144 "-DCMAKE_C_FLAGS=-ffloat-store"
1145 ;; The header files of ilmbase are not found when included
1146 ;; by the header files of openexr, and an explicit flag
1148 (string-append "-DCMAKE_CXX_FLAGS=-I"
1149 (assoc-ref %build-inputs "ilmbase")
1151 " -ffloat-store"))))
1152 (synopsis "Computer vision library")
1154 "VIGRA stands for Vision with Generic Algorithms. It is an image
1155 processing and analysis library that puts its main emphasis on customizable
1156 algorithms and data structures. It is particularly strong for
1157 multi-dimensional image processing.")
1158 (license license:expat)
1159 (home-page "https://ukoethe.github.io/vigra/")))
1161 (define-public vigra-c
1162 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1166 (version (git-version "0.0.0" revision commit))
1167 (home-page "https://github.com/BSeppke/vigra_c")
1175 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
1176 (file-name (git-file-name name version))))
1177 (build-system cmake-build-system)
1179 `(#:tests? #f)) ; No test target.
1181 `(("doxygen" ,doxygen)))
1187 (synopsis "C interface to the VIGRA computer vision library")
1189 "This package provides a C interface to the VIGRA C++ computer vision
1190 library. It is designed primarily to ease the implementation of higher-level
1191 language bindings to VIGRA.")
1192 (license license:expat))))
1194 (define-public libwebp
1200 ;; No tarballs are provided for >0.6.1.
1203 (url "https://chromium.googlesource.com/webm/libwebp")
1204 (commit (string-append "v" version))))
1205 (file-name (git-file-name name version))
1208 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
1209 (build-system gnu-build-system)
1211 `(("freeglut" ,freeglut)
1213 ("libjpeg" ,libjpeg-turbo)
1215 ("libtiff" ,libtiff)))
1217 `(("autoconf" ,autoconf)
1218 ("automake" ,automake)
1219 ("libtool" ,libtool)))
1221 '(#:configure-flags '("--enable-libwebpmux"
1222 "--enable-libwebpdemux"
1223 "--enable-libwebpdecoder"
1224 "--disable-static")))
1225 (home-page "https://developers.google.com/speed/webp/")
1226 (synopsis "Lossless and lossy image compression")
1228 "WebP is a new image format that provides lossless and lossy compression
1229 for images. WebP lossless images are 26% smaller in size compared to
1230 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1231 equivalent SSIM index. WebP supports lossless transparency (also known as
1232 alpha channel) with just 22% additional bytes. Transparency is also supported
1233 with lossy compression and typically provides 3x smaller file sizes compared
1234 to PNG when lossy compression is acceptable for the red/green/blue color
1236 (license license:bsd-3)))
1238 (define-public libmng
1244 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1245 version "/" name "-" version ".tar.xz"))
1248 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1249 (build-system gnu-build-system)
1251 ;; These are all in the 'Libs.private' field of libmng.pc.
1253 ("libjpeg" ,libjpeg-turbo)
1255 (home-page "https://www.libmng.com/")
1256 (synopsis "Library for handling MNG files")
1258 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1259 (license license:bsd-3)))
1261 (define-public exiv2
1268 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
1271 (base32 "0y77wfadjsrcxijdqgkr3q88b6mm9y3rg8kqsmaig8iah49md7x7"))))
1272 (build-system cmake-build-system)
1273 (arguments '(#:tests? #f)) ; no test suite
1277 (home-page "https://www.exiv2.org/")
1278 (synopsis "Library and command-line utility to manage image metadata")
1280 "Exiv2 is a C++ library and a command line utility to manage image
1281 metadata. It provides fast and easy read and write access to the Exif, IPTC
1282 and XMP metadata of images in various formats.")
1284 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1285 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1286 ;; The core is GPLv2+:
1287 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1288 (license license:gpl2+)))
1290 (define-public exiv2-0.26
1296 (uri (list (string-append "https://www.exiv2.org/builds/exiv2-"
1297 version "-trunk.tar.gz")
1298 (string-append "https://www.exiv2.org/exiv2-"
1300 (string-append "https://fossies.org/linux/misc/exiv2-"
1301 version ".tar.gz")))
1302 (patches (search-patches "exiv2-CVE-2017-14860.patch"
1303 "exiv2-CVE-2017-14859-14862-14864.patch"))
1306 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
1307 (build-system gnu-build-system)
1308 (arguments '(#:tests? #f)) ; no `check' target
1313 `(("intltool" ,intltool)))
1315 ;; People should rely on the newer version, so don't expose it.
1316 (properties `((hidden? . #t)))))
1318 (define-public devil
1324 (uri (string-append "http://downloads.sourceforge.net/openil/"
1325 "DevIL-" version ".tar.gz"))
1328 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1329 (build-system cmake-build-system)
1331 '(;; XXX: Not supported in the released CMakeLists.txt.
1332 ;; Enable this for > 1.8.0.
1335 (modify-phases %standard-phases
1336 (add-before 'configure 'change-directory
1337 (lambda _ (chdir "DevIL") #t)))))
1339 `(("pkg-config" ,pkg-config)))
1342 ("libjpeg" ,libjpeg-turbo)
1345 ("libtiff" ,libtiff)
1346 ("openexr" ,openexr)
1348 (synopsis "Library for manipulating many image formats")
1349 (description "Developer's Image Library (DevIL) is a library to develop
1350 applications with support for many types of images. DevIL can load, save,
1351 convert, manipulate, filter and display a wide variety of image formats.")
1352 (home-page "http://openil.sourceforge.net")
1353 (license license:lgpl2.1+)))
1355 (define-public jasper
1362 (url "https://github.com/mdadams/jasper")
1363 (commit (string-append "version-" version))))
1364 (file-name (git-file-name name version))
1367 "036rcr0wkz9gzmvk1jb96piznk0c0bwxgf31z1zrlg8js4zl1n84"))))
1368 (build-system cmake-build-system)
1369 (inputs `(("libjpeg" ,libjpeg-turbo)))
1370 (synopsis "JPEG-2000 library")
1371 (description "The JasPer Project is an initiative to provide a reference
1372 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1374 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1375 (license (license:x11-style "file://LICENSE"))))
1385 (url "https://github.com/sekrit-twc/zimg")
1386 (commit (string-append "release-" version))))
1387 (file-name (git-file-name name version))
1389 (base32 "1dqyrq3p8bkgvj4ci50ac342hjnhyz6xxvhiwp7wpi3v3nbj7s02"))))
1390 (build-system gnu-build-system)
1392 `(("autoconf" ,autoconf)
1393 ("automake" ,automake)
1394 ("libtool" ,libtool)))
1395 (synopsis "Scaling, colorspace conversion, and dithering library")
1396 (description "Zimg implements the commonly required image processing basics
1397 of scaling, colorspace conversion, and depth conversion. A simple API enables
1398 conversion between any supported formats to operate with minimal knowledge from
1400 (home-page "https://github.com/sekrit-twc/zimg")
1401 ;; test/extra/ contains musl-libm,
1402 ;; which is MIT/expat licensed, but only used for tests
1403 (license license:wtfpl2)))
1405 (define-public perceptualdiff
1407 (name "perceptualdiff")
1413 (url "https://github.com/myint/perceptualdiff")
1414 (commit (string-append "v" version))))
1415 (file-name (git-file-name name version))
1417 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
1418 (build-system cmake-build-system)
1419 (inputs `(("freeimage" ,freeimage)))
1421 '(#:phases (modify-phases %standard-phases
1422 (add-after 'unpack 'fix-tests
1423 ;; cmake-build-system uses a build/ directory outside
1424 ;; of the source tree, one level higher than expected
1426 (substitute* "test/run_tests.bash"
1427 (("../build") "../../build"))
1429 (home-page "https://github.com/myint/perceptualdiff")
1430 (synopsis "Perceptual image comparison utility")
1431 (description "PerceptualDiff visually compares two images to determine
1432 whether they look alike. It uses a computational model of the human visual
1433 system to detect similarities. This allows it too see beyond irrelevant
1434 differences in file encoding, image quality, and other small variations.")
1435 (license license:gpl2+)))
1437 (define-public steghide
1443 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1444 version "/steghide-" version ".tar.bz2"))
1447 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1448 (patches (list (search-patch "steghide-fixes.patch")))))
1449 (build-system gnu-build-system)
1451 `(("gettext" ,gettext-minimal)
1452 ("libtool" ,libtool)
1453 ("perl" ,perl))) ;for tests
1455 `(("libmhash" ,libmhash)
1456 ("libmcrypt" ,libmcrypt)
1457 ("libjpeg" ,libjpeg-turbo)
1460 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1462 #:phases (modify-phases %standard-phases
1463 (add-before 'configure 'set-perl-search-path
1465 ;; Work around "dotless @INC" build failure.
1467 (string-append (getcwd) "/tests:"
1468 (getenv "PERL5LIB")))
1470 (home-page "http://steghide.sourceforge.net")
1471 (synopsis "Image and audio steganography")
1473 "Steghide is a program to hide data in various kinds of image and audio
1474 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1475 changed, making the embedding resistant against first-order statistical tests.")
1476 (license license:gpl2+)))
1478 (define-public stb-image-for-extempore
1479 (let ((revision "1")
1480 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1482 (name "stb-image-for-extempore")
1483 (version (string-append "0-" revision "." (string-take commit 9)))
1485 (origin (method git-fetch)
1487 (url "https://github.com/extemporelang/stb")
1491 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1492 (file-name (string-append name "-" version "-checkout"))))
1493 (build-system cmake-build-system)
1494 (arguments `(#:tests? #f)) ; no tests included
1495 ;; Extempore refuses to build on architectures other than x86_64
1496 (supported-systems '("x86_64-linux"))
1497 (home-page "https://github.com/extemporelang/stb")
1498 (synopsis "Image library for Extempore")
1500 "This package is a collection of assorted single-file libraries. Of
1501 all included libraries only the image loading and decoding library is
1502 installed as @code{stb_image}.")
1503 (license license:public-domain))))
1505 (define-public optipng
1512 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1516 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1517 (modules '((guix build utils)))
1520 (delete-file-recursively "src/libpng")
1521 (delete-file-recursively "src/zlib")
1523 (build-system gnu-build-system)
1525 `(("libpng" ,libpng)
1529 (modify-phases %standard-phases
1531 (lambda* (#:key outputs #:allow-other-keys)
1532 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1533 (invoke "sh" "configure"
1534 (string-append "--prefix=" (assoc-ref outputs "out"))
1535 "-with-system-libs")
1537 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1538 (description "OptiPNG is a PNG optimizer that recompresses image
1539 files to a smaller size, without losing any information. This program
1540 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1541 PNG, and performs PNG integrity checks and corrections.")
1542 (home-page "http://optipng.sourceforge.net/")
1543 (license license:zlib)))
1545 (define-public pngsuite
1548 (version "2017jul19")
1551 (method url-fetch/tarbomb)
1552 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
1556 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
1557 (build-system gnu-build-system)
1559 '(#:tests? #f ; there is no test target
1560 #:license-file-regexp "PngSuite.LICENSE"
1562 (modify-phases %standard-phases
1564 (lambda* (#:key outputs #:allow-other-keys)
1565 (let ((out (assoc-ref outputs "out")))
1566 (copy-recursively "." (string-append out "/"))
1569 (delete 'configure))))
1570 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
1571 (synopsis "Example PNGs for use in test suites")
1572 (description "Collection of graphics images created to test PNG
1573 applications like viewers, converters and editors. As far as that is
1574 possible, all formats supported by the PNG standard are represented.")
1575 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1576 use, copy, modify and distribute these images for any purpose and without fee
1577 is hereby granted."))))
1579 (define-public libjpeg-turbo
1581 (name "libjpeg-turbo")
1583 (replacement libjpeg-turbo/fixed)
1586 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1587 version "/libjpeg-turbo-" version ".tar.gz"))
1590 "01ill8bgjyk582wipx7sh7gj2nidylpbzvwhx0wkcm6mxx3qbp9k"))))
1591 (build-system cmake-build-system)
1595 `(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1597 ;; djpeg-shared-3x2-float-prog-cmp fails on 32-bit PPC.
1598 ,@(if (string=? "powerpc-linux" (%current-system))
1601 ;; The build system probes for the current CPU, but
1602 ;; that fails when cross-compiling.
1603 ,@(let ((target (%current-target-system)))
1606 ((string-prefix? "arm" target)
1607 `("-DCMAKE_SYSTEM_PROCESSOR=arm"))
1608 ((string-prefix? "aarch64" target)
1609 `("-DCMAKE_SYSTEM_PROCESSOR=aarch64"))
1610 ((string-prefix? "i686" target)
1611 `("-DCMAKE_SYSTEM_PROCESSOR=x86"))
1612 ((string-prefix? "x86_64" target)
1613 `("-DCMAKE_SYSTEM_PROCESSOR=x86_64"))
1614 ;; 32-bit and 64-bit
1615 ((string-prefix? "powerpc" target)
1616 `("-DCMAKE_SYSTEM_PROCESSOR=powerpc"))
1619 ,@(if (%current-target-system)
1621 ;; Use a special "bootstrap" CMake for the native build to work
1622 ;; around a circular dependency between CMake and this package.
1623 `(#:cmake ,cmake-bootstrap))))
1624 (home-page "https://libjpeg-turbo.org/")
1625 (synopsis "SIMD-accelerated JPEG image handling library")
1626 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1627 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1628 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1629 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1630 a significant amount.
1631 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1632 but more straightforward TurboJPEG API, and provides a full-featured Java
1633 interface. It supports color space extensions that allow it to compress from
1634 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1635 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1636 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1637 license:ijg ;the libjpeg library and associated tools
1638 license:zlib)))) ;the libjpeg-turbo SIMD extensions
1640 (define libjpeg-turbo/fixed
1642 (inherit libjpeg-turbo)
1646 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1647 version "/libjpeg-turbo-" version ".tar.gz"))
1650 "0pbv6pc97kbj7ib31qcwi7lnmm9xg5y3b11aasmkhfjvf7rgdy0n"))))))
1652 (define-deprecated libjpeg libjpeg-turbo)
1655 (define-public niftilib
1661 (uri (list (string-append "mirror://sourceforge/niftilib/"
1662 "nifticlib/nifticlib_"
1663 (string-join (string-split version #\.) "_")
1664 "/nifticlib-" version ".tar.gz")))
1666 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1667 (build-system gnu-build-system)
1669 '(#:tests? #f ; there is no test target
1670 #:parallel-build? #f ; not supported
1673 (string-append "ZLIB_INC="
1674 (assoc-ref %build-inputs "zlib") "/include")
1675 ;; Append "-fPIC" to CFLAGS.
1676 (string-append "CFLAGS="
1677 "-Wall -ansi -pedantic -fPIC"))
1679 (modify-phases %standard-phases
1681 (lambda* (#:key outputs #:allow-other-keys)
1682 (let ((out (assoc-ref outputs "out")))
1685 (copy-recursively dir (string-append out "/" dir)))
1686 '("bin" "lib" "include")))
1688 (delete 'configure))))
1691 (synopsis "Library for reading and writing files in the nifti-1 format")
1692 (description "Niftilib is a set of i/o libraries for reading and writing
1693 files in the nifti-1 data format - a binary file format for storing
1694 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1695 (fMRI) brain images.")
1696 (home-page "http://niftilib.sourceforge.net")
1697 (license license:public-domain)))
1699 (define-public gpick
1706 (url "https://github.com/thezbyg/gpick")
1707 (commit (string-append name "-" version))))
1708 (file-name (git-file-name name version))
1711 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
1712 (build-system scons-build-system)
1715 ("gettext" ,gettext-minimal)
1716 ("pkg-config" ,pkg-config)))
1723 #:scons ,scons-python2
1724 #:scons-flags (list (string-append "DESTDIR=" %output))
1726 (modify-phases %standard-phases
1727 (add-before 'build 'fix-lua-reference
1729 (substitute* "SConscript"
1730 (("lua5.2") "lua-5.2"))
1732 (home-page "http://www.gpick.org/")
1733 (synopsis "Color picker")
1734 (description "Gpick is an advanced color picker and palette editing tool.")
1735 (license license:bsd-3)))
1737 (define-public libiptcdata
1739 (name "libiptcdata")
1743 (uri (string-append "https://github.com/ianw/libiptcdata"
1744 "/releases/download/release_"
1745 (string-join (string-split version #\.) "_")
1746 "/" name "-" version ".tar.gz"))
1749 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
1750 (build-system gnu-build-system)
1751 (home-page "https://github.com/ianw/libiptcdata")
1752 (synopsis "IPTC metadata manipulation library")
1754 "Libiptcdata is a C library for manipulating the International Press
1755 Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
1756 such as images. This metadata can include captions and keywords, often used by
1757 popular photo management applications. The library provides routines for
1758 parsing, viewing, modifying, and saving this metadata.")
1759 (license license:lgpl2.0+)))
1761 (define-public flameshot
1769 (url "https://github.com/lupoDharkael/flameshot")
1770 (commit (string-append "v" version))))
1771 (file-name (git-file-name name version))
1774 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
1775 (build-system gnu-build-system)
1777 `(("qttools" ,qttools)))
1779 `(("qtbase" ,qtbase)))
1781 `(#:tests? #f ; no tests
1783 (modify-phases %standard-phases
1785 (lambda* (#:key outputs #:allow-other-keys)
1788 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1790 (home-page "https://github.com/lupoDharkael/flameshot")
1791 (synopsis "Powerful yet simple to use screenshot software")
1792 (description "Flameshot is a screenshot program.
1796 @item Customizable appearance.
1798 @item In-app screenshot edition.
1799 @item DBus interface.
1800 @item Upload to Imgur.
1802 (license license:gpl3+)))
1804 (define-public gifsicle
1811 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
1814 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
1815 (build-system gnu-build-system)
1818 (modify-phases %standard-phases
1819 (add-before 'check 'patch-tests
1821 (substitute* "test/testie"
1829 (native-inputs `(("perl" ,perl))) ; only for tests
1830 (inputs `(("libx11" ,libx11)))
1831 (home-page "https://www.lcdf.org/gifsicle/")
1832 (synopsis "Edit GIF images and animations")
1833 (description "Gifsicle is a command-line GIF image manipulation tool that:
1836 @item Provides a batch mode for changing GIFs in place.
1837 @item Prints detailed information about GIFs, including comments.
1838 @item Control over interlacing, comments, looping, transparency, etc.
1839 @item Creates well-behaved GIFs: removes redundant colors, only uses local color
1841 @item Shrinks colormaps and change images to use the Web-safe palette.
1842 @item Optimizes GIF animations, or unoptimizes them for easier editing.
1845 Two other programs are included with Gifsicle: @command{gifview} is a
1846 lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1847 identical visual appearance.")
1848 (license license:gpl2+)))
1850 ;; 1.0.7 is buggy and reverted in git repository.
1858 (uri (string-append "mirror://debian/pool/main/j/jp2a/jp2a_"
1859 version ".orig.tar.gz"))
1862 "076frk3pa16s4r1b10zgy81vdlz0385zh3ykbnkaij25jn5aqc09"))))
1863 (build-system gnu-build-system)
1866 ("libjpeg" ,libjpeg-turbo)
1867 ("ncurses" ,ncurses)))
1868 (home-page "https://csl.name/jp2a/")
1869 (synopsis "Convert JPEG images to ASCII")
1871 "Jp2a is a small utility that converts JPEG images to ASCII.")
1872 (license license:gpl2)))
1882 (url "https://github.com/emersion/grim")
1883 (commit (string-append "v" version))))
1884 (file-name (git-file-name name version))
1886 (base32 "0brljl4zfbn5mh9hkfrfkvd27c5y9vdkgap9r1hrfy9r1x20sskn"))))
1887 (build-system meson-build-system)
1888 (native-inputs `(("pkg-config" ,pkg-config)
1890 (inputs `(("cairo" ,cairo)
1891 ("libjpeg-turbo" ,libjpeg-turbo)
1892 ("wayland" ,wayland)
1893 ("wayland-protocols" ,wayland-protocols)))
1894 (home-page "https://github.com/emersion/grim")
1895 (synopsis "Create screenshots from a Wayland compositor")
1896 (description "grim can create screenshots from a Wayland compositor.")
1898 (license license:expat)))
1900 (define-public slurp
1908 (url "https://github.com/emersion/slurp")
1909 (commit (string-append "v" version))))
1910 (file-name (git-file-name name version))
1912 (base32 "0580m6kaiilgsrcj608r837r37sl6a25y7w21p7d6ij20fs3gvg1"))))
1913 (build-system meson-build-system)
1914 (native-inputs `(("pkg-config" ,pkg-config)))
1915 (inputs `(("cairo" ,cairo)
1917 ("wayland" ,wayland)
1918 ("wayland-protocols" ,wayland-protocols)))
1919 (home-page "https://github.com/emersion/slurp")
1920 (synopsis "Select a region in a Wayland compositor")
1921 (description "Slurp can select a region in a Wayland compositor and print it
1922 to the standard output. It works well together with grim.")
1924 (license license:expat)))
1933 (uri (string-append "mirror://sourceforge/sng/sng-"
1936 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
1937 (build-system gnu-build-system)
1940 (modify-phases %standard-phases
1941 (add-before 'check 'link-pngsuite
1942 ;; tests expect pngsuite in source dir
1943 (lambda* (#:key inputs #:allow-other-keys)
1944 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
1947 (list (string-append "--with-rgbtxt="
1948 (assoc-ref %build-inputs "xorg-rgb")
1949 "/share/X11/rgb.txt"))))
1950 (inputs `(("xorg-rgb" ,xorg-rgb)
1951 ("libpng" ,libpng)))
1952 (native-inputs `(("pngsuite" ,pngsuite)))
1953 (home-page "http://sng.sourceforge.net")
1954 (synopsis "Markup language for representing PNG contents")
1955 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
1956 specifically to represent the entire contents of a PNG (Portable Network
1957 Graphics) file in an editable form. Thus, SNGs representing elaborate
1958 graphics images and ancillary chunk data can be readily generated or modified
1959 using only text tools.
1961 SNG is implemented by a compiler/decompiler called sng that
1962 losslessly translates between SNG and PNG.")
1963 (license license:zlib)))
1965 (define-public lodepng
1966 ;; There are no tags in the repository, so we take the version as defined in
1968 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
1970 (version "20200215"))
1973 (version (git-version version revision commit))
1977 (url "https://github.com/lvandeve/lodepng")
1981 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
1982 (file-name (git-file-name name version))))
1983 (build-system gnu-build-system)
1986 (modify-phases %standard-phases
1990 (setenv "CXXFLAGS" "-fPIC")
1991 (invoke "make" "lodepng.o")
1992 (invoke "make" "lodepng_util.o")
1993 (invoke "g++" "-fPIC" "-O3"
1994 "-o" "liblodepng.so"
1995 "-shared" "lodepng.o" "lodepng_util.o")
1999 (invoke "make" "unittest")
2000 (invoke "./unittest")
2003 (lambda* (#:key outputs #:allow-other-keys)
2004 (let* ((out (assoc-ref outputs "out"))
2005 (doc (string-append out "/share/doc"))
2006 (lib (string-append out "/lib"))
2007 (include (string-append out "/include")))
2008 (install-file "lodepng.h" include)
2009 (install-file "lodepng_util.h" include)
2010 (install-file "liblodepng.so" lib)
2011 (install-file "README.md" doc)
2013 (home-page "https://lodev.org/lodepng/")
2014 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
2015 (description "LodePNG is a PNG image decoder and encoder, all in one,
2016 no dependency or linkage required. It's made for C (ISO C90), and has a C++
2017 wrapper with a more convenient interface on top.")
2018 (license license:zlib))))
2020 (define-public icoutils
2028 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
2030 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
2031 (build-system gnu-build-system)
2033 `(("libpng" ,libpng)
2036 `(("perl-libwww" ,perl-libwww)))
2037 (home-page "https://www.nongnu.org/icoutils/")
2038 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
2039 (description "Icoutils are a set of program for extracting and converting
2040 bitmaps from Microsoft Windows icon and cursor files. These files usually
2041 have the extension @code{.ico} or @code{.cur}, but they can also be embedded
2042 in executables and libraries (@code{.dll}-files). (Such embedded files are
2043 referred to as resources.)
2045 Conversion of these files to and from PNG images is done @command{icotool}.
2046 @command{extresso} automates these tasks with the help of special resource
2047 scripts. Resources such can be extracted from MS Windows executable and
2048 library files with @command{wrestool}.
2050 This package can be used to create @code{favicon.ico} files for web sites.")
2051 (license license:gpl3+)))
2053 (define-public libavif
2060 (url "https://github.com/AOMediaCodec/libavif")
2061 (commit (string-append "v" version))))
2062 (file-name (git-file-name name version))
2065 "17hagdngpc4xzrr0aa48nx399y5lawyyx9cpcdhpds1mqk6p77lp"))))
2066 (build-system cmake-build-system)
2068 `(#:configure-flags '("-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
2069 "-DAVIF_CODEC_RAV1E=OFF" ; not packaged yet
2070 "-DAVIF_BUILD_TESTS=ON")
2072 (modify-phases %standard-phases
2075 (invoke "./aviftest" "../source/tests/data")))
2076 (add-after 'install 'install-readme
2077 (lambda* (#:key outputs #:allow-other-keys)
2078 (let* ((out (assoc-ref outputs "out"))
2079 (doc (string-append out "/share/doc/libavif-" ,version)))
2080 (install-file "../source/README.md" doc)
2083 `(("libaom" ,libaom)
2085 (synopsis "Encode and decode AVIF files")
2086 (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
2087 File Format}. It can encode and decode all YUV formats and bit depths supported
2088 by AOM, including with alpha.")
2089 (home-page "https://github.com/AOMediaCodec/libavif")
2090 (license (list license:bsd-2 ; libavif itself
2091 license:expat)))) ; cJSON in the test suite
2093 (define-public mtpaint
2096 ;; The author neither releases tarballs nor uses git version tags.
2097 ;; Instead, author puts version in git commit title.
2103 (url "https://github.com/wjaguar/mtPaint")
2104 (commit "26751cd0336414e2f16cbe25c9fe2702f34e7b5c")))
2105 (file-name (git-file-name name version))
2107 (base32 "12mzai9pqvyb342m21rjz0jxiy75q24sjw6ax147pzy8frzkgd54"))))
2108 (build-system gnu-build-system)
2110 `(("gettext" ,gettext-minimal)
2111 ("pkg-config" ,pkg-config)
2114 `(("imlib2" ,imlib2)
2115 ("libtiff" ,libtiff)
2117 ("libungif", libungif)
2118 ("libjpeg", libjpeg-turbo)
2119 ("libwebp" ,libwebp)
2120 ("openjpeg" ,openjpeg)
2124 ;; Support for gtk3 is in the testing stage.
2128 (list "intl" ; build internationalized version
2129 "man") ; build the man page
2130 #:tests? #f)) ; no test suite
2131 (home-page "http://mtpaint.sourceforge.net/")
2132 (synopsis "Create pixel art and manipulate digital images")
2134 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
2135 It can create and edit indexed palette or 24bit RGB images, offers basic
2136 painting and palette manipulation tools. It also handles JPEG, JPEG2000,
2137 GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
2138 (license license:gpl3+)))
2140 (define-public phockup
2148 (url "https://github.com/ivandokov/phockup")
2150 (file-name (git-file-name name version))
2153 "13ajj0xch7yfqaaxbw0awxs0fz17n1rxir4gqh2wcgxjysqk1j2y"))))
2154 (build-system copy-build-system)
2156 `(#:install-plan '(("src" "share/phockup/")
2157 ("phockup.py" "share/phockup/"))
2159 (modify-phases %standard-phases
2160 (add-after 'unpack 'configure
2161 (lambda* (#:key inputs #:allow-other-keys)
2162 (substitute* (list "src/dependency.py" "src/exif.py")
2164 (string-append (assoc-ref inputs "perl-image-exiftool")
2167 (add-before 'install 'check
2170 (add-after 'install 'install-bin
2171 (lambda* (#:key outputs #:allow-other-keys)
2172 (let ((out (assoc-ref outputs "out")))
2173 (mkdir (string-append out "/bin"))
2174 (symlink (string-append out "/share/phockup/phockup.py")
2175 (string-append out "/bin/phockup")))
2178 `(("perl-image-exiftool" ,perl-image-exiftool)
2179 ("python" ,python)))
2181 `(("python-pytest" ,python-pytest)
2182 ("python-pytest-mock" ,python-pytest-mock)))
2183 (home-page "https://github.com/ivandokov/phockup")
2184 (synopsis "Organize photos and videos in folders")
2185 (description "Phockup is a media sorting tool that uses creation date and
2186 time information in photos and videos to organize them into folders by year,
2187 month and day. All files which are not images or videos or those which do not
2188 have creation date information will be placed in a folder called
2190 (license license:expat)))