image.scm 94 KB

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