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 "08kixcf3a7s9x91174abjnk1xbvj4v8crdc73zi4k9h3jfbm00k5"))))
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 ijg-libjpeg-8
402 (package (inherit ijg-libjpeg)
406 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
409 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
411 (define-public libjxr
416 ;; We are using the Debian source because CodePlex does not
417 ;; deliver an easily downloadable tarball.
419 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
420 version ".orig.tar.gz"))
423 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
424 (patch-flags '("-p1" "--binary"))
425 (patches (search-patches "libjxr-fix-function-signature.patch"
426 "libjxr-fix-typos.patch"))))
427 (build-system gnu-build-system)
431 ;; A substitute* procedure call would be enough to add the -fPIC
432 ;; flag if there was no file decoding error.
433 ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
434 ;; terminators" according to the file(1) utility.
435 (string-append "CFLAGS=-I. -Icommon/include -Iimage/sys -fPIC "
436 "-D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O "))
437 #:tests? #f ; no check target
439 (modify-phases %standard-phases
440 (delete 'configure) ; no configure script
441 (add-after 'build 'build-shared-library
443 ;; The Makefile uses optimization level 1, so the same
444 ;; level is used here for consistency.
445 (invoke "gcc" "-shared" "-fPIC" "-O"
447 "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
448 "strTransform.o" "perfTimerANSI.o"
450 "decode.o" "postprocess.o" "segdec.o" "strdec.o"
451 "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
453 "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
456 (invoke "gcc" "-shared" "-fPIC" "-O"
458 "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
460 "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
461 "JXRTestTif.o" "JXRTestYUV.o"
462 "-o" "libjxrglue.so")))
463 ;; The upstream makefile does not include an install phase.
465 (lambda* (#:key outputs #:allow-other-keys)
466 (let* ((out (assoc-ref outputs "out"))
467 (bin (string-append out "/bin"))
468 (lib (string-append out "/lib"))
469 (include (string-append out "/include/jxrlib")))
470 (for-each (lambda (file)
471 (install-file file include)
474 '("jxrgluelib/JXRGlue.h"
475 "jxrgluelib/JXRMeta.h"
476 "jxrtestlib/JXRTest.h"
477 "image/sys/windowsmediaphoto.h")
478 (find-files "common/include" "\\.h$")))
479 (for-each (lambda (file)
480 (install-file file lib)
482 (find-files "." "\\.(a|so)$"))
483 (for-each (lambda (file)
484 (install-file file bin)
486 '("JxrDecApp" "JxrEncApp")))
488 (synopsis "Implementation of the JPEG XR standard")
489 (description "JPEG XR is an approved ISO/IEC International standard (its
490 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
492 (license:non-copyleft
494 "See the header of the Makefile in the distribution."))
495 (home-page "https://jxrlib.codeplex.com/")))
497 (define-public jpegoptim
503 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
506 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
507 (build-system gnu-build-system)
508 (inputs `(("libjpeg" ,libjpeg-turbo)))
510 '(#:tests? #f)) ; no tests
511 (synopsis "Optimize JPEG images")
513 "jpegoptim provides lossless optimization (based on optimizing
514 the Huffman tables) and \"lossy\" optimization based on setting
515 maximum quality factor.")
516 (license license:gpl2+)
517 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
519 (define-public libicns
526 "mirror://sourceforge/icns/"
527 "libicns-" version ".tar.gz"))
530 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
531 (build-system gnu-build-system)
536 `(#:tests? #t)) ; No tests.
537 (home-page "http://icns.sourceforge.net/")
538 (synopsis "Library for handling Mac OS icns resource files")
540 "Libicns is a library for the manipulation of Mac OS IconFamily resource
541 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
542 convert between PNG and ICNS. @command{icns2png} will extract image files from
543 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
544 with .desktop files. Additionally, @command{icontainer2png} is provided for
545 extracting icontainer icon files.")
546 (license (list license:lgpl2.1+ ; libicns
547 license:lgpl2.0+ ; src/apidocs.*
548 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
550 (define-public libtiff
557 (uri (string-append "https://download.osgeo.org/libtiff/tiff-"
561 "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax"))))
562 (build-system gnu-build-system)
564 "doc")) ;1.3 MiB of HTML documentation
566 ;; Instead of using --docdir, this package has its own --with-docdir.
567 `(#:configure-flags (list (string-append "--with-docdir="
568 (assoc-ref %outputs "doc")
571 "--disable-static")))
572 (inputs `(("zlib" ,zlib)
573 ("libjpeg" ,libjpeg-turbo)))
574 (synopsis "Library for handling TIFF files")
576 "Libtiff provides support for the Tag Image File Format (TIFF), a format
577 used for storing image data.
578 Included are a library, libtiff, for reading and writing TIFF and a small
579 collection of tools for doing simple manipulations of TIFF images.")
580 (license (license:non-copyleft "file://COPYRIGHT"
581 "See COPYRIGHT in the distribution."))
582 (home-page "http://www.simplesystems.org/libtiff/")))
584 (define-public leptonica
592 (url "https://github.com/DanBloomberg/leptonica")
594 (file-name (git-file-name name version))
596 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
597 (build-system gnu-build-system)
599 `(("gnuplot" ,gnuplot) ;needed for test suite
600 ("autoconf" ,autoconf)
601 ("automake" ,automake)
603 ("pkg-config" ,pkg-config)))
606 ("libjpeg" ,libjpeg-turbo)
610 ("openjpeg" ,openjpeg)
614 (modify-phases %standard-phases
615 (add-after 'unpack 'patch-reg-wrapper
617 (substitute* "prog/reg_wrapper.sh"
619 (string-append " " (which "sh") " "))
623 (add-after 'install 'provide-absolute-giflib-reference
624 (lambda* (#:key inputs outputs #:allow-other-keys)
625 (let ((out (assoc-ref outputs "out"))
626 (giflib (assoc-ref inputs "giflib")))
627 ;; Add an absolute reference to giflib to avoid propagation.
628 (with-directory-excursion (string-append out "/lib")
629 (substitute* '("liblept.la" "pkgconfig/lept.pc")
630 (("-lgif") (string-append "-L" giflib "/lib -lgif"))))
632 (home-page "http://www.leptonica.com/")
633 (synopsis "Library and tools for image processing and analysis")
635 "Leptonica is a C library and set of command-line tools for efficient
636 image processing and image analysis operations. It supports rasterop, affine
637 transformations, binary and grayscale morphology, rank order, and convolution,
638 seedfill and connected components, image transformations combining changes in
639 scale and pixel depth, and pixelwise masking, blending, enhancement, and
641 (license license:bsd-2)))
643 (define-public jbig2dec
649 (uri (string-append "https://github.com/ArtifexSoftware"
650 "/ghostpdl-downloads/releases/download"
651 "/gs951/" name "-" version ".tar.gz"))
654 "0pigfw2v0ppvr0lbysm69gx0zsa5q2q92yrb8af2j3im6x97f6cy"))))
655 (build-system gnu-build-system)
656 (arguments '(#:configure-flags '("--disable-static")
657 #:phases (modify-phases %standard-phases
658 (add-before 'bootstrap 'force-bootstrap
660 ;; XXX: jbig2dec 0.18 was released with
661 ;; a broken configure script, so we
662 ;; recreate the build system here.
663 ;; Remove the autoconf inputs below
664 ;; when deleting this code.
665 (delete-file "configure")
666 (delete-file "autogen.sh")
669 `(("autoconf" ,autoconf)
670 ("automake" ,automake)
672 ("python" ,python-wrapper))) ;for tests
673 (synopsis "Decoder of the JBIG2 image compression format")
675 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
676 monochrome) images at moderately high resolution, and in particular scanned
677 paper documents. In this domain it is very efficient, offering compression
678 ratios on the order of 100:1.
680 This is a decoder only implementation, and currently is in the alpha
681 stage, meaning it doesn't completely work yet. However, it is
682 maintaining parity with available encoders, so it is useful for real
684 (home-page "https://jbig2dec.com")
685 (license license:gpl2+)))
687 (define-public jbigkit
694 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
695 "download/jbigkit-" version ".tar.gz"))
697 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
698 (modules '((guix build utils)))
701 ;; Remove files without clear licence information.
702 (for-each delete-file-recursively
703 (list "contrib" "examples"))
705 (build-system gnu-build-system)
706 (outputs (list "out" "pbmtools"))
708 `(#:modules ((srfi srfi-26)
709 ,@%gnu-build-system-modules)
711 (modify-phases %standard-phases
712 (delete 'configure) ; no configure script
713 (replace 'install ; no ‘make install’ target
714 (lambda* (#:key outputs #:allow-other-keys)
715 (let* ((out (assoc-ref outputs "out"))
716 (lib (string-append out "/lib"))
717 (include (string-append out "/include")))
718 (with-directory-excursion "libjbig"
719 (for-each (cut install-file <> include)
720 (find-files "." "\\.h$"))
721 (for-each (cut install-file <> lib)
722 (find-files "." "\\.a$")))
724 (add-after 'install 'install-pbmtools
725 (lambda* (#:key outputs #:allow-other-keys)
726 (let* ((out (assoc-ref outputs "pbmtools"))
727 (bin (string-append out "/bin"))
728 (man1 (string-append out "/share/man/man1"))
729 (man5 (string-append out "/share/man/man5")))
730 (with-directory-excursion "pbmtools"
731 (for-each (cut install-file <> bin)
732 (list "jbgtopbm" "jbgtopbm85"
733 "pbmtojbg" "pbmtojbg85"))
735 (for-each (cut install-file <> man1)
736 (find-files "." "\\.1$"))
737 (for-each (cut install-file <> man5)
738 (find-files "." "\\.5$"))
741 #:tests? #f)) ; tests depend on examples/
742 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
743 (synopsis "Lossless compression for bi-level high-resolution images")
745 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
746 ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
747 black-and-white scanned documents. It is widely used in fax products, printer
748 firmware and drivers, document management systems, and imaging software.
750 This package provides a static C library of (de)compression functions and some
751 simple command-line converters similar to those provided by netpbm.
753 Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
754 options of the standard but has to keep the full uncompressed image in memory.
755 The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
756 memory management optimized for embedded and fax applications. It buffers
757 only a few lines of the uncompressed image in memory and is able to stream
758 images of initially unknown height.")
759 (license (list license:isc ; pbmtools/p?m.5
760 license:gpl2+)))) ; the rest
762 (define-public openjpeg
769 (url "https://github.com/uclouvain/openjpeg")
770 (commit (string-append "v" version))))
771 (file-name (git-file-name "openjpeg" version))
774 "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb"))))
775 (build-system cmake-build-system)
777 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
778 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
784 (synopsis "JPEG 2000 codec")
786 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
787 been developed in order to promote the use of JPEG 2000, the new
788 still-image compression standard from the Joint Photographic Experts
791 In addition to the basic codec, various other features are under
792 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
793 an indexing tool useful for the JPIP protocol, JPWL-tools for
794 error-resilience, a Java-viewer for j2k-images, ...")
795 (home-page "https://github.com/uclouvain/openjpeg")
796 (license license:bsd-2)))
798 (define-public openjpeg-1
799 (package (inherit openjpeg)
806 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
807 name "-" version ".tar.gz"))
809 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
811 (define-public giflib
817 (uri (string-append "mirror://sourceforge/giflib/giflib-"
821 "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii"))))
822 (build-system gnu-build-system)
823 (outputs '("bin" ; utility programs
826 '(#:make-flags (list "CC=gcc"
827 (string-append "PREFIX="
828 (assoc-ref %outputs "out"))
829 (string-append "BINDIR="
830 (assoc-ref %outputs "bin") "/bin"))
832 (modify-phases %standard-phases
833 (add-after 'unpack 'disable-html-doc-gen
835 (substitute* "doc/Makefile"
836 (("^all: allhtml manpages") ""))
839 (add-after 'install 'install-manpages
840 (lambda* (#:key outputs #:allow-other-keys)
841 (let* ((bin (assoc-ref outputs "bin"))
842 (man1dir (string-append bin "/share/man/man1")))
844 (for-each (lambda (file)
845 (let ((base (basename file)))
846 (format #t "installing `~a' to `~a'~%"
851 (find-files "doc" "\\.1"))
853 (synopsis "Tools and library for working with GIF images")
855 "GIFLIB is a library for reading and writing GIF images. It is API and
856 ABI compatible with libungif which was in wide use while the LZW compression
857 algorithm was patented. Tools are also included to convert, manipulate,
858 compose, and analyze GIF images.")
859 (home-page "http://giflib.sourceforge.net/")
860 (license license:x11)))
862 (define-public libuemf
868 (uri (string-append "mirror://sourceforge/libuemf/libUEMF-"
872 "05djs99vqf067x81xfpskh7a66y5x7b4mmjavybcy7swnm0swg7v"))))
873 (build-system cmake-build-system)
876 (modify-phases %standard-phases
877 ;; Overriding CMAKE_INSTALL_PREFIX is not a good idea.
878 (add-after 'unpack 'fix-CMakeLists.txt
880 (substitute* "CMakeLists.txt"
881 ((".*SET\\(CMAKE_INSTALL_PREFIX.*") ""))
884 (add-after 'install 'check
885 (lambda* (#:key inputs outputs #:allow-other-keys)
886 (let* ((out (assoc-ref outputs "out"))
887 (bin (string-append out "/bin"))
888 (sources (string-append "../libUEMF-" ,version))
889 (drm-tools (assoc-ref inputs "drm-tools"))
890 (extract (string-append drm-tools "/bin/extract"))
891 (execinput (string-append drm-tools "/bin/execinput")))
892 (with-directory-excursion sources
893 (substitute* "testit.sh"
895 (format #f "EPATH=~a~%" bin))
899 (format #f "EXTRACT=~a~%" extract))
901 (format #f "EXECINPUT=~a~%" execinput)))
902 (invoke "sh" "testit.sh"))))))))
903 (native-inputs `(("drm-tools" ,drm-tools))) ;for tests
904 (home-page "http://libuemf.sourceforge.net/")
905 (synopsis "Library for working with WFM, EMF and EMF+ images")
906 (description "The libUEMF library is a portable C99 implementation for
907 reading and writing @acronym{WFM, Windows Metafile}, @acronym{EMF, Enhanced
908 Metafile}, and @acronym{EMF+, Enhanced Metafile Plus} files.")
909 (license license:gpl2+)))
911 (define-public libungif
917 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
918 "libungif-" version "/libungif-"
922 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
923 (build-system gnu-build-system)
924 (inputs `(("perl" ,perl))) ;package ships some perl tools
925 (home-page "http://giflib.sourceforge.net/")
926 (synopsis "GIF decompression library")
928 "libungif is the old GIF decompression library by the GIFLIB project.")
929 (license license:expat)))
931 (define-public imlib2
938 "mirror://sourceforge/enlightenment/imlib2-src/" version
939 "/imlib2-" version ".tar.bz2"))
942 "0v8n3dswx7rxqfd0q03xwc7j2w1mv8lv18rdxv487a1xw5vklfad"))))
943 (build-system gnu-build-system)
945 `(("pkgconfig" ,pkg-config)))
948 ("freetype" ,freetype)
950 ("libid3tag" ,libid3tag)
951 ("libjpeg" ,libjpeg-turbo)
956 ("libwebp" ,libwebp)))
957 (home-page "https://sourceforge.net/projects/enlightenment/")
959 "Loading, saving, rendering and manipulating image files")
961 "Imlib2 is a library that does image file loading and saving as well as
962 rendering, manipulation, arbitrary polygon support, etc.
964 It does ALL of these operations FAST. Imlib2 also tries to be highly
965 intelligent about doing them, so writing naive programs can be done easily,
966 without sacrificing speed.
968 This is a complete rewrite over the Imlib 1.x series. The architecture is
969 more modular, simple, and flexible.")
970 (license license:imlib2)))
972 (define-public giblib
980 "http://linuxbrit.co.uk/downloads/giblib-"
983 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
984 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
987 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
988 "files/giblib/giblib-" version ".tar.gz")))
991 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
992 (build-system gnu-build-system)
997 ;; This vanished page is universally accepted as giblib's home despite not
998 ;; mentioning the package once.
999 (string-append "https://web.archive.org/web/20140907071208/"
1000 "https://linuxbrit.co.uk/software/"))
1001 (synopsis "Wrapper library for imlib2")
1003 "Giblib is a simple library which wraps imlib2's context API, avoiding
1004 all the context_get/set calls, adds fontstyles to the truetype renderer and
1005 supplies a generic doubly-linked list and some string functions.")
1006 ;; This license removes a clause about X Consortium from the original
1008 (license (license:x11-style "file://COPYING"
1009 "See 'COPYING' in the distribution."))))
1011 (define-public freeimage
1018 "mirror://sourceforge/freeimage/Source%20Distribution/"
1019 version "/FreeImage"
1020 (string-concatenate (string-split version #\.))
1024 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
1025 (modules '((guix build utils)))
1030 (delete-file-recursively (string-append "Source/" dir)))
1031 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
1032 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
1033 (patches (search-patches "freeimage-unbundle.patch"))))
1034 (build-system gnu-build-system)
1037 (modify-phases %standard-phases
1038 ;; According to Fedora these files depend on private headers, but their
1039 ;; presence is required for building, so we replace them with empty files.
1040 (add-after 'unpack 'delete-unbuildable-files
1042 (for-each (lambda (file)
1044 (close (open file O_CREAT)))
1045 '("Source/FreeImage/PluginG3.cpp"
1046 "Source/FreeImageToolkit/JPEGTransform.cpp"))
1048 ;; These scripts generate the Makefiles.
1051 (invoke "sh" "gensrclist.sh")
1052 (invoke "sh" "genfipsrclist.sh")))
1053 (add-before 'build 'patch-makefile
1054 (lambda* (#:key outputs #:allow-other-keys)
1055 (substitute* "Makefile.gnu"
1056 (("/usr") (assoc-ref outputs "out"))
1057 (("-o root -g root") ""))
1061 ;; We need '-fpermissive' for Source/FreeImage.h.
1062 ;; libjxr doesn't have a pkg-config file.
1063 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
1064 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
1065 #:tests? #f)) ; no check target
1067 `(("pkg-config" ,pkg-config)
1070 `(("libjpeg" ,libjpeg-turbo)
1074 ("libtiff" ,libtiff)
1075 ("libwebp" ,libwebp)
1076 ("openexr" ,openexr)
1077 ("openjpeg" ,openjpeg)
1079 (synopsis "Library for handling popular graphics image formats")
1081 "FreeImage is a library for developers who would like to support popular
1082 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1083 (license license:gpl2+)
1084 (home-page "http://freeimage.sourceforge.net")))
1086 (define-public vigra
1093 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
1094 "Version-" (string-join (string-split version #\.) "-")
1095 "/vigra-" version "-src.tar.gz"))
1096 (patches (search-patches "vigra-python-compat.patch"))
1098 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
1099 (build-system cmake-build-system)
1105 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
1106 ; to create a configure-flag
1107 ("libjpeg" ,libjpeg-turbo)
1109 ("libtiff" ,libtiff)
1110 ("openexr" ,openexr)
1111 ("python" ,python-wrapper)
1112 ("python-numpy" ,python-numpy)
1115 `(("doxygen" ,doxygen)
1116 ("python-nose" ,python-nose)
1117 ("sphinx" ,python-sphinx)))
1119 `(#:test-target "check"
1121 (modify-phases %standard-phases
1122 (add-after 'unpack 'disable-broken-tests
1124 ;; See https://github.com/ukoethe/vigra/issues/432
1125 (substitute* "test/fourier/CMakeLists.txt"
1126 (("VIGRA_ADD_TEST.*") ""))
1127 ;; This test fails with Numpy 1.15:
1128 ;; <https://github.com/ukoethe/vigra/issues/436>.
1129 (substitute* "vigranumpy/test/CMakeLists.txt"
1130 (("test1\\.py") ""))
1133 (list "-Wno-dev" ; suppress developer mode with lots of warnings
1134 (string-append "-DVIGRANUMPY_INSTALL_DIR="
1135 (assoc-ref %outputs "out")
1137 ,(version-major+minor (package-version python))
1139 ;; OpenEXR is not enabled by default.
1141 ;; Fix rounding error on 32-bit machines
1142 "-DCMAKE_C_FLAGS=-ffloat-store"
1143 ;; The header files of ilmbase are not found when included
1144 ;; by the header files of openexr, and an explicit flag
1146 (string-append "-DCMAKE_CXX_FLAGS=-I"
1147 (assoc-ref %build-inputs "ilmbase")
1149 " -ffloat-store"))))
1150 (synopsis "Computer vision library")
1152 "VIGRA stands for Vision with Generic Algorithms. It is an image
1153 processing and analysis library that puts its main emphasis on customizable
1154 algorithms and data structures. It is particularly strong for
1155 multi-dimensional image processing.")
1156 (license license:expat)
1157 (home-page "https://ukoethe.github.io/vigra/")))
1159 (define-public vigra-c
1160 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1164 (version (git-version "0.0.0" revision commit))
1165 (home-page "https://github.com/BSeppke/vigra_c")
1173 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
1174 (file-name (git-file-name name version))))
1175 (build-system cmake-build-system)
1177 `(#:tests? #f)) ; No test target.
1179 `(("doxygen" ,doxygen)))
1185 (synopsis "C interface to the VIGRA computer vision library")
1187 "This package provides a C interface to the VIGRA C++ computer vision
1188 library. It is designed primarily to ease the implementation of higher-level
1189 language bindings to VIGRA.")
1190 (license license:expat))))
1192 (define-public libwebp
1198 ;; No tarballs are provided for >0.6.1.
1201 (url "https://chromium.googlesource.com/webm/libwebp")
1202 (commit (string-append "v" version))))
1203 (file-name (git-file-name name version))
1206 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
1207 (build-system gnu-build-system)
1209 `(("freeglut" ,freeglut)
1211 ("libjpeg" ,libjpeg-turbo)
1213 ("libtiff" ,libtiff)))
1215 `(("autoconf" ,autoconf)
1216 ("automake" ,automake)
1217 ("libtool" ,libtool)))
1219 '(#:configure-flags '("--enable-libwebpmux"
1220 "--enable-libwebpdemux"
1221 "--enable-libwebpdecoder"
1222 "--disable-static")))
1223 (home-page "https://developers.google.com/speed/webp/")
1224 (synopsis "Lossless and lossy image compression")
1226 "WebP is a new image format that provides lossless and lossy compression
1227 for images. WebP lossless images are 26% smaller in size compared to
1228 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1229 equivalent SSIM index. WebP supports lossless transparency (also known as
1230 alpha channel) with just 22% additional bytes. Transparency is also supported
1231 with lossy compression and typically provides 3x smaller file sizes compared
1232 to PNG when lossy compression is acceptable for the red/green/blue color
1234 (license license:bsd-3)))
1236 (define-public libmng
1242 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1243 version "/" name "-" version ".tar.xz"))
1246 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1247 (build-system gnu-build-system)
1249 ;; These are all in the 'Libs.private' field of libmng.pc.
1251 ("libjpeg" ,libjpeg-turbo)
1253 (home-page "https://www.libmng.com/")
1254 (synopsis "Library for handling MNG files")
1256 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1257 (license license:bsd-3)))
1259 (define-public exiv2
1266 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
1269 (base32 "0gqminvj14xm3rgbnydbywf22608js80rp7nmxxk4497j5mzali6"))))
1270 (build-system cmake-build-system)
1271 (arguments '(#:tests? #f)) ; no test suite
1275 (home-page "https://www.exiv2.org/")
1276 (synopsis "Library and command-line utility to manage image metadata")
1278 "Exiv2 is a C++ library and a command line utility to manage image
1279 metadata. It provides fast and easy read and write access to the Exif, IPTC
1280 and XMP metadata of images in various formats.")
1282 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1283 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1284 ;; The core is GPLv2+:
1285 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1286 (license license:gpl2+)))
1288 (define-public exiv2-0.26
1294 (uri (list (string-append "https://www.exiv2.org/builds/exiv2-"
1295 version "-trunk.tar.gz")
1296 (string-append "https://www.exiv2.org/exiv2-"
1298 (string-append "https://fossies.org/linux/misc/exiv2-"
1299 version ".tar.gz")))
1300 (patches (search-patches "exiv2-CVE-2017-14860.patch"
1301 "exiv2-CVE-2017-14859-14862-14864.patch"))
1304 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
1305 (build-system gnu-build-system)
1306 (arguments '(#:tests? #f)) ; no `check' target
1311 `(("intltool" ,intltool)))
1313 ;; People should rely on the newer version, so don't expose it.
1314 (properties `((hidden? . #t)))))
1316 (define-public devil
1322 (uri (string-append "http://downloads.sourceforge.net/openil/"
1323 "DevIL-" version ".tar.gz"))
1326 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1327 (build-system cmake-build-system)
1329 '(;; XXX: Not supported in the released CMakeLists.txt.
1330 ;; Enable this for > 1.8.0.
1333 (modify-phases %standard-phases
1334 (add-before 'configure 'change-directory
1335 (lambda _ (chdir "DevIL") #t)))))
1337 `(("pkg-config" ,pkg-config)))
1340 ("libjpeg" ,libjpeg-turbo)
1343 ("libtiff" ,libtiff)
1344 ("openexr" ,openexr)
1346 (synopsis "Library for manipulating many image formats")
1347 (description "Developer's Image Library (DevIL) is a library to develop
1348 applications with support for many types of images. DevIL can load, save,
1349 convert, manipulate, filter and display a wide variety of image formats.")
1350 (home-page "http://openil.sourceforge.net")
1351 (license license:lgpl2.1+)))
1353 (define-public jasper
1360 (url "https://github.com/mdadams/jasper")
1361 (commit (string-append "version-" version))))
1362 (file-name (git-file-name name version))
1365 "05l75yd1zsxwv25ykwwwjs8961szv7iywf16nc6vc6qpby27ckv6"))))
1366 (build-system cmake-build-system)
1367 (inputs `(("libjpeg" ,libjpeg-turbo)))
1368 (synopsis "JPEG-2000 library")
1369 (description "The JasPer Project is an initiative to provide a reference
1370 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1372 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1373 (license (license:x11-style "file://LICENSE"))))
1383 (url "https://github.com/sekrit-twc/zimg")
1384 (commit (string-append "release-" version))))
1385 (file-name (git-file-name name version))
1387 (base32 "1dqyrq3p8bkgvj4ci50ac342hjnhyz6xxvhiwp7wpi3v3nbj7s02"))))
1388 (build-system gnu-build-system)
1390 `(("autoconf" ,autoconf)
1391 ("automake" ,automake)
1392 ("libtool" ,libtool)))
1393 (synopsis "Scaling, colorspace conversion, and dithering library")
1394 (description "Zimg implements the commonly required image processing basics
1395 of scaling, colorspace conversion, and depth conversion. A simple API enables
1396 conversion between any supported formats to operate with minimal knowledge from
1398 (home-page "https://github.com/sekrit-twc/zimg")
1399 ;; test/extra/ contains musl-libm,
1400 ;; which is MIT/expat licensed, but only used for tests
1401 (license license:wtfpl2)))
1403 (define-public perceptualdiff
1405 (name "perceptualdiff")
1411 (url "https://github.com/myint/perceptualdiff")
1412 (commit (string-append "v" version))))
1413 (file-name (git-file-name name version))
1415 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
1416 (build-system cmake-build-system)
1417 (inputs `(("freeimage" ,freeimage)))
1419 '(#:phases (modify-phases %standard-phases
1420 (add-after 'unpack 'fix-tests
1421 ;; cmake-build-system uses a build/ directory outside
1422 ;; of the source tree, one level higher than expected
1424 (substitute* "test/run_tests.bash"
1425 (("../build") "../../build"))
1427 (home-page "https://github.com/myint/perceptualdiff")
1428 (synopsis "Perceptual image comparison utility")
1429 (description "PerceptualDiff visually compares two images to determine
1430 whether they look alike. It uses a computational model of the human visual
1431 system to detect similarities. This allows it too see beyond irrelevant
1432 differences in file encoding, image quality, and other small variations.")
1433 (license license:gpl2+)))
1435 (define-public steghide
1441 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1442 version "/steghide-" version ".tar.bz2"))
1445 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1446 (patches (list (search-patch "steghide-fixes.patch")))))
1447 (build-system gnu-build-system)
1449 `(("gettext" ,gettext-minimal)
1450 ("libtool" ,libtool)
1451 ("perl" ,perl))) ;for tests
1453 `(("libmhash" ,libmhash)
1454 ("libmcrypt" ,libmcrypt)
1455 ("libjpeg" ,libjpeg-turbo)
1458 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1460 #:phases (modify-phases %standard-phases
1461 (add-before 'configure 'set-perl-search-path
1463 ;; Work around "dotless @INC" build failure.
1465 (string-append (getcwd) "/tests:"
1466 (getenv "PERL5LIB")))
1468 (home-page "http://steghide.sourceforge.net")
1469 (synopsis "Image and audio steganography")
1471 "Steghide is a program to hide data in various kinds of image and audio
1472 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1473 changed, making the embedding resistant against first-order statistical tests.")
1474 (license license:gpl2+)))
1476 (define-public stb-image-for-extempore
1477 (let ((revision "1")
1478 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1480 (name "stb-image-for-extempore")
1481 (version (string-append "0-" revision "." (string-take commit 9)))
1483 (origin (method git-fetch)
1485 (url "https://github.com/extemporelang/stb")
1489 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1490 (file-name (string-append name "-" version "-checkout"))))
1491 (build-system cmake-build-system)
1492 (arguments `(#:tests? #f)) ; no tests included
1493 ;; Extempore refuses to build on architectures other than x86_64
1494 (supported-systems '("x86_64-linux"))
1495 (home-page "https://github.com/extemporelang/stb")
1496 (synopsis "Image library for Extempore")
1498 "This package is a collection of assorted single-file libraries. Of
1499 all included libraries only the image loading and decoding library is
1500 installed as @code{stb_image}.")
1501 (license license:public-domain))))
1503 (define-public optipng
1510 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1514 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1515 (modules '((guix build utils)))
1518 (delete-file-recursively "src/libpng")
1519 (delete-file-recursively "src/zlib")
1521 (build-system gnu-build-system)
1523 `(("libpng" ,libpng)
1527 (modify-phases %standard-phases
1529 (lambda* (#:key outputs #:allow-other-keys)
1530 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1531 (invoke "sh" "configure"
1532 (string-append "--prefix=" (assoc-ref outputs "out"))
1533 "-with-system-libs")
1535 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1536 (description "OptiPNG is a PNG optimizer that recompresses image
1537 files to a smaller size, without losing any information. This program
1538 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1539 PNG, and performs PNG integrity checks and corrections.")
1540 (home-page "http://optipng.sourceforge.net/")
1541 (license license:zlib)))
1543 (define-public pngsuite
1546 (version "2017jul19")
1549 (method url-fetch/tarbomb)
1550 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
1554 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
1555 (build-system gnu-build-system)
1557 '(#:tests? #f ; there is no test target
1558 #:license-file-regexp "PngSuite.LICENSE"
1560 (modify-phases %standard-phases
1562 (lambda* (#:key outputs #:allow-other-keys)
1563 (let ((out (assoc-ref outputs "out")))
1564 (copy-recursively "." (string-append out "/"))
1567 (delete 'configure))))
1568 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
1569 (synopsis "Example PNGs for use in test suites")
1570 (description "Collection of graphics images created to test PNG
1571 applications like viewers, converters and editors. As far as that is
1572 possible, all formats supported by the PNG standard are represented.")
1573 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1574 use, copy, modify and distribute these images for any purpose and without fee
1575 is hereby granted."))))
1577 (define-public libjpeg-turbo
1579 (name "libjpeg-turbo")
1583 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1584 version "/libjpeg-turbo-" version ".tar.gz"))
1587 "01ill8bgjyk582wipx7sh7gj2nidylpbzvwhx0wkcm6mxx3qbp9k"))))
1588 (build-system cmake-build-system)
1592 `(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1594 ;; djpeg-shared-3x2-float-prog-cmp fails on 32-bit PPC.
1595 ,@(if (string=? "powerpc-linux" (%current-system))
1598 ;; The build system probes for the current CPU, but
1599 ;; that fails when cross-compiling.
1600 ,@(let ((target (%current-target-system)))
1603 ((string-prefix? "arm" target)
1604 `("-DCMAKE_SYSTEM_PROCESSOR=arm"))
1605 ((string-prefix? "aarch64" target)
1606 `("-DCMAKE_SYSTEM_PROCESSOR=aarch64"))
1607 ((string-prefix? "i686" target)
1608 `("-DCMAKE_SYSTEM_PROCESSOR=x86"))
1609 ((string-prefix? "x86_64" target)
1610 `("-DCMAKE_SYSTEM_PROCESSOR=x86_64"))
1611 ;; 32-bit and 64-bit
1612 ((string-prefix? "powerpc" target)
1613 `("-DCMAKE_SYSTEM_PROCESSOR=powerpc"))
1616 ,@(if (%current-target-system)
1618 ;; Use a special "bootstrap" CMake for the native build to work
1619 ;; around a circular dependency between CMake and this package.
1620 `(#:cmake ,cmake-bootstrap))))
1621 (home-page "https://libjpeg-turbo.org/")
1622 (synopsis "SIMD-accelerated JPEG image handling library")
1623 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1624 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1625 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1626 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1627 a significant amount.
1628 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1629 but more straightforward TurboJPEG API, and provides a full-featured Java
1630 interface. It supports color space extensions that allow it to compress from
1631 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1632 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1633 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1634 license:ijg ;the libjpeg library and associated tools
1635 license:zlib)))) ;the libjpeg-turbo SIMD extensions
1637 (define-deprecated libjpeg libjpeg-turbo)
1640 (define-public niftilib
1646 (uri (list (string-append "mirror://sourceforge/niftilib/"
1647 "nifticlib/nifticlib_"
1648 (string-join (string-split version #\.) "_")
1649 "/nifticlib-" version ".tar.gz")))
1651 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1652 (build-system gnu-build-system)
1654 '(#:tests? #f ; there is no test target
1655 #:parallel-build? #f ; not supported
1658 (string-append "ZLIB_INC="
1659 (assoc-ref %build-inputs "zlib") "/include")
1660 ;; Append "-fPIC" to CFLAGS.
1661 (string-append "CFLAGS="
1662 "-Wall -ansi -pedantic -fPIC"))
1664 (modify-phases %standard-phases
1666 (lambda* (#:key outputs #:allow-other-keys)
1667 (let ((out (assoc-ref outputs "out")))
1670 (copy-recursively dir (string-append out "/" dir)))
1671 '("bin" "lib" "include")))
1673 (delete 'configure))))
1676 (synopsis "Library for reading and writing files in the nifti-1 format")
1677 (description "Niftilib is a set of i/o libraries for reading and writing
1678 files in the nifti-1 data format - a binary file format for storing
1679 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1680 (fMRI) brain images.")
1681 (home-page "http://niftilib.sourceforge.net")
1682 (license license:public-domain)))
1684 (define-public gpick
1691 (url "https://github.com/thezbyg/gpick")
1692 (commit (string-append name "-" version))))
1693 (file-name (git-file-name name version))
1696 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
1697 (build-system scons-build-system)
1700 ("gettext" ,gettext-minimal)
1701 ("pkg-config" ,pkg-config)))
1708 #:scons ,scons-python2
1709 #:scons-flags (list (string-append "DESTDIR=" %output))
1711 (modify-phases %standard-phases
1712 (add-before 'build 'fix-lua-reference
1714 (substitute* "SConscript"
1715 (("lua5.2") "lua-5.2"))
1717 (home-page "http://www.gpick.org/")
1718 (synopsis "Color picker")
1719 (description "Gpick is an advanced color picker and palette editing tool.")
1720 (license license:bsd-3)))
1722 (define-public libiptcdata
1724 (name "libiptcdata")
1728 (uri (string-append "https://github.com/ianw/libiptcdata"
1729 "/releases/download/release_"
1730 (string-join (string-split version #\.) "_")
1731 "/" name "-" version ".tar.gz"))
1734 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
1735 (build-system gnu-build-system)
1736 (home-page "https://github.com/ianw/libiptcdata")
1737 (synopsis "IPTC metadata manipulation library")
1739 "Libiptcdata is a C library for manipulating the International Press
1740 Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
1741 such as images. This metadata can include captions and keywords, often used by
1742 popular photo management applications. The library provides routines for
1743 parsing, viewing, modifying, and saving this metadata.")
1744 (license license:lgpl2.0+)))
1746 (define-public flameshot
1754 (url "https://github.com/lupoDharkael/flameshot")
1755 (commit (string-append "v" version))))
1756 (file-name (git-file-name name version))
1759 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
1760 (build-system gnu-build-system)
1762 `(("qttools" ,qttools)))
1764 `(("qtbase" ,qtbase)))
1766 `(#:tests? #f ; no tests
1768 (modify-phases %standard-phases
1770 (lambda* (#:key outputs #:allow-other-keys)
1773 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1775 (home-page "https://github.com/lupoDharkael/flameshot")
1776 (synopsis "Powerful yet simple to use screenshot software")
1777 (description "Flameshot is a screenshot program.
1781 @item Customizable appearance.
1783 @item In-app screenshot edition.
1784 @item DBus interface.
1785 @item Upload to Imgur.
1787 (license license:gpl3+)))
1789 (define-public gifsicle
1796 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
1799 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
1800 (build-system gnu-build-system)
1803 (modify-phases %standard-phases
1804 (add-before 'check 'patch-tests
1806 (substitute* "test/testie"
1814 (native-inputs `(("perl" ,perl))) ; only for tests
1815 (inputs `(("libx11" ,libx11)))
1816 (home-page "https://www.lcdf.org/gifsicle/")
1817 (synopsis "Edit GIF images and animations")
1818 (description "Gifsicle is a command-line GIF image manipulation tool that:
1821 @item Provides a batch mode for changing GIFs in place.
1822 @item Prints detailed information about GIFs, including comments.
1823 @item Control over interlacing, comments, looping, transparency, etc.
1824 @item Creates well-behaved GIFs: removes redundant colors, only uses local color
1826 @item Shrinks colormaps and change images to use the Web-safe palette.
1827 @item Optimizes GIF animations, or unoptimizes them for easier editing.
1830 Two other programs are included with Gifsicle: @command{gifview} is a
1831 lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1832 identical visual appearance.")
1833 (license license:gpl2+)))
1835 ;; 1.0.7 is buggy and reverted in git repository.
1843 (uri (string-append "mirror://debian/pool/main/j/jp2a/jp2a_"
1844 version ".orig.tar.gz"))
1847 "076frk3pa16s4r1b10zgy81vdlz0385zh3ykbnkaij25jn5aqc09"))))
1848 (build-system gnu-build-system)
1851 ("libjpeg" ,libjpeg-turbo)
1852 ("ncurses" ,ncurses)))
1853 (home-page "https://csl.name/jp2a/")
1854 (synopsis "Convert JPEG images to ASCII")
1856 "Jp2a is a small utility that converts JPEG images to ASCII.")
1857 (license license:gpl2)))
1867 (url "https://github.com/emersion/grim")
1868 (commit (string-append "v" version))))
1869 (file-name (git-file-name name version))
1871 (base32 "0brljl4zfbn5mh9hkfrfkvd27c5y9vdkgap9r1hrfy9r1x20sskn"))))
1872 (build-system meson-build-system)
1873 (native-inputs `(("pkg-config" ,pkg-config)
1875 (inputs `(("cairo" ,cairo)
1876 ("libjpeg-turbo" ,libjpeg-turbo)
1877 ("wayland" ,wayland)
1878 ("wayland-protocols" ,wayland-protocols)))
1879 (home-page "https://github.com/emersion/grim")
1880 (synopsis "Create screenshots from a Wayland compositor")
1881 (description "grim can create screenshots from a Wayland compositor.")
1883 (license license:expat)))
1885 (define-public slurp
1893 (url "https://github.com/emersion/slurp")
1894 (commit (string-append "v" version))))
1895 (file-name (git-file-name name version))
1897 (base32 "0580m6kaiilgsrcj608r837r37sl6a25y7w21p7d6ij20fs3gvg1"))))
1898 (build-system meson-build-system)
1899 (native-inputs `(("pkg-config" ,pkg-config)))
1900 (inputs `(("cairo" ,cairo)
1902 ("wayland" ,wayland)
1903 ("wayland-protocols" ,wayland-protocols)))
1904 (home-page "https://github.com/emersion/slurp")
1905 (synopsis "Select a region in a Wayland compositor")
1906 (description "Slurp can select a region in a Wayland compositor and print it
1907 to the standard output. It works well together with grim.")
1909 (license license:expat)))
1918 (uri (string-append "mirror://sourceforge/sng/sng-"
1921 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
1922 (build-system gnu-build-system)
1925 (modify-phases %standard-phases
1926 (add-before 'check 'link-pngsuite
1927 ;; tests expect pngsuite in source dir
1928 (lambda* (#:key inputs #:allow-other-keys)
1929 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
1932 (list (string-append "--with-rgbtxt="
1933 (assoc-ref %build-inputs "xorg-rgb")
1934 "/share/X11/rgb.txt"))))
1935 (inputs `(("xorg-rgb" ,xorg-rgb)
1936 ("libpng" ,libpng)))
1937 (native-inputs `(("pngsuite" ,pngsuite)))
1938 (home-page "http://sng.sourceforge.net")
1939 (synopsis "Markup language for representing PNG contents")
1940 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
1941 specifically to represent the entire contents of a PNG (Portable Network
1942 Graphics) file in an editable form. Thus, SNGs representing elaborate
1943 graphics images and ancillary chunk data can be readily generated or modified
1944 using only text tools.
1946 SNG is implemented by a compiler/decompiler called sng that
1947 losslessly translates between SNG and PNG.")
1948 (license license:zlib)))
1950 (define-public lodepng
1951 ;; There are no tags in the repository, so we take the version as defined in
1953 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
1955 (version "20200215"))
1958 (version (git-version version revision commit))
1962 (url "https://github.com/lvandeve/lodepng")
1966 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
1967 (file-name (git-file-name name version))))
1968 (build-system gnu-build-system)
1971 (modify-phases %standard-phases
1975 (setenv "CXXFLAGS" "-fPIC")
1976 (invoke "make" "lodepng.o")
1977 (invoke "make" "lodepng_util.o")
1978 (invoke "g++" "-fPIC" "-O3"
1979 "-o" "liblodepng.so"
1980 "-shared" "lodepng.o" "lodepng_util.o")
1984 (invoke "make" "unittest")
1985 (invoke "./unittest")
1988 (lambda* (#:key outputs #:allow-other-keys)
1989 (let* ((out (assoc-ref outputs "out"))
1990 (doc (string-append out "/share/doc"))
1991 (lib (string-append out "/lib"))
1992 (include (string-append out "/include")))
1993 (install-file "lodepng.h" include)
1994 (install-file "lodepng_util.h" include)
1995 (install-file "liblodepng.so" lib)
1996 (install-file "README.md" doc)
1998 (home-page "https://lodev.org/lodepng/")
1999 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
2000 (description "LodePNG is a PNG image decoder and encoder, all in one,
2001 no dependency or linkage required. It's made for C (ISO C90), and has a C++
2002 wrapper with a more convenient interface on top.")
2003 (license license:zlib))))
2005 (define-public icoutils
2013 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
2015 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
2016 (build-system gnu-build-system)
2018 `(("libpng" ,libpng)
2021 `(("perl-libwww" ,perl-libwww)))
2022 (home-page "https://www.nongnu.org/icoutils/")
2023 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
2024 (description "Icoutils are a set of program for extracting and converting
2025 bitmaps from Microsoft Windows icon and cursor files. These files usually
2026 have the extension @code{.ico} or @code{.cur}, but they can also be embedded
2027 in executables and libraries (@code{.dll}-files). (Such embedded files are
2028 referred to as resources.)
2030 Conversion of these files to and from PNG images is done @command{icotool}.
2031 @command{extresso} automates these tasks with the help of special resource
2032 scripts. Resources such can be extracted from MS Windows executable and
2033 library files with @command{wrestool}.
2035 This package can be used to create @code{favicon.ico} files for web sites.")
2036 (license license:gpl3+)))
2038 (define-public libavif
2045 (url "https://github.com/AOMediaCodec/libavif")
2046 (commit (string-append "v" version))))
2047 (file-name (git-file-name name version))
2050 "17hagdngpc4xzrr0aa48nx399y5lawyyx9cpcdhpds1mqk6p77lp"))))
2051 (build-system cmake-build-system)
2053 `(#:configure-flags '("-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
2054 "-DAVIF_CODEC_RAV1E=OFF" ; not packaged yet
2055 "-DAVIF_BUILD_TESTS=ON")
2057 (modify-phases %standard-phases
2060 (invoke "./aviftest" "../source/tests/data")))
2061 (add-after 'install 'install-readme
2062 (lambda* (#:key outputs #:allow-other-keys)
2063 (let* ((out (assoc-ref outputs "out"))
2064 (doc (string-append out "/share/doc/libavif-" ,version)))
2065 (install-file "../source/README.md" doc)
2068 `(("libaom" ,libaom)
2070 (synopsis "Encode and decode AVIF files")
2071 (description "Libavif is a C implementation of @acronym{AVIF, the AV1 Image
2072 File Format}. It can encode and decode all YUV formats and bit depths supported
2073 by AOM, including with alpha.")
2074 (home-page "https://github.com/AOMediaCodec/libavif")
2075 (license (list license:bsd-2 ; libavif itself
2076 license:expat)))) ; cJSON in the test suite
2078 (define-public mtpaint
2081 ;; The author neither releases tarballs nor uses git version tags.
2082 ;; Instead, author puts version in git commit title.
2088 (url "https://github.com/wjaguar/mtPaint")
2089 (commit "26751cd0336414e2f16cbe25c9fe2702f34e7b5c")))
2090 (file-name (git-file-name name version))
2092 (base32 "12mzai9pqvyb342m21rjz0jxiy75q24sjw6ax147pzy8frzkgd54"))))
2093 (build-system gnu-build-system)
2095 `(("gettext" ,gettext-minimal)
2096 ("pkg-config" ,pkg-config)
2099 `(("imlib2" ,imlib2)
2100 ("libtiff" ,libtiff)
2102 ("libungif", libungif)
2103 ("libjpeg", libjpeg-turbo)
2104 ("libwebp" ,libwebp)
2105 ("openjpeg" ,openjpeg)
2109 ;; Support for gtk3 is in the testing stage.
2113 (list "intl" ; build internationalized version
2114 "man") ; build the man page
2115 #:tests? #f)) ; no test suite
2116 (home-page "http://mtpaint.sourceforge.net/")
2117 (synopsis "Create pixel art and manipulate digital images")
2119 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
2120 It can create and edit indexed palette or 24bit RGB images, offers basic
2121 painting and palette manipulation tools. It also handles JPEG, JPEG2000,
2122 GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
2123 (license license:gpl3+)))
2125 (define-public phockup
2133 (url "https://github.com/ivandokov/phockup")
2135 (file-name (git-file-name name version))
2138 "13ajj0xch7yfqaaxbw0awxs0fz17n1rxir4gqh2wcgxjysqk1j2y"))))
2139 (build-system copy-build-system)
2141 `(#:install-plan '(("src" "share/phockup/")
2142 ("phockup.py" "share/phockup/"))
2144 (modify-phases %standard-phases
2145 (add-after 'unpack 'configure
2146 (lambda* (#:key inputs #:allow-other-keys)
2147 (substitute* (list "src/dependency.py" "src/exif.py")
2149 (string-append (assoc-ref inputs "perl-image-exiftool")
2152 (add-before 'install 'check
2155 (add-after 'install 'install-bin
2156 (lambda* (#:key outputs #:allow-other-keys)
2157 (let ((out (assoc-ref outputs "out")))
2158 (mkdir (string-append out "/bin"))
2159 (symlink (string-append out "/share/phockup/phockup.py")
2160 (string-append out "/bin/phockup")))
2163 `(("perl-image-exiftool" ,perl-image-exiftool)
2164 ("python" ,python)))
2166 `(("python-pytest" ,python-pytest)
2167 ("python-pytest-mock" ,python-pytest-mock)))
2168 (home-page "https://github.com/ivandokov/phockup")
2169 (synopsis "Organize photos and videos in folders")
2170 (description "Phockup is a media sorting tool that uses creation date and
2171 time information in photos and videos to organize them into folders by year,
2172 month and day. All files which are not images or videos or those which do not
2173 have creation date information will be placed in a folder called
2175 (license license:expat)))