1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2014, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015 Amirouche Boubekki <amirouche@hypermove.net>
9 ;;; Copyright © 2014, 2017 John Darrington <jmd@gnu.org>
10 ;;; Copyright © 2016, 2017, 2018, 2020 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
13 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
14 ;;; Copyright © 2016, 2017 Arun Isaac <arunisaac@systemreboot.net>
15 ;;; Copyright © 2016, 2017 Kei Kebreau <kkebreau@posteo.net>
16 ;;; Copyright © 2017 ng0 <ng0@n0.is>
17 ;;; Copyright © 2017,2019,2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
18 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
19 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
20 ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
21 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
22 ;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
23 ;;; Copyright © 2018 Pierre-Antoine Rouby <contact@parouby.fr>
24 ;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
25 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
26 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
27 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
29 ;;; This file is part of GNU Guix.
31 ;;; GNU Guix is free software; you can redistribute it and/or modify it
32 ;;; under the terms of the GNU General Public License as published by
33 ;;; the Free Software Foundation; either version 3 of the License, or (at
34 ;;; your option) any later version.
36 ;;; GNU Guix is distributed in the hope that it will be useful, but
37 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39 ;;; GNU General Public License for more details.
41 ;;; You should have received a copy of the GNU General Public License
42 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44 (define-module (gnu packages image)
45 #:use-module (gnu packages)
46 #:use-module (gnu packages algebra)
47 #:use-module (gnu packages assembly)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages boost)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages documentation)
55 #:use-module (gnu packages fontutils)
56 #:use-module (gnu packages freedesktop)
57 #:use-module (gnu packages gettext)
58 #:use-module (gnu packages ghostscript)
59 #:use-module (gnu packages gl)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages graphics)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages lua)
64 #:use-module (gnu packages man)
65 #:use-module (gnu packages maths)
66 #:use-module (gnu packages mcrypt)
67 #:use-module (gnu packages mp3)
68 #:use-module (gnu packages ncurses)
69 #:use-module (gnu packages perl)
70 #:use-module (gnu packages photo)
71 #:use-module (gnu packages pkg-config)
72 #:use-module (gnu packages python)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages qt)
75 #:use-module (gnu packages sphinx)
76 #:use-module (gnu packages video)
77 #:use-module (gnu packages web)
78 #:use-module (gnu packages xml)
79 #:use-module (gnu packages xorg)
80 #:use-module ((guix licenses) #:prefix license:)
81 #:use-module (guix packages)
82 #:use-module (guix download)
83 #:use-module (guix git-download)
84 #:use-module (guix build-system gnu)
85 #:use-module (guix build-system cmake)
86 #:use-module (guix build-system meson)
87 #:use-module (guix build-system python)
88 #:use-module (guix build-system scons)
89 #:use-module (srfi srfi-1))
97 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
98 version "/libpng-" version ".tar.xz")
100 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
101 "/libpng16/libpng-" version ".tar.xz")
103 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
104 "/libpng16/libpng-" version ".tar.xz")))
107 "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh"))))
108 (build-system gnu-build-system)
110 `(#:configure-flags '("--disable-static")))
112 ;; libpng.la says "-lz", so propagate it.
113 (propagated-inputs `(("zlib" ,zlib)))
115 (synopsis "Library for handling PNG files")
117 "Libpng is the official PNG (Portable Network Graphics) reference
118 library. It supports almost all PNG features and is extensible.")
119 (license license:zlib)
120 (home-page "http://www.libpng.org/pub/png/libpng.html")))
122 ;; libpng-apng should be updated when the APNG patch is released:
123 ;; <https://bugs.gnu.org/27556>
124 (define-public libpng-apng
131 (uri (list (string-append "mirror://sourceforge/libpng/libpng16/"
132 version "/libpng-" version ".tar.xz")
134 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
135 "/libpng16/libpng-" version ".tar.xz")
137 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
138 "/libpng16/libpng-" version ".tar.xz")))
141 "0ylgyx93hnk38haqrh8prd3ax5ngzwvjqw5cxw7p9nxmwsfyrlyq"))))
142 (build-system gnu-build-system)
144 `(#:modules ((guix build gnu-build-system)
148 (modify-phases %standard-phases
149 (add-after 'unpack 'patch-apng
150 (lambda* (#:key inputs #:allow-other-keys)
151 (define (apply-patch file)
152 (invoke "patch" "-p1" "--force"
154 (let ((apng.gz (assoc-ref inputs "apng")))
155 (format #t "Applying APNG patch '~a'...~%"
158 (string-append "gunzip < " apng.gz " > the-patch"))
159 (apply-patch "the-patch")
161 (add-before 'configure 'no-checks
163 (substitute* "Makefile.in"
164 (("^scripts/symbols.chk") "")
165 (("check: scripts/symbols.chk") ""))
171 (string-append "mirror://sourceforge/libpng-apng/libpng16/"
172 version "/libpng-" version "-apng.patch.gz"))
175 "0m5nv70n9903x3xzxw9qqc6sgf2rp106ha0x6gix0xf8wcrljaab"))))))
177 `(("libtool" ,libtool)))
178 ;; libpng.la says "-lz", so propagate it.
181 (synopsis "APNG patch for libpng")
183 "APNG (Animated Portable Network Graphics) is an unofficial
184 extension of the APNG (Portable Network Graphics) format.
185 APNG patch provides APNG support to libpng.")
186 (home-page "https://sourceforge.net/projects/libpng-apng/")
187 (license license:zlib)))
189 (define-public libpng-1.2
196 (uri (list (string-append "mirror://sourceforge/libpng/libpng12/"
197 version "/libpng-" version ".tar.xz")
199 "ftp://ftp.simplesystems.org/pub/libpng/png/src"
200 "/libpng12/libpng-" version ".tar.xz")
202 "ftp://ftp.simplesystems.org/pub/libpng/png/src/history"
203 "/libpng12/libpng-" version ".tar.xz")))
206 "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl"))))))
208 (define-public pngcrush
214 (uri (string-append "mirror://sourceforge/pmt/pngcrush/"
215 version "/pngcrush-" version "-nolib.tar.xz"))
217 "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv"))))
218 (build-system gnu-build-system)
220 '(#:tests? #f ; no check target
222 (modify-phases %standard-phases
224 (lambda* (#:key inputs outputs #:allow-other-keys)
225 (substitute* "Makefile"
226 (("^(PNG(INC|LIB) = )/usr/local/" line vardef)
227 (string-append vardef (assoc-ref inputs "libpng") "/"))
228 (("^(Z(INC|LIB) = )/usr/local/" line vardef)
229 (string-append vardef (assoc-ref inputs "zlib") "/"))
230 ;; The Makefile is written by hand and not using $PREFIX
231 (("\\$\\(DESTDIR\\)/usr/")
232 (string-append (assoc-ref outputs "out") "/")))
237 (home-page "https://pmt.sourceforge.io/pngcrush")
238 (synopsis "Utility to compress PNG files")
239 (description "Pngcrush optimizes @acronym{PNG, Portable Network Graphics}
240 images. It can further losslessly compress them by as much as 40%.")
241 (license license:zlib)))
243 (define-public pnglite
244 (let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
248 ;; The project was moved from sourceforge to github.
249 ;; The latest version in sourceforge was 0.1.17:
250 ;; https://sourceforge.net/projects/pnglite/files/pnglite/
251 ;; No releases are made in github.
252 (version (git-version "0.1.17" revision commit))
256 (url "https://github.com/dankar/pnglite")
260 "1lmmkdxby5b8z9kx3zrpgpk33njpcf2xx8z9bgqag855sjsqbbby"))
261 (file-name (git-file-name name version))))
262 (build-system gnu-build-system)
264 `(#:tests? #f ; no tests
266 (modify-phases %standard-phases
270 ;; common build flags for building shared libraries
271 (let ((cflags '("-O2" "-g" "-fPIC"))
272 (ldflags '("-shared")))
281 (lambda* (#:key outputs #:allow-other-keys)
282 (let* ((out (assoc-ref outputs "out"))
283 (lib (string-append out "/lib/"))
284 (include (string-append out "/include/"))
285 (doc (string-append out "/share/doc/"
286 ,name "-" ,version "/")))
287 (install-file "libpnglite.so" lib)
288 (install-file "pnglite.h" include)
289 (install-file "README.md" doc)
291 (inputs `(("zlib" ,zlib)))
292 (home-page "https://github.com/dankar/pnglite")
293 (synopsis "Pretty small png library")
294 (description "A pretty small png library.
295 Currently all documentation resides in @file{pnglite.h}.")
296 (license license:zlib))))
298 (define-public libimagequant
300 (name "libimagequant")
306 (url "https://github.com/ImageOptim/libimagequant.git")
308 (file-name (git-file-name name version))
310 (base32 "0cp68w04ja5pv77ssfafsn958w9hh9zb8crrlb5j3gsrcmdc032k"))))
311 (build-system gnu-build-system)
313 '(#:tests? #f)) ; no check target
314 (home-page "https://pngquant.org/lib/")
315 (synopsis "Image palette quantization library")
316 (description "libimagequant is a small, portable C library for
317 high-quality conversion of RGBA images to 8-bit indexed-color (palette)
318 images. This library can significantly reduces file sizes and powers pngquant
319 and other PNG optimizers.")
320 (license license:gpl3+)))
322 (define-public pngquant
330 (url "https://github.com/kornelski/pngquant.git")
332 (file-name (git-file-name name version))
334 (base32 "15hanshahxqs6s9fyc3aym02251dcys7bf78g3inp0y233amdbl3"))))
335 (build-system gnu-build-system)
337 `(#:test-target "test"
339 '("--with-openmp" "--with-lcms2")))
341 `(("pkg-config" ,pkg-config)))
346 ("libimagequant" ,libimagequant)))
347 (home-page "https://pngquant.org/")
348 (synopsis "Utility and library for lossy compressing PNG images")
349 (description "pngquant is a PNG compressor that significantly reduces file
350 sizes by converting images to a more efficient 8-bit PNG format with alpha
351 channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images
352 are fully standards-compliant and are supported by all web browsers and
357 @item High-quality palette generation using a combination of vector
358 quantization algorithms.
359 @item Unique adaptive dithering algorithm that adds less noise to images
360 than the standard Floyd-Steinberg.
361 @item Easy to integrate with shell scripts, GUIs and server-side software.
362 @item Fast mode for real-time processing/large numbers of images.
364 (license license:gpl3+)))
366 (define-public libjpeg
372 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
375 "08kixcf3a7s9x91174abjnk1xbvj4v8crdc73zi4k9h3jfbm00k5"))))
376 (build-system gnu-build-system)
377 (synopsis "Library for handling JPEG files")
379 "Libjpeg implements JPEG image encoding, decoding, and transcoding.
380 JPEG is a standardized compression method for full-color and gray-scale
382 It also includes programs that provide conversion between the JPEG format and
383 image files in PBMPLUS PPM/PGM, GIF, BMP, and Targa file formats, as well as
384 lossless JPEG manipulations such as rotation, scaling or cropping:
392 (license license:ijg)
393 (home-page "https://www.ijg.org/")))
395 (define-public libjpeg-8
396 (package (inherit libjpeg)
400 (uri (string-append "https://www.ijg.org/files/jpegsrc.v"
403 "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0"))))))
405 (define-public libjxr
410 ;; We are using the Debian source because CodePlex does not
411 ;; deliver an easily downloadable tarball.
413 (uri (string-append "mirror://debian/pool/main/j/jxrlib/jxrlib_"
414 version ".orig.tar.gz"))
417 "00w3f3cmjsm3fiaxq5mxskmp5rl3mki8psrf9y8s1vqbg237na67"))
418 (patch-flags '("-p1" "--binary"))
419 (patches (search-patches "libjxr-fix-function-signature.patch"
420 "libjxr-fix-typos.patch"))))
421 (build-system gnu-build-system)
425 ;; A substitute* procedure call would be enough to add the -fPIC
426 ;; flag if there was no file decoding error.
427 ;; The makefile is a "Non-ISO extended-ASCII text, with CRLF line
428 ;; terminators" according to the file(1) utility.
429 (string-append "CFLAGS=-I. -Icommon/include -Iimage/sys -fPIC "
430 "-D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O "))
431 #:tests? #f ; no check target
433 (modify-phases %standard-phases
434 (delete 'configure) ; no configure script
435 (add-after 'build 'build-shared-library
437 ;; The Makefile uses optimization level 1, so the same
438 ;; level is used here for consistency.
439 (invoke "gcc" "-shared" "-fPIC" "-O"
441 "adapthuff.o" "image.o" "strcodec.o" "strPredQuant.o"
442 "strTransform.o" "perfTimerANSI.o"
444 "decode.o" "postprocess.o" "segdec.o" "strdec.o"
445 "strInvTransform.o" "strPredQuantDec.o" "JXRTranscode.o"
447 "encode.o" "segenc.o" "strenc.o" "strFwdTransform.o"
450 (invoke "gcc" "-shared" "-fPIC" "-O"
452 "JXRGlue.o" "JXRMeta.o" "JXRGluePFC.o" "JXRGlueJxr.o"
454 "JXRTest.o" "JXRTestBmp.o" "JXRTestHdr.o" "JXRTestPnm.o"
455 "JXRTestTif.o" "JXRTestYUV.o"
456 "-o" "libjxrglue.so")))
457 ;; The upstream makefile does not include an install phase.
459 (lambda* (#:key outputs #:allow-other-keys)
460 (let* ((out (assoc-ref outputs "out"))
461 (bin (string-append out "/bin"))
462 (lib (string-append out "/lib"))
463 (include (string-append out "/include/jxrlib")))
464 (for-each (lambda (file)
465 (install-file file include)
468 '("jxrgluelib/JXRGlue.h"
469 "jxrgluelib/JXRMeta.h"
470 "jxrtestlib/JXRTest.h"
471 "image/sys/windowsmediaphoto.h")
472 (find-files "common/include" "\\.h$")))
473 (for-each (lambda (file)
474 (install-file file lib)
476 (find-files "." "\\.(a|so)$"))
477 (for-each (lambda (file)
478 (install-file file bin)
480 '("JxrDecApp" "JxrEncApp")))
482 (synopsis "Implementation of the JPEG XR standard")
483 (description "JPEG XR is an approved ISO/IEC International standard (its
484 official designation is ISO/IEC 29199-2). This library is an implementation of that standard.")
486 (license:non-copyleft
488 "See the header of the Makefile in the distribution."))
489 (home-page "https://jxrlib.codeplex.com/")))
491 (define-public jpegoptim
497 (uri (string-append "http://www.kokkonen.net/tjko/src/jpegoptim-"
500 "1dss7907fclfl8zsw0bl4qcw0hhz6fqgi3867w0jyfm3q9jfpcc8"))))
501 (build-system gnu-build-system)
502 (inputs `(("libjpeg" ,libjpeg)))
504 '(#:tests? #f)) ; no tests
505 (synopsis "Optimize JPEG images")
507 "jpegoptim provides lossless optimization (based on optimizing
508 the Huffman tables) and \"lossy\" optimization based on setting
509 maximum quality factor.")
510 (license license:gpl2+)
511 (home-page "https://www.kokkonen.net/tjko/projects.html#jpegoptim")))
513 (define-public libicns
520 "mirror://sourceforge/icns/"
521 "libicns-" version ".tar.gz"))
524 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
525 (build-system gnu-build-system)
530 `(#:tests? #t)) ; No tests.
531 (home-page "http://icns.sourceforge.net/")
532 (synopsis "Library for handling Mac OS icns resource files")
534 "Libicns is a library for the manipulation of Mac OS IconFamily resource
535 type files (ICNS). @command{icns2png} and @command{png2icns} are provided to
536 convert between PNG and ICNS. @command{icns2png} will extract image files from
537 ICNS files under names like \"Foo_48x48x32.png\" useful for installing for use
538 with .desktop files. Additionally, @command{icontainer2png} is provided for
539 extracting icontainer icon files.")
540 (license (list license:lgpl2.1+ ; libicns
541 license:lgpl2.0+ ; src/apidocs.*
542 license:gpl2+)))) ; icns2png, png2icns, icontainer2png
544 (define-public libtiff
551 (uri (string-append "http://download.osgeo.org/libtiff/tiff-"
555 "1r4np635gr6zlc0bic38dzvxia6iqzcrary4n1ylarzpr8fd2lic"))))
556 (build-system gnu-build-system)
558 "doc")) ;1.3 MiB of HTML documentation
560 ;; Instead of using --docdir, this package has its own --with-docdir.
561 `(#:configure-flags (list (string-append "--with-docdir="
562 (assoc-ref %outputs "doc")
564 ,name "-" ,version))))
565 (inputs `(("zlib" ,zlib)
566 ("libjpeg" ,libjpeg)))
567 (synopsis "Library for handling TIFF files")
569 "Libtiff provides support for the Tag Image File Format (TIFF), a format
570 used for storing image data.
571 Included are a library, libtiff, for reading and writing TIFF and a small
572 collection of tools for doing simple manipulations of TIFF images.")
573 (license (license:non-copyleft "file://COPYRIGHT"
574 "See COPYRIGHT in the distribution."))
575 (home-page "http://www.simplesystems.org/libtiff/")))
577 (define-public leptonica
585 (url "https://github.com/DanBloomberg/leptonica.git")
587 (file-name (git-file-name name version))
589 (base32 "0sfg1ky0lghlq7xx0qii5167bim0wwfnnr83dl4skbj9awyvjiwi"))))
590 (build-system gnu-build-system)
592 `(("gnuplot" ,gnuplot) ;needed for test suite
593 ("autoconf" ,autoconf)
594 ("automake" ,automake)
596 ("pkg-config" ,pkg-config)))
603 ("openjpeg" ,openjpeg)
607 (modify-phases %standard-phases
608 (add-after 'unpack 'patch-reg-wrapper
610 (substitute* "prog/reg_wrapper.sh"
612 (string-append " " (which "sh") " "))
616 (add-after 'install 'provide-absolute-giflib-reference
617 (lambda* (#:key inputs outputs #:allow-other-keys)
618 (let ((out (assoc-ref outputs "out"))
619 (giflib (assoc-ref inputs "giflib")))
620 ;; Add an absolute reference to giflib to avoid propagation.
621 (with-directory-excursion (string-append out "/lib")
622 (substitute* '("liblept.la" "pkgconfig/lept.pc")
623 (("-lgif") (string-append "-L" giflib "/lib -lgif"))))
625 (home-page "http://www.leptonica.com/")
626 (synopsis "Library and tools for image processing and analysis")
628 "Leptonica is a C library and set of command-line tools for efficient
629 image processing and image analysis operations. It supports rasterop, affine
630 transformations, binary and grayscale morphology, rank order, and convolution,
631 seedfill and connected components, image transformations combining changes in
632 scale and pixel depth, and pixelwise masking, blending, enhancement, and
634 (license license:bsd-2)))
636 (define-public jbig2dec
642 (uri (string-append "https://github.com/ArtifexSoftware"
643 "/ghostpdl-downloads/releases/download"
644 "/gs927/" name "-" version ".tar.gz"))
647 "00h61y7bh3z6mqfzxyb318gyh0f8jwarg4hvlrm83rqps8avzxm4"))
648 (patches (search-patches "jbig2dec-ignore-testtest.patch"))))
649 (build-system gnu-build-system)
650 (arguments '(#:configure-flags '("--disable-static")))
651 (synopsis "Decoder of the JBIG2 image compression format")
653 "JBIG2 is designed for lossy or lossless encoding of @code{bilevel} (1-bit
654 monochrome) images at moderately high resolution, and in particular scanned
655 paper documents. In this domain it is very efficient, offering compression
656 ratios on the order of 100:1.
658 This is a decoder only implementation, and currently is in the alpha
659 stage, meaning it doesn't completely work yet. However, it is
660 maintaining parity with available encoders, so it is useful for real
662 (home-page "https://jbig2dec.com")
663 (license license:gpl2+)))
665 (define-public jbigkit
672 (uri (string-append "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
673 "download/jbigkit-" version ".tar.gz"))
675 (base32 "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy"))
676 (modules '((guix build utils)))
679 ;; Remove files without clear licence information.
680 (for-each delete-file-recursively
681 (list "contrib" "examples"))
683 (build-system gnu-build-system)
684 (outputs (list "out" "pbmtools"))
686 `(#:modules ((srfi srfi-26)
687 ,@%gnu-build-system-modules)
689 (modify-phases %standard-phases
690 (delete 'configure) ; no configure script
691 (replace 'install ; no ‘make install’ target
692 (lambda* (#:key outputs #:allow-other-keys)
693 (let* ((out (assoc-ref outputs "out"))
694 (lib (string-append out "/lib"))
695 (include (string-append out "/include")))
696 (with-directory-excursion "libjbig"
697 (for-each (cut install-file <> include)
698 (find-files "." "\\.h$"))
699 (for-each (cut install-file <> lib)
700 (find-files "." "\\.a$")))
702 (add-after 'install 'install-pbmtools
703 (lambda* (#:key outputs #:allow-other-keys)
704 (let* ((out (assoc-ref outputs "pbmtools"))
705 (bin (string-append out "/bin"))
706 (man1 (string-append out "/share/man/man1"))
707 (man5 (string-append out "/share/man/man5")))
708 (with-directory-excursion "pbmtools"
709 (for-each (cut install-file <> bin)
710 (list "jbgtopbm" "jbgtopbm85"
711 "pbmtojbg" "pbmtojbg85"))
713 (for-each (cut install-file <> man1)
714 (find-files "." "\\.1$"))
715 (for-each (cut install-file <> man5)
716 (find-files "." "\\.5$"))
719 #:tests? #f)) ; tests depend on examples/
720 (home-page "https://www.cl.cam.ac.uk/~mgk25/jbigkit/")
721 (synopsis "Lossless compression for bi-level high-resolution images")
723 "JBIG-KIT implements the JBIG1 data compression standard (ITU-T T.82 and
724 ISO/IEC 11544:1993), designed for bi-level (one bit per pixel) images such as
725 black-and-white scanned documents. It is widely used in fax products, printer
726 firmware and drivers, document management systems, and imaging software.
728 This package provides a static C library of (de)compression functions and some
729 simple command-line converters similar to those provided by netpbm.
731 Two JBIG1 variants are available. One (@file{jbig.c}) implements nearly all
732 options of the standard but has to keep the full uncompressed image in memory.
733 The other (@file{jbig85.c}) implements just the ITU-T T.85 profile, with
734 memory management optimized for embedded and fax applications. It buffers
735 only a few lines of the uncompressed image in memory and is able to stream
736 images of initially unknown height.")
737 (license (list license:isc ; pbmtools/p?m.5
738 license:gpl2+)))) ; the rest
740 (define-public openjpeg
747 (url "https://github.com/uclouvain/openjpeg")
748 (commit (string-append "v" version))))
749 (file-name (git-file-name "openjpeg" version))
752 "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb"))))
753 (build-system cmake-build-system)
755 '(#:tests? #f ;TODO: requires a 1.1 GiB data repository
756 #:configure-flags '("-DBUILD_STATIC_LIBS=OFF")))
762 (synopsis "JPEG 2000 codec")
764 "The OpenJPEG library is a JPEG 2000 codec written in C. It has
765 been developed in order to promote the use of JPEG 2000, the new
766 still-image compression standard from the Joint Photographic Experts
769 In addition to the basic codec, various other features are under
770 development, among them the JP2 and MJ2 (Motion JPEG 2000) file formats,
771 an indexing tool useful for the JPIP protocol, JPWL-tools for
772 error-resilience, a Java-viewer for j2k-images, ...")
773 (home-page "https://github.com/uclouvain/openjpeg")
774 (license license:bsd-2)))
776 (define-public openjpeg-1
777 (package (inherit openjpeg)
784 (string-append "mirror://sourceforge/openjpeg.mirror/" version "/"
785 name "-" version ".tar.gz"))
787 (base32 "11waq9w215zvzxrpv40afyd18qf79mxc28fda80bm3ax98cpppqm"))))))
789 (define-public giflib
795 (uri (string-append "mirror://sourceforge/giflib/giflib-"
799 "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz"))
800 (patches (search-patches
801 "giflib-make-reallocarray-private.patch"))))
802 (build-system gnu-build-system)
803 (outputs '("bin" ; utility programs
805 (inputs `(("libx11" ,libx11)
811 (modify-phases %standard-phases
812 (add-after 'unpack 'disable-html-doc-gen
814 (substitute* "doc/Makefile.in"
815 (("^all: allhtml manpages") ""))
817 (add-after 'install 'install-manpages
818 (lambda* (#:key outputs #:allow-other-keys)
819 (let* ((bin (assoc-ref outputs "bin"))
820 (man1dir (string-append bin "/share/man/man1")))
822 (for-each (lambda (file)
823 (let ((base (basename file)))
824 (format #t "installing `~a' to `~a'~%"
829 (find-files "doc" "\\.1"))
831 (synopsis "Tools and library for working with GIF images")
833 "GIFLIB is a library for reading and writing GIF images. It is API and
834 ABI compatible with libungif which was in wide use while the LZW compression
835 algorithm was patented. Tools are also included to convert, manipulate,
836 compose, and analyze GIF images.")
837 (home-page "http://giflib.sourceforge.net/")
838 (license license:x11)))
840 (define-public libungif
846 (uri (string-append "mirror://sourceforge/giflib/libungif-4.x/"
847 "libungif-" version "/libungif-"
851 "0cnksimmmjngdrys302ik1385sg1sj4i0gxivzldhgwd46n7x2kh"))))
852 (build-system gnu-build-system)
853 (inputs `(("perl" ,perl))) ;package ships some perl tools
854 (home-page "http://giflib.sourceforge.net/")
855 (synopsis "GIF decompression library")
857 "libungif is the old GIF decompression library by the GIFLIB project.")
858 (license license:expat)))
860 (define-public imlib2
867 "mirror://sourceforge/enlightenment/imlib2-src/" version
868 "/imlib2-" version ".tar.bz2"))
871 "0v8n3dswx7rxqfd0q03xwc7j2w1mv8lv18rdxv487a1xw5vklfad"))))
872 (build-system gnu-build-system)
874 `(("pkgconfig" ,pkg-config)))
877 ("freetype" ,freetype)
879 ("libid3tag" ,libid3tag)
885 ("libwebp" ,libwebp)))
886 (home-page "https://sourceforge.net/projects/enlightenment/")
888 "Loading, saving, rendering and manipulating image files")
890 "Imlib2 is a library that does image file loading and saving as well as
891 rendering, manipulation, arbitrary polygon support, etc.
893 It does ALL of these operations FAST. Imlib2 also tries to be highly
894 intelligent about doing them, so writing naive programs can be done easily,
895 without sacrificing speed.
897 This is a complete rewrite over the Imlib 1.x series. The architecture is
898 more modular, simple, and flexible.")
899 (license license:imlib2)))
901 (define-public giblib
909 "http://linuxbrit.co.uk/downloads/giblib-"
912 "https://src.fedoraproject.org/repo/pkgs/giblib/giblib-"
913 version ".tar.gz/c810ef5389baf24882a1caca2954385e/giblib-"
916 "https://sourceforge.net/projects/slackbuildsdirectlinks/"
917 "files/giblib/giblib-" version ".tar.gz")))
920 "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp"))))
921 (build-system gnu-build-system)
926 ;; This vanished page is universally accepted as giblib's home despite not
927 ;; mentioning the package once.
928 (string-append "https://web.archive.org/web/20140907071208"
929 "https://linuxbrit.co.uk/software/"))
930 (synopsis "Wrapper library for imlib2")
932 "Giblib is a simple library which wraps imlib2's context API, avoiding
933 all the context_get/set calls, adds fontstyles to the truetype renderer and
934 supplies a generic doubly-linked list and some string functions.")
935 ;; This license removes a clause about X Consortium from the original
937 (license (license:x11-style "file://COPYING"
938 "See 'COPYING' in the distribution."))))
940 (define-public freeimage
947 "mirror://sourceforge/freeimage/Source%20Distribution/"
949 (string-concatenate (string-split version #\.))
953 "1z9qwi9mlq69d5jipr3v2jika2g0kszqdzilggm99nls5xl7j4zl"))
954 (modules '((guix build utils)))
959 (delete-file-recursively (string-append "Source/" dir)))
960 '("LibJPEG" "LibOpenJPEG" "LibPNG" "LibRawLite"
961 "LibJXR" "LibWebP" "OpenEXR" "ZLib"))))
962 (patches (search-patches "freeimage-unbundle.patch"))))
963 (build-system gnu-build-system)
966 (modify-phases %standard-phases
967 ;; According to Fedora these files depend on private headers, but their
968 ;; presence is required for building, so we replace them with empty files.
969 (add-after 'unpack 'delete-unbuildable-files
971 (for-each (lambda (file)
973 (close (open file O_CREAT)))
974 '("Source/FreeImage/PluginG3.cpp"
975 "Source/FreeImageToolkit/JPEGTransform.cpp"))
977 ;; These scripts generate the Makefiles.
980 (invoke "sh" "gensrclist.sh")
981 (invoke "sh" "genfipsrclist.sh")))
982 (add-before 'build 'patch-makefile
983 (lambda* (#:key outputs #:allow-other-keys)
984 (substitute* "Makefile.gnu"
985 (("/usr") (assoc-ref outputs "out"))
986 (("-o root -g root") ""))
990 ;; We need '-fpermissive' for Source/FreeImage.h.
991 ;; libjxr doesn't have a pkg-config file.
992 (string-append "CFLAGS+=-O2 -fPIC -fvisibility=hidden -fpermissive "
993 "-I" (assoc-ref %build-inputs "libjxr") "/include/jxrlib"))
994 #:tests? #f)) ; no check target
996 `(("pkg-config" ,pkg-config)
999 `(("libjpeg" ,libjpeg)
1003 ("libtiff" ,libtiff)
1004 ("libwebp" ,libwebp)
1005 ("openexr" ,openexr)
1006 ("openjpeg" ,openjpeg)
1008 (synopsis "Library for handling popular graphics image formats")
1010 "FreeImage is a library for developers who would like to support popular
1011 graphics image formats like PNG, BMP, JPEG, TIFF and others.")
1012 (license license:gpl2+)
1013 (home-page "http://freeimage.sourceforge.net")))
1015 (define-public vigra
1022 (uri (string-append "https://github.com/ukoethe/vigra/releases/download/"
1023 "Version-" (string-join (string-split version #\.) "-")
1024 "/vigra-" version "-src.tar.gz"))
1026 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5"))))
1027 (build-system cmake-build-system)
1033 ("ilmbase" ,ilmbase) ; propagated by openexr, but needed explicitly
1034 ; to create a configure-flag
1035 ("libjpeg" ,libjpeg)
1037 ("libtiff" ,libtiff)
1038 ("openexr" ,openexr)
1039 ("python" ,python-2) ; print syntax
1040 ("python2-numpy" ,python2-numpy)
1043 `(("doxygen" ,doxygen)
1044 ("python2-nose" ,python2-nose)
1045 ("sphinx" ,python-sphinx)))
1047 `(#:test-target "check"
1049 (modify-phases %standard-phases
1050 (add-after 'unpack 'disable-broken-tests
1052 ;; See https://github.com/ukoethe/vigra/issues/432
1053 (substitute* "test/fourier/CMakeLists.txt"
1054 (("VIGRA_ADD_TEST.*") ""))
1055 ;; This test fails with Numpy 1.15:
1056 ;; <https://github.com/ukoethe/vigra/issues/436>.
1057 (substitute* "vigranumpy/test/CMakeLists.txt"
1058 (("test1\\.py") ""))
1061 (list "-Wno-dev" ; suppress developer mode with lots of warnings
1062 (string-append "-DVIGRANUMPY_INSTALL_DIR="
1063 (assoc-ref %outputs "out")
1064 "/lib/python2.7/site-packages")
1065 ;; OpenEXR is not enabled by default.
1067 ;; Fix rounding error on 32-bit machines
1068 "-DCMAKE_C_FLAGS=-ffloat-store"
1069 ;; The header files of ilmbase are not found when included
1070 ;; by the header files of openexr, and an explicit flag
1072 (string-append "-DCMAKE_CXX_FLAGS=-I"
1073 (assoc-ref %build-inputs "ilmbase")
1075 " -ffloat-store"))))
1076 (synopsis "Computer vision library")
1078 "VIGRA stands for Vision with Generic Algorithms. It is an image
1079 processing and analysis library that puts its main emphasis on customizable
1080 algorithms and data structures. It is particularly strong for
1081 multi-dimensional image processing.")
1082 (license license:expat)
1083 (home-page "https://ukoethe.github.io/vigra/")))
1085 (define-public vigra-c
1086 (let* ((commit "66ff4fa5a7d4a77415caa676a45c2c6ea16562e7")
1090 (version (git-version "0.0.0" revision commit))
1091 (home-page "https://github.com/BSeppke/vigra_c")
1099 "1pnd92s284dvsg8zp6md7p8ck55bmcsryz58gzic7jh6m72hg689"))
1100 (file-name (git-file-name name version))))
1101 (build-system cmake-build-system)
1103 `(#:tests? #f)) ; No test target.
1105 `(("doxygen" ,doxygen)))
1111 (synopsis "C interface to the VIGRA computer vision library")
1113 "This package provides a C interface to the VIGRA C++ computer vision
1114 library. It is designed primarily to ease the implementation of higher-level
1115 language bindings to VIGRA.")
1116 (license license:expat))))
1118 (define-public libwebp
1124 ;; No tarballs are provided for >0.6.1.
1127 (url "https://chromium.googlesource.com/webm/libwebp")
1128 (commit (string-append "v" version))))
1129 (file-name (git-file-name name version))
1132 "0r2yy9if0ndvpzadk39bigvsygyqnlv0xjb9w2aj6rs534mncazz"))))
1133 (build-system gnu-build-system)
1135 `(("freeglut" ,freeglut)
1137 ("libjpeg" ,libjpeg)
1139 ("libtiff" ,libtiff)))
1141 `(("autoconf" ,autoconf)
1142 ("automake" ,automake)
1143 ("libtool" ,libtool)))
1145 '(#:configure-flags '("--enable-libwebpmux"
1146 "--enable-libwebpdemux"
1147 "--enable-libwebpdecoder"
1148 "--disable-static")))
1149 (home-page "https://developers.google.com/speed/webp/")
1150 (synopsis "Lossless and lossy image compression")
1152 "WebP is a new image format that provides lossless and lossy compression
1153 for images. WebP lossless images are 26% smaller in size compared to
1154 PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at
1155 equivalent SSIM index. WebP supports lossless transparency (also known as
1156 alpha channel) with just 22% additional bytes. Transparency is also supported
1157 with lossy compression and typically provides 3x smaller file sizes compared
1158 to PNG when lossy compression is acceptable for the red/green/blue color
1160 (license license:bsd-3)))
1162 (define-public libmng
1168 (uri (string-append "mirror://sourceforge/libmng/libmng-devel/"
1169 version "/" name "-" version ".tar.xz"))
1172 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
1173 (build-system gnu-build-system)
1175 ;; These are all in the 'Libs.private' field of libmng.pc.
1177 ("libjpeg" ,libjpeg)
1179 (home-page "https://www.libmng.com/")
1180 (synopsis "Library for handling MNG files")
1182 "Libmng is the MNG (Multiple-image Network Graphics) reference library.")
1183 (license license:bsd-3)))
1185 (define-public exiv2
1192 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
1195 (base32 "0gqminvj14xm3rgbnydbywf22608js80rp7nmxxk4497j5mzali6"))))
1196 (build-system cmake-build-system)
1197 (arguments '(#:tests? #f)) ; no test suite
1201 (home-page "https://www.exiv2.org/")
1202 (synopsis "Library and command-line utility to manage image metadata")
1204 "Exiv2 is a C++ library and a command line utility to manage image
1205 metadata. It provides fast and easy read and write access to the Exif, IPTC
1206 and XMP metadata of images in various formats.")
1208 ;; Files under `xmpsdk' are a copy of Adobe's XMP SDK, licensed under the
1209 ;; 3-clause BSD license: <http://www.adobe.com/devnet/xmp/sdk/eula.html>.
1210 ;; The core is GPLv2+:
1211 ;; <https://launchpad.net/ubuntu/precise/+source/exiv2/+copyright>.
1212 (license license:gpl2+)))
1214 (define-public exiv2-0.26
1220 (uri (list (string-append "https://www.exiv2.org/builds/exiv2-"
1221 version "-trunk.tar.gz")
1222 (string-append "https://www.exiv2.org/exiv2-"
1224 (string-append "https://fossies.org/linux/misc/exiv2-"
1225 version ".tar.gz")))
1226 (patches (search-patches "exiv2-CVE-2017-14860.patch"
1227 "exiv2-CVE-2017-14859-14862-14864.patch"))
1230 "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7"))))
1231 (build-system gnu-build-system)
1232 (arguments '(#:tests? #f)) ; no `check' target
1237 `(("intltool" ,intltool)))
1239 ;; People should rely on the newer version, so don't expose it.
1240 (properties `((hidden? . #t)))))
1242 (define-public devil
1248 (uri (string-append "http://downloads.sourceforge.net/openil/"
1249 "DevIL-" version ".tar.gz"))
1252 "02dpzvi493r09c9hfjnk54nladl3qw55iqkkg18g12fxwwz9fx80"))))
1253 (build-system cmake-build-system)
1255 '(;; XXX: Not supported in the released CMakeLists.txt.
1256 ;; Enable this for > 1.8.0.
1259 (modify-phases %standard-phases
1260 (add-before 'configure 'change-directory
1261 (lambda _ (chdir "DevIL") #t)))))
1263 `(("pkg-config" ,pkg-config)))
1266 ("libjpeg" ,libjpeg-turbo)
1269 ("libtiff" ,libtiff)
1270 ("openexr" ,openexr)
1272 (synopsis "Library for manipulating many image formats")
1273 (description "Developer's Image Library (DevIL) is a library to develop
1274 applications with support for many types of images. DevIL can load, save,
1275 convert, manipulate, filter and display a wide variety of image formats.")
1276 (home-page "http://openil.sourceforge.net")
1277 (license license:lgpl2.1+)))
1279 (define-public jasper
1286 (url "https://github.com/mdadams/jasper.git")
1287 (commit (string-append "version-" version))))
1288 (file-name (git-file-name name version))
1291 "05l75yd1zsxwv25ykwwwjs8961szv7iywf16nc6vc6qpby27ckv6"))))
1292 (build-system cmake-build-system)
1293 (inputs `(("libjpeg" ,libjpeg)))
1294 (synopsis "JPEG-2000 library")
1295 (description "The JasPer Project is an initiative to provide a reference
1296 implementation of the codec specified in the JPEG-2000 Part-1 standard (i.e.,
1298 (home-page "https://www.ece.uvic.ca/~frodo/jasper/")
1299 (license (license:x11-style "file://LICENSE"))))
1309 (url "https://github.com/sekrit-twc/zimg.git")
1310 (commit (string-append "release-" version))))
1311 (file-name (git-file-name name version))
1313 (base32 "1dqyrq3p8bkgvj4ci50ac342hjnhyz6xxvhiwp7wpi3v3nbj7s02"))))
1314 (build-system gnu-build-system)
1316 `(("autoconf" ,autoconf)
1317 ("automake" ,automake)
1318 ("libtool" ,libtool)))
1319 (synopsis "Scaling, colorspace conversion, and dithering library")
1320 (description "Zimg implements the commonly required image processing basics
1321 of scaling, colorspace conversion, and depth conversion. A simple API enables
1322 conversion between any supported formats to operate with minimal knowledge from
1324 (home-page "https://github.com/sekrit-twc/zimg")
1325 ;; test/extra/ contains musl-libm,
1326 ;; which is MIT/expat licensed, but only used for tests
1327 (license license:wtfpl2)))
1329 (define-public perceptualdiff
1331 (name "perceptualdiff")
1337 (url "https://github.com/myint/perceptualdiff.git")
1338 (commit (string-append "v" version))))
1339 (file-name (git-file-name name version))
1341 (base32 "0yys55f9i9g3wjjg0j2m0p0k21zwnid8520a8lrr30khm4k5gibp"))))
1342 (build-system cmake-build-system)
1343 (inputs `(("freeimage" ,freeimage)))
1345 '(#:phases (modify-phases %standard-phases
1346 (add-after 'unpack 'fix-tests
1347 ;; cmake-build-system uses a build/ directory outside
1348 ;; of the source tree, one level higher than expected
1350 (substitute* "test/run_tests.bash"
1351 (("../build") "../../build"))
1353 (home-page "https://github.com/myint/perceptualdiff")
1354 (synopsis "Perceptual image comparison utility")
1355 (description "PerceptualDiff visually compares two images to determine
1356 whether they look alike. It uses a computational model of the human visual
1357 system to detect similarities. This allows it too see beyond irrelevant
1358 differences in file encoding, image quality, and other small variations.")
1359 (license license:gpl2+)))
1361 (define-public steghide
1367 (uri (string-append "mirror://sourceforge/steghide/steghide/"
1368 version "/steghide-" version ".tar.bz2"))
1371 "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
1372 (patches (list (search-patch "steghide-fixes.patch")))))
1373 (build-system gnu-build-system)
1375 `(("gettext" ,gettext-minimal)
1376 ("libtool" ,libtool)
1377 ("perl" ,perl))) ;for tests
1379 `(("libmhash" ,libmhash)
1380 ("libmcrypt" ,libmcrypt)
1381 ("libjpeg" ,libjpeg)
1384 `(#:make-flags '("CXXFLAGS=-fpermissive") ;required for MHashPP.cc
1386 #:phases (modify-phases %standard-phases
1387 (add-before 'configure 'set-perl-search-path
1389 ;; Work around "dotless @INC" build failure.
1391 (string-append (getcwd) "/tests:"
1392 (getenv "PERL5LIB")))
1394 (home-page "http://steghide.sourceforge.net")
1395 (synopsis "Image and audio steganography")
1397 "Steghide is a program to hide data in various kinds of image and audio
1398 files (known as @dfn{steganography}). Neither color nor sample frequencies are
1399 changed, making the embedding resistant against first-order statistical tests.")
1400 (license license:gpl2+)))
1402 (define-public stb-image-for-extempore
1403 (let ((revision "1")
1404 (commit "152a250a702bf28951bb0220d63bc0c99830c498"))
1406 (name "stb-image-for-extempore")
1407 (version (string-append "0-" revision "." (string-take commit 9)))
1409 (origin (method git-fetch)
1411 (url "https://github.com/extemporelang/stb.git")
1415 "0y0aa20pj9311x2ii06zg8xs34idg14hfgldqc5ymizc6cf1qiqv"))
1416 (file-name (string-append name "-" version "-checkout"))))
1417 (build-system cmake-build-system)
1418 (arguments `(#:tests? #f)) ; no tests included
1419 ;; Extempore refuses to build on architectures other than x86_64
1420 (supported-systems '("x86_64-linux"))
1421 (home-page "https://github.com/extemporelang/stb")
1422 (synopsis "Image library for Extempore")
1424 "This package is a collection of assorted single-file libraries. Of
1425 all included libraries only the image loading and decoding library is
1426 installed as @code{stb_image}.")
1427 (license license:public-domain))))
1429 (define-public optipng
1436 (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
1440 "0lj4clb851fzpaq446wgj0sfy922zs5l5misbpwv6w7qrqrz4cjg"))
1441 (modules '((guix build utils)))
1444 (delete-file-recursively "src/libpng")
1445 (delete-file-recursively "src/zlib")
1447 (build-system gnu-build-system)
1449 `(("libpng" ,libpng)
1453 (modify-phases %standard-phases
1455 (lambda* (#:key outputs #:allow-other-keys)
1456 ;; configure script doesn't accept arguments CONFIG_SHELL and SHELL
1457 (invoke "sh" "configure"
1458 (string-append "--prefix=" (assoc-ref outputs "out"))
1459 "-with-system-libs")
1461 (synopsis "Optimizer that recompresses PNG image files to a smaller size")
1462 (description "OptiPNG is a PNG optimizer that recompresses image
1463 files to a smaller size, without losing any information. This program
1464 also converts external formats (BMP, GIF, PNM and TIFF) to optimized
1465 PNG, and performs PNG integrity checks and corrections.")
1466 (home-page "http://optipng.sourceforge.net/")
1467 (license license:zlib)))
1469 (define-public pngsuite
1472 (version "2017jul19")
1475 (method url-fetch/tarbomb)
1476 (uri (string-append "http://www.schaik.com/pngsuite2011/PngSuite-"
1480 "1j7xgd9iffcnpphhzz9ld9ybrjmx9brhq0803g0450ssr52b5502"))))
1481 (build-system gnu-build-system)
1483 '(#:tests? #f ; there is no test target
1484 #:license-file-regexp "PngSuite.LICENSE"
1486 (modify-phases %standard-phases
1488 (lambda* (#:key outputs #:allow-other-keys)
1489 (let ((out (assoc-ref outputs "out")))
1490 (copy-recursively "." (string-append out "/"))
1493 (delete 'configure))))
1494 (home-page "http://www.schaik.com/pngsuite2011/pngsuite.html")
1495 (synopsis "Example PNGs for use in test suites")
1496 (description "Collection of graphics images created to test PNG
1497 applications like viewers, converters and editors. As far as that is
1498 possible, all formats supported by the PNG standard are represented.")
1499 (license (license:fsdg-compatible "file://PngSuite.LICENSE" "Permission to
1500 use, copy, modify and distribute these images for any purpose and without fee
1501 is hereby granted."))))
1503 (define-public libjpeg-turbo
1505 (name "libjpeg-turbo")
1507 (replacement libjpeg-turbo/fixed)
1510 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1511 version "/libjpeg-turbo-" version ".tar.gz"))
1514 "1v9gx1gdzgxf51nd55ncq7rghmj4x9x91rby50ag36irwngmkf5c"))))
1515 (build-system cmake-build-system)
1519 '(#:configure-flags '("-DCMAKE_INSTALL_LIBDIR:PATH=lib"
1520 "-DENABLE_STATIC=0")))
1521 (home-page "https://libjpeg-turbo.org/")
1522 (synopsis "SIMD-accelerated JPEG image handling library")
1523 (description "libjpeg-turbo is a JPEG image codec that accelerates baseline
1524 JPEG compression and decompression using SIMD instructions: MMX on x86, SSE2 on
1525 x86-64, NEON on ARM, and AltiVec on PowerPC processors. Even on other systems,
1526 its highly-optimized Huffman coding routines allow it to outperform libjpeg by
1527 a significant amount.
1528 libjpeg-turbo implements both the traditional libjpeg API and the less powerful
1529 but more straightforward TurboJPEG API, and provides a full-featured Java
1530 interface. It supports color space extensions that allow it to compress from
1531 and decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.).")
1532 ;; libjpeg-turbo is covered by three different licenses; see LICENSE.md.
1533 (license (list license:bsd-3 ;the TurboJPEG API library and programs
1534 license:ijg ;the libjpeg library and associated tools
1535 license:zlib)))) ;the libjpeg-turbo SIMD extensions
1537 ;; Replacement package to fix CVE-2019-13960 and CVE-2019-2201.
1538 (define libjpeg-turbo/fixed
1540 (inherit libjpeg-turbo)
1544 (uri (string-append "mirror://sourceforge/libjpeg-turbo/"
1545 version "/libjpeg-turbo-" version ".tar.gz"))
1548 "1ds16bnj17v6hzd43w8pzijz3imd9am4hw75ir0fxm240m8dwij2"))
1549 (patches (search-patches "libjpeg-turbo-CVE-2019-2201.patch"))))))
1551 (define-public niftilib
1557 (uri (list (string-append "mirror://sourceforge/niftilib/"
1558 "nifticlib/nifticlib_"
1559 (string-join (string-split version #\.) "_")
1560 "/nifticlib-" version ".tar.gz")))
1562 (base32 "123z9bwzgin5y8gi5ni8j217k7n683whjsvg0lrpii9flgk8isd3"))))
1563 (build-system gnu-build-system)
1565 '(#:tests? #f ; there is no test target
1566 #:parallel-build? #f ; not supported
1569 (string-append "ZLIB_INC="
1570 (assoc-ref %build-inputs "zlib") "/include")
1571 ;; Append "-fPIC" to CFLAGS.
1572 (string-append "CFLAGS="
1573 "-Wall -ansi -pedantic -fPIC"))
1575 (modify-phases %standard-phases
1577 (lambda* (#:key outputs #:allow-other-keys)
1578 (let ((out (assoc-ref outputs "out")))
1581 (copy-recursively dir (string-append out "/" dir)))
1582 '("bin" "lib" "include")))
1584 (delete 'configure))))
1587 (synopsis "Library for reading and writing files in the nifti-1 format")
1588 (description "Niftilib is a set of i/o libraries for reading and writing
1589 files in the nifti-1 data format - a binary file format for storing
1590 medical image data, e.g. magnetic resonance image (MRI) and functional MRI
1591 (fMRI) brain images.")
1592 (home-page "http://niftilib.sourceforge.net")
1593 (license license:public-domain)))
1595 (define-public gpick
1602 (url "https://github.com/thezbyg/gpick.git")
1603 (commit (string-append name "-" version))))
1604 (file-name (git-file-name name version))
1607 "0mcj806zagh122qgrdkrg0macpzby97y89xi2sjyn3bh8vmmyxjy"))))
1608 (build-system scons-build-system)
1611 ("gettext" ,gettext-minimal)
1612 ("pkg-config" ,pkg-config)))
1619 #:scons ,scons-python2
1620 #:scons-flags (list (string-append "DESTDIR=" %output))
1622 (modify-phases %standard-phases
1623 (add-before 'build 'fix-lua-reference
1625 (substitute* "SConscript"
1626 (("lua5.2") "lua-5.2"))
1628 (home-page "http://www.gpick.org/")
1629 (synopsis "Color picker")
1630 (description "Gpick is an advanced color picker and palette editing tool.")
1631 (license license:bsd-3)))
1633 (define-public libiptcdata
1635 (name "libiptcdata")
1639 (uri (string-append "https://github.com/ianw/libiptcdata"
1640 "/releases/download/release_"
1641 (string-join (string-split version #\.) "_")
1642 "/" name "-" version ".tar.gz"))
1645 "17m2bscc76r1bymjgb44fbbfrdsjfqyb2ivg9wchyllm8pgx1560"))))
1646 (build-system gnu-build-system)
1647 (home-page "https://github.com/ianw/libiptcdata")
1648 (synopsis "IPTC metadata manipulation library")
1650 "Libiptcdata is a C library for manipulating the International Press
1651 Telecommunications Council (@dfn{IPTC}) metadata stored within multimedia files
1652 such as images. This metadata can include captions and keywords, often used by
1653 popular photo management applications. The library provides routines for
1654 parsing, viewing, modifying, and saving this metadata.")
1655 (license license:lgpl2.0+)))
1657 (define-public flameshot
1665 (url "https://github.com/lupoDharkael/flameshot.git")
1666 (commit (string-append "v" version))))
1667 (file-name (git-file-name name version))
1670 "13h77np93r796jf289v4r687cmnpqkyqs34dm9gif4akaig74ky0"))))
1671 (build-system gnu-build-system)
1673 `(("qttools" ,qttools)))
1675 `(("qtbase" ,qtbase)))
1677 `(#:tests? #f ; no tests
1679 (modify-phases %standard-phases
1681 (lambda* (#:key outputs #:allow-other-keys)
1684 (string-append "BASEDIR=" (assoc-ref outputs "out"))
1686 (home-page "https://github.com/lupoDharkael/flameshot")
1687 (synopsis "Powerful yet simple to use screenshot software")
1688 (description "Flameshot is a screenshot program.
1692 @item Customizable appearance.
1694 @item In-app screenshot edition.
1695 @item DBus interface.
1696 @item Upload to Imgur.
1698 (license license:gpl3+)))
1700 (define-public gifsicle
1707 (uri (string-append "https://www.lcdf.org/gifsicle/gifsicle-"
1710 (base32 "0rffpzxcak19k6cngpxn73khvm3z1gswrqs90ycdzzb53p05ddas"))))
1711 (build-system gnu-build-system)
1714 (modify-phases %standard-phases
1715 (add-before 'check 'patch-tests
1717 (substitute* "test/testie"
1725 (native-inputs `(("perl" ,perl))) ; only for tests
1726 (inputs `(("libx11" ,libx11)))
1727 (home-page "https://www.lcdf.org/gifsicle/")
1728 (synopsis "Edit GIF images and animations")
1729 (description "Gifsicle is a command-line GIF image manipulation tool that:
1732 @item Provides a batch mode for changing GIFs in place.
1733 @item Prints detailed information about GIFs, including comments.
1734 @item Control over interlacing, comments, looping, transparency, etc.
1735 @item Creates well-behaved GIFs: removes redundant colors, only uses local color
1737 @item Shrinks colormaps and change images to use the Web-safe palette.
1738 @item Optimizes GIF animations, or unoptimizes them for easier editing.
1741 Two other programs are included with Gifsicle: @command{gifview} is a
1742 lightweight animated-GIF viewer, and @command{gifdiff} compares two GIFs for
1743 identical visual appearance.")
1744 (license license:gpl2+)))
1746 ;; 1.0.7 is buggy and reverted in git repository.
1754 (uri (string-append "mirror://debian/pool/main/j/jp2a/jp2a_"
1755 version ".orig.tar.gz"))
1758 "076frk3pa16s4r1b10zgy81vdlz0385zh3ykbnkaij25jn5aqc09"))))
1759 (build-system gnu-build-system)
1762 ("libjpeg" ,libjpeg)
1763 ("ncurses" ,ncurses)))
1764 (home-page "https://csl.name/jp2a/")
1765 (synopsis "Convert JPEG images to ASCII")
1767 "Jp2a is a small utility that converts JPEG images to ASCII.")
1768 (license license:gpl2)))
1778 (url "https://github.com/emersion/grim.git")
1779 (commit (string-append "v" version))))
1780 (file-name (git-file-name name version))
1782 (base32 "0brljl4zfbn5mh9hkfrfkvd27c5y9vdkgap9r1hrfy9r1x20sskn"))))
1783 (build-system meson-build-system)
1784 (native-inputs `(("pkg-config" ,pkg-config)
1786 (inputs `(("cairo" ,cairo)
1787 ("libjpeg-turbo" ,libjpeg-turbo)
1788 ("wayland" ,wayland)
1789 ("wayland-protocols" ,wayland-protocols)))
1790 (home-page "https://github.com/emersion/grim")
1791 (synopsis "Create screenshots from a Wayland compositor")
1792 (description "grim can create screenshots from a Wayland compositor.")
1794 (license license:expat)))
1796 (define-public slurp
1804 (url "https://github.com/emersion/slurp.git")
1805 (commit (string-append "v" version))))
1806 (file-name (git-file-name name version))
1808 (base32 "0580m6kaiilgsrcj608r837r37sl6a25y7w21p7d6ij20fs3gvg1"))))
1809 (build-system meson-build-system)
1810 (native-inputs `(("pkg-config" ,pkg-config)))
1811 (inputs `(("cairo" ,cairo)
1813 ("wayland" ,wayland)
1814 ("wayland-protocols" ,wayland-protocols)))
1815 (home-page "https://github.com/emersion/slurp")
1816 (synopsis "Select a region in a Wayland compositor")
1817 (description "Slurp can select a region in a Wayland compositor and print it
1818 to the standard output. It works well together with grim.")
1820 (license license:expat)))
1829 (uri (string-append "mirror://sourceforge/sng/sng-"
1832 (base32 "06a6ydvx9xb3vxvrzdrg3hq0rjwwj9ibr7fyyxjxq6qx1j3mb70i"))))
1833 (build-system gnu-build-system)
1836 (modify-phases %standard-phases
1837 (add-before 'check 'link-pngsuite
1838 ;; tests expect pngsuite in source dir
1839 (lambda* (#:key inputs #:allow-other-keys)
1840 (symlink (assoc-ref inputs "pngsuite") "pngsuite")
1843 (list (string-append "--with-rgbtxt="
1844 (assoc-ref %build-inputs "xorg-rgb")
1845 "/share/X11/rgb.txt"))))
1846 (inputs `(("xorg-rgb" ,xorg-rgb)
1847 ("libpng" ,libpng)))
1848 (native-inputs `(("pngsuite" ,pngsuite)))
1849 (home-page "http://sng.sourceforge.net")
1850 (synopsis "Markup language for representing PNG contents")
1851 (description "SNG (Scriptable Network Graphics) is a minilanguage designed
1852 specifically to represent the entire contents of a PNG (Portable Network
1853 Graphics) file in an editable form. Thus, SNGs representing elaborate
1854 graphics images and ancillary chunk data can be readily generated or modified
1855 using only text tools.
1857 SNG is implemented by a compiler/decompiler called sng that
1858 losslessly translates between SNG and PNG.")
1859 (license license:zlib)))
1861 (define-public lodepng
1862 ;; There are no tags in the repository, so we take the version as defined in
1864 (let ((commit "48e5364ef48ec2408f44c727657ac1b6703185f8")
1866 (version "20200215"))
1869 (version (git-version version revision commit))
1873 (url "https://github.com/lvandeve/lodepng")
1877 "1a1x8ag2scanzb2066jm9hg2y9kaa3wmpgmz10l1x9bkpik612lw"))
1878 (file-name (git-file-name name version))))
1879 (build-system gnu-build-system)
1882 (modify-phases %standard-phases
1886 (setenv "CXXFLAGS" "-fPIC")
1887 (invoke "make" "lodepng.o")
1888 (invoke "make" "lodepng_util.o")
1889 (invoke "g++" "-fPIC" "-O3"
1890 "-o" "liblodepng.so"
1891 "-shared" "lodepng.o" "lodepng_util.o")
1895 (invoke "make" "unittest")
1896 (invoke "./unittest")
1899 (lambda* (#:key outputs #:allow-other-keys)
1900 (let* ((out (assoc-ref outputs "out"))
1901 (doc (string-append out "/share/doc"))
1902 (lib (string-append out "/lib"))
1903 (include (string-append out "/include")))
1904 (install-file "lodepng.h" include)
1905 (install-file "lodepng_util.h" include)
1906 (install-file "liblodepng.so" lib)
1907 (install-file "README.md" doc)
1909 (home-page "https://lodev.org/lodepng/")
1910 (synopsis "PNG encoder and decoder in C and C++, without dependencies")
1911 (description "LodePNG is a PNG image decoder and encoder, all in one,
1912 no dependency or linkage required. It's made for C (ISO C90), and has a C++
1913 wrapper with a more convenient interface on top.")
1914 (license license:zlib))))
1916 (define-public icoutils
1924 "mirror://savannah/icoutils/icoutils-" version ".tar.bz2"))
1926 (base32 "1q66cksms4l62y0wizb8vfavhmf7kyfgcfkynil3n99s0hny1aqp"))))
1927 (build-system gnu-build-system)
1929 `(("libpng" ,libpng)
1932 `(("perl-libwww" ,perl-libwww)))
1933 (home-page "https://www.nongnu.org/icoutils/")
1934 (synopsis "Extract and convert bitmaps from Windows icon and cursor files")
1935 (description "Icoutils are a set of program for extracting and converting
1936 bitmaps from Microsoft Windows icon and cursor files. These files usually
1937 have the extension @code{.ico} or @code{.cur}, but they can also be embedded
1938 in executables and libraries (@code{.dll}-files). (Such embedded files are
1939 referred to as resources.)
1941 Conversion of these files to and from PNG images is done @command{icotool}.
1942 @command{extresso} automates these tasks with the help of special resource
1943 scripts. Resources such can be extracted from MS Windows executable and
1944 library files with @command{wrestool}.
1946 This package can be used to create @code{favicon.ico} files for web sites.")
1947 (license license:gpl3+)))
1949 (define-public libavif
1956 (url "https://github.com/AOMediaCodec/libavif")
1957 (commit (string-append "v" version))))
1958 (file-name (git-file-name name version))
1961 "1xybjbbprvfsrwgysrn7grg6yp7v6ch5vci7zvdcdzcgyrbph172"))))
1962 (build-system cmake-build-system)
1964 `(#:configure-flags '("-DAVIF_CODEC_AOM=ON" "-DAVIF_CODEC_DAV1D=ON"
1965 "-DAVIF_CODEC_RAV1E=OFF" ; not packaged yet
1966 "-DAVIF_BUILD_TESTS=ON")
1968 (modify-phases %standard-phases
1971 (invoke "./aviftest" "../source/tests/data")))
1972 (add-after 'install 'install-readme
1973 (lambda* (#:key outputs #:allow-other-keys)
1974 (let* ((out (assoc-ref outputs "out"))
1975 (doc (string-append out "/share/doc/libavif-" ,version)))
1976 (install-file "../source/README.md" doc)
1979 `(("libaom" ,libaom)
1981 (synopsis "Encode and decode AVIF files")
1982 (description "Libavif is a C implementation of the AV1 Image File Format
1983 (AVIF). It can encode and decode all YUV formats and bit depths supported by
1984 AOM, including with alpha.")
1985 (home-page "https://github.com/AOMediaCodec/libavif")
1986 (license (list license:bsd-2 ; libavif itself
1987 license:expat)))) ; cJSON in the test suite
1989 (define-public mtpaint
1990 (let ((commit "03b1b0938067b88d86d9f1b1088730f1934d411e")
1994 ;; The author neither releases tarballs nor uses git version tags.
1995 ;; Instead, author puts version in git commit title.
1996 (version (git-version "3.49.25" revision commit))
2001 (url "https://github.com/wjaguar/mtPaint/")
2003 (file-name (git-file-name name version))
2005 (base32 "0izm2wvj26566fd8mqvypr7bmv7jnq8qhp4760m7z2wrc4y8pjn1"))))
2006 (build-system gnu-build-system)
2008 `(("gettext" ,gettext-minimal)
2009 ("pkg-config" ,pkg-config)
2012 `(("imlib2" ,imlib2)
2013 ("libtiff" ,libtiff)
2015 ("libungif", libungif)
2016 ("libjpeg", libjpeg)
2017 ("libwebp" ,libwebp)
2018 ("openjpeg" ,openjpeg)
2022 ;; support for gtk3 is in testing stage
2027 ;; internationalized version
2033 (home-page "http://mtpaint.sourceforge.net/")
2034 (synopsis "Create pixel art and manipulate digital images")
2036 "Mtpaint is a graphic editing program which uses the GTK+ toolkit.
2037 It can create and edit indexed palette or 24bit RGB images, offers basic
2038 painting and palette manipulation tools. It also handles JPEG, JPEG2000,
2039 GIF, TIFF, WEBP, BMP, PNG, XPM formats.")
2040 (license license:gpl3+))))