image.scm 96 KB

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