├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── myth.png └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "adler" 7 | version = "1.0.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 10 | 11 | [[package]] 12 | name = "aligned-vec" 13 | version = "0.5.0" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" 16 | 17 | [[package]] 18 | name = "anyhow" 19 | version = "1.0.81" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" 22 | 23 | [[package]] 24 | name = "arbitrary" 25 | version = "1.3.2" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" 28 | 29 | [[package]] 30 | name = "arg_enum_proc_macro" 31 | version = "0.3.4" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" 34 | dependencies = [ 35 | "proc-macro2", 36 | "quote", 37 | "syn", 38 | ] 39 | 40 | [[package]] 41 | name = "arrayvec" 42 | version = "0.7.4" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" 45 | 46 | [[package]] 47 | name = "ascii-art" 48 | version = "0.1.0" 49 | dependencies = [ 50 | "image", 51 | ] 52 | 53 | [[package]] 54 | name = "autocfg" 55 | version = "1.2.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" 58 | 59 | [[package]] 60 | name = "av1-grain" 61 | version = "0.2.3" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" 64 | dependencies = [ 65 | "anyhow", 66 | "arrayvec", 67 | "log", 68 | "nom", 69 | "num-rational", 70 | "v_frame", 71 | ] 72 | 73 | [[package]] 74 | name = "avif-serialize" 75 | version = "0.8.1" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" 78 | dependencies = [ 79 | "arrayvec", 80 | ] 81 | 82 | [[package]] 83 | name = "bit_field" 84 | version = "0.10.2" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" 87 | 88 | [[package]] 89 | name = "bitflags" 90 | version = "1.3.2" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 93 | 94 | [[package]] 95 | name = "bitstream-io" 96 | version = "2.2.0" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "06c9989a51171e2e81038ab168b6ae22886fe9ded214430dbb4f41c28cf176da" 99 | 100 | [[package]] 101 | name = "built" 102 | version = "0.7.1" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "38d17f4d6e4dc36d1a02fbedc2753a096848e7c1b0772f7654eab8e2c927dd53" 105 | 106 | [[package]] 107 | name = "bumpalo" 108 | version = "3.15.4" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" 111 | 112 | [[package]] 113 | name = "bytemuck" 114 | version = "1.15.0" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" 117 | 118 | [[package]] 119 | name = "byteorder" 120 | version = "1.5.0" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 123 | 124 | [[package]] 125 | name = "cc" 126 | version = "1.0.90" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" 129 | dependencies = [ 130 | "jobserver", 131 | "libc", 132 | ] 133 | 134 | [[package]] 135 | name = "cfg-expr" 136 | version = "0.15.7" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" 139 | dependencies = [ 140 | "smallvec", 141 | "target-lexicon", 142 | ] 143 | 144 | [[package]] 145 | name = "cfg-if" 146 | version = "1.0.0" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 149 | 150 | [[package]] 151 | name = "color_quant" 152 | version = "1.1.0" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" 155 | 156 | [[package]] 157 | name = "crc32fast" 158 | version = "1.4.0" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" 161 | dependencies = [ 162 | "cfg-if", 163 | ] 164 | 165 | [[package]] 166 | name = "crossbeam-deque" 167 | version = "0.8.5" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 170 | dependencies = [ 171 | "crossbeam-epoch", 172 | "crossbeam-utils", 173 | ] 174 | 175 | [[package]] 176 | name = "crossbeam-epoch" 177 | version = "0.9.18" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 180 | dependencies = [ 181 | "crossbeam-utils", 182 | ] 183 | 184 | [[package]] 185 | name = "crossbeam-utils" 186 | version = "0.8.19" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" 189 | 190 | [[package]] 191 | name = "crunchy" 192 | version = "0.2.2" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 195 | 196 | [[package]] 197 | name = "either" 198 | version = "1.10.0" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" 201 | 202 | [[package]] 203 | name = "equivalent" 204 | version = "1.0.1" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 207 | 208 | [[package]] 209 | name = "exr" 210 | version = "1.72.0" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" 213 | dependencies = [ 214 | "bit_field", 215 | "flume", 216 | "half", 217 | "lebe", 218 | "miniz_oxide", 219 | "rayon-core", 220 | "smallvec", 221 | "zune-inflate", 222 | ] 223 | 224 | [[package]] 225 | name = "fdeflate" 226 | version = "0.3.4" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" 229 | dependencies = [ 230 | "simd-adler32", 231 | ] 232 | 233 | [[package]] 234 | name = "flate2" 235 | version = "1.0.28" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" 238 | dependencies = [ 239 | "crc32fast", 240 | "miniz_oxide", 241 | ] 242 | 243 | [[package]] 244 | name = "flume" 245 | version = "0.11.0" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" 248 | dependencies = [ 249 | "spin", 250 | ] 251 | 252 | [[package]] 253 | name = "getrandom" 254 | version = "0.2.12" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" 257 | dependencies = [ 258 | "cfg-if", 259 | "libc", 260 | "wasi", 261 | ] 262 | 263 | [[package]] 264 | name = "gif" 265 | version = "0.13.1" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" 268 | dependencies = [ 269 | "color_quant", 270 | "weezl", 271 | ] 272 | 273 | [[package]] 274 | name = "half" 275 | version = "2.4.0" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" 278 | dependencies = [ 279 | "cfg-if", 280 | "crunchy", 281 | ] 282 | 283 | [[package]] 284 | name = "hashbrown" 285 | version = "0.14.3" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 288 | 289 | [[package]] 290 | name = "heck" 291 | version = "0.5.0" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 294 | 295 | [[package]] 296 | name = "image" 297 | version = "0.25.1" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" 300 | dependencies = [ 301 | "bytemuck", 302 | "byteorder", 303 | "color_quant", 304 | "exr", 305 | "gif", 306 | "image-webp", 307 | "num-traits", 308 | "png", 309 | "qoi", 310 | "ravif", 311 | "rayon", 312 | "rgb", 313 | "tiff", 314 | "zune-core", 315 | "zune-jpeg", 316 | ] 317 | 318 | [[package]] 319 | name = "image-webp" 320 | version = "0.1.1" 321 | source = "registry+https://github.com/rust-lang/crates.io-index" 322 | checksum = "7a84a25dcae3ac487bc24ef280f9e20c79c9b1a3e5e32cbed3041d1c514aa87c" 323 | dependencies = [ 324 | "byteorder", 325 | "thiserror", 326 | ] 327 | 328 | [[package]] 329 | name = "imgref" 330 | version = "1.10.1" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" 333 | 334 | [[package]] 335 | name = "indexmap" 336 | version = "2.2.6" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" 339 | dependencies = [ 340 | "equivalent", 341 | "hashbrown", 342 | ] 343 | 344 | [[package]] 345 | name = "interpolate_name" 346 | version = "0.2.4" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" 349 | dependencies = [ 350 | "proc-macro2", 351 | "quote", 352 | "syn", 353 | ] 354 | 355 | [[package]] 356 | name = "itertools" 357 | version = "0.12.1" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" 360 | dependencies = [ 361 | "either", 362 | ] 363 | 364 | [[package]] 365 | name = "jobserver" 366 | version = "0.1.28" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" 369 | dependencies = [ 370 | "libc", 371 | ] 372 | 373 | [[package]] 374 | name = "jpeg-decoder" 375 | version = "0.3.1" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" 378 | 379 | [[package]] 380 | name = "lebe" 381 | version = "0.5.2" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" 384 | 385 | [[package]] 386 | name = "libc" 387 | version = "0.2.153" 388 | source = "registry+https://github.com/rust-lang/crates.io-index" 389 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 390 | 391 | [[package]] 392 | name = "libfuzzer-sys" 393 | version = "0.4.7" 394 | source = "registry+https://github.com/rust-lang/crates.io-index" 395 | checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" 396 | dependencies = [ 397 | "arbitrary", 398 | "cc", 399 | "once_cell", 400 | ] 401 | 402 | [[package]] 403 | name = "lock_api" 404 | version = "0.4.11" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" 407 | dependencies = [ 408 | "autocfg", 409 | "scopeguard", 410 | ] 411 | 412 | [[package]] 413 | name = "log" 414 | version = "0.4.21" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 417 | 418 | [[package]] 419 | name = "loop9" 420 | version = "0.1.5" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" 423 | dependencies = [ 424 | "imgref", 425 | ] 426 | 427 | [[package]] 428 | name = "maybe-rayon" 429 | version = "0.1.1" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" 432 | dependencies = [ 433 | "cfg-if", 434 | "rayon", 435 | ] 436 | 437 | [[package]] 438 | name = "memchr" 439 | version = "2.7.2" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 442 | 443 | [[package]] 444 | name = "minimal-lexical" 445 | version = "0.2.1" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 448 | 449 | [[package]] 450 | name = "miniz_oxide" 451 | version = "0.7.2" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" 454 | dependencies = [ 455 | "adler", 456 | "simd-adler32", 457 | ] 458 | 459 | [[package]] 460 | name = "new_debug_unreachable" 461 | version = "1.0.6" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" 464 | 465 | [[package]] 466 | name = "nom" 467 | version = "7.1.3" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 470 | dependencies = [ 471 | "memchr", 472 | "minimal-lexical", 473 | ] 474 | 475 | [[package]] 476 | name = "noop_proc_macro" 477 | version = "0.3.0" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" 480 | 481 | [[package]] 482 | name = "num-bigint" 483 | version = "0.4.4" 484 | source = "registry+https://github.com/rust-lang/crates.io-index" 485 | checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" 486 | dependencies = [ 487 | "autocfg", 488 | "num-integer", 489 | "num-traits", 490 | ] 491 | 492 | [[package]] 493 | name = "num-derive" 494 | version = "0.4.2" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" 497 | dependencies = [ 498 | "proc-macro2", 499 | "quote", 500 | "syn", 501 | ] 502 | 503 | [[package]] 504 | name = "num-integer" 505 | version = "0.1.46" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 508 | dependencies = [ 509 | "num-traits", 510 | ] 511 | 512 | [[package]] 513 | name = "num-rational" 514 | version = "0.4.1" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" 517 | dependencies = [ 518 | "autocfg", 519 | "num-bigint", 520 | "num-integer", 521 | "num-traits", 522 | ] 523 | 524 | [[package]] 525 | name = "num-traits" 526 | version = "0.2.18" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 529 | dependencies = [ 530 | "autocfg", 531 | ] 532 | 533 | [[package]] 534 | name = "once_cell" 535 | version = "1.19.0" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 538 | 539 | [[package]] 540 | name = "paste" 541 | version = "1.0.14" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 544 | 545 | [[package]] 546 | name = "pkg-config" 547 | version = "0.3.30" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" 550 | 551 | [[package]] 552 | name = "png" 553 | version = "0.17.13" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" 556 | dependencies = [ 557 | "bitflags", 558 | "crc32fast", 559 | "fdeflate", 560 | "flate2", 561 | "miniz_oxide", 562 | ] 563 | 564 | [[package]] 565 | name = "ppv-lite86" 566 | version = "0.2.17" 567 | source = "registry+https://github.com/rust-lang/crates.io-index" 568 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 569 | 570 | [[package]] 571 | name = "proc-macro2" 572 | version = "1.0.79" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" 575 | dependencies = [ 576 | "unicode-ident", 577 | ] 578 | 579 | [[package]] 580 | name = "profiling" 581 | version = "1.0.15" 582 | source = "registry+https://github.com/rust-lang/crates.io-index" 583 | checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" 584 | dependencies = [ 585 | "profiling-procmacros", 586 | ] 587 | 588 | [[package]] 589 | name = "profiling-procmacros" 590 | version = "1.0.15" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" 593 | dependencies = [ 594 | "quote", 595 | "syn", 596 | ] 597 | 598 | [[package]] 599 | name = "qoi" 600 | version = "0.4.1" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" 603 | dependencies = [ 604 | "bytemuck", 605 | ] 606 | 607 | [[package]] 608 | name = "quick-error" 609 | version = "2.0.1" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" 612 | 613 | [[package]] 614 | name = "quote" 615 | version = "1.0.35" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 618 | dependencies = [ 619 | "proc-macro2", 620 | ] 621 | 622 | [[package]] 623 | name = "rand" 624 | version = "0.8.5" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 627 | dependencies = [ 628 | "libc", 629 | "rand_chacha", 630 | "rand_core", 631 | ] 632 | 633 | [[package]] 634 | name = "rand_chacha" 635 | version = "0.3.1" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 638 | dependencies = [ 639 | "ppv-lite86", 640 | "rand_core", 641 | ] 642 | 643 | [[package]] 644 | name = "rand_core" 645 | version = "0.6.4" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 648 | dependencies = [ 649 | "getrandom", 650 | ] 651 | 652 | [[package]] 653 | name = "rav1e" 654 | version = "0.7.1" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" 657 | dependencies = [ 658 | "arbitrary", 659 | "arg_enum_proc_macro", 660 | "arrayvec", 661 | "av1-grain", 662 | "bitstream-io", 663 | "built", 664 | "cfg-if", 665 | "interpolate_name", 666 | "itertools", 667 | "libc", 668 | "libfuzzer-sys", 669 | "log", 670 | "maybe-rayon", 671 | "new_debug_unreachable", 672 | "noop_proc_macro", 673 | "num-derive", 674 | "num-traits", 675 | "once_cell", 676 | "paste", 677 | "profiling", 678 | "rand", 679 | "rand_chacha", 680 | "simd_helpers", 681 | "system-deps", 682 | "thiserror", 683 | "v_frame", 684 | "wasm-bindgen", 685 | ] 686 | 687 | [[package]] 688 | name = "ravif" 689 | version = "0.11.5" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "bc13288f5ab39e6d7c9d501759712e6969fcc9734220846fc9ed26cae2cc4234" 692 | dependencies = [ 693 | "avif-serialize", 694 | "imgref", 695 | "loop9", 696 | "quick-error", 697 | "rav1e", 698 | "rayon", 699 | "rgb", 700 | ] 701 | 702 | [[package]] 703 | name = "rayon" 704 | version = "1.10.0" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" 707 | dependencies = [ 708 | "either", 709 | "rayon-core", 710 | ] 711 | 712 | [[package]] 713 | name = "rayon-core" 714 | version = "1.12.1" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 717 | dependencies = [ 718 | "crossbeam-deque", 719 | "crossbeam-utils", 720 | ] 721 | 722 | [[package]] 723 | name = "rgb" 724 | version = "0.8.37" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" 727 | dependencies = [ 728 | "bytemuck", 729 | ] 730 | 731 | [[package]] 732 | name = "scopeguard" 733 | version = "1.2.0" 734 | source = "registry+https://github.com/rust-lang/crates.io-index" 735 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 736 | 737 | [[package]] 738 | name = "serde" 739 | version = "1.0.197" 740 | source = "registry+https://github.com/rust-lang/crates.io-index" 741 | checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" 742 | dependencies = [ 743 | "serde_derive", 744 | ] 745 | 746 | [[package]] 747 | name = "serde_derive" 748 | version = "1.0.197" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" 751 | dependencies = [ 752 | "proc-macro2", 753 | "quote", 754 | "syn", 755 | ] 756 | 757 | [[package]] 758 | name = "serde_spanned" 759 | version = "0.6.5" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" 762 | dependencies = [ 763 | "serde", 764 | ] 765 | 766 | [[package]] 767 | name = "simd-adler32" 768 | version = "0.3.7" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" 771 | 772 | [[package]] 773 | name = "simd_helpers" 774 | version = "0.1.0" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" 777 | dependencies = [ 778 | "quote", 779 | ] 780 | 781 | [[package]] 782 | name = "smallvec" 783 | version = "1.13.2" 784 | source = "registry+https://github.com/rust-lang/crates.io-index" 785 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 786 | 787 | [[package]] 788 | name = "spin" 789 | version = "0.9.8" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 792 | dependencies = [ 793 | "lock_api", 794 | ] 795 | 796 | [[package]] 797 | name = "syn" 798 | version = "2.0.58" 799 | source = "registry+https://github.com/rust-lang/crates.io-index" 800 | checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" 801 | dependencies = [ 802 | "proc-macro2", 803 | "quote", 804 | "unicode-ident", 805 | ] 806 | 807 | [[package]] 808 | name = "system-deps" 809 | version = "6.2.2" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" 812 | dependencies = [ 813 | "cfg-expr", 814 | "heck", 815 | "pkg-config", 816 | "toml", 817 | "version-compare", 818 | ] 819 | 820 | [[package]] 821 | name = "target-lexicon" 822 | version = "0.12.14" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" 825 | 826 | [[package]] 827 | name = "thiserror" 828 | version = "1.0.58" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" 831 | dependencies = [ 832 | "thiserror-impl", 833 | ] 834 | 835 | [[package]] 836 | name = "thiserror-impl" 837 | version = "1.0.58" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" 840 | dependencies = [ 841 | "proc-macro2", 842 | "quote", 843 | "syn", 844 | ] 845 | 846 | [[package]] 847 | name = "tiff" 848 | version = "0.9.1" 849 | source = "registry+https://github.com/rust-lang/crates.io-index" 850 | checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" 851 | dependencies = [ 852 | "flate2", 853 | "jpeg-decoder", 854 | "weezl", 855 | ] 856 | 857 | [[package]] 858 | name = "toml" 859 | version = "0.8.12" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" 862 | dependencies = [ 863 | "serde", 864 | "serde_spanned", 865 | "toml_datetime", 866 | "toml_edit", 867 | ] 868 | 869 | [[package]] 870 | name = "toml_datetime" 871 | version = "0.6.5" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" 874 | dependencies = [ 875 | "serde", 876 | ] 877 | 878 | [[package]] 879 | name = "toml_edit" 880 | version = "0.22.9" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" 883 | dependencies = [ 884 | "indexmap", 885 | "serde", 886 | "serde_spanned", 887 | "toml_datetime", 888 | "winnow", 889 | ] 890 | 891 | [[package]] 892 | name = "unicode-ident" 893 | version = "1.0.12" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 896 | 897 | [[package]] 898 | name = "v_frame" 899 | version = "0.3.8" 900 | source = "registry+https://github.com/rust-lang/crates.io-index" 901 | checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" 902 | dependencies = [ 903 | "aligned-vec", 904 | "num-traits", 905 | "wasm-bindgen", 906 | ] 907 | 908 | [[package]] 909 | name = "version-compare" 910 | version = "0.2.0" 911 | source = "registry+https://github.com/rust-lang/crates.io-index" 912 | checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" 913 | 914 | [[package]] 915 | name = "wasi" 916 | version = "0.11.0+wasi-snapshot-preview1" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 919 | 920 | [[package]] 921 | name = "wasm-bindgen" 922 | version = "0.2.92" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 925 | dependencies = [ 926 | "cfg-if", 927 | "wasm-bindgen-macro", 928 | ] 929 | 930 | [[package]] 931 | name = "wasm-bindgen-backend" 932 | version = "0.2.92" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 935 | dependencies = [ 936 | "bumpalo", 937 | "log", 938 | "once_cell", 939 | "proc-macro2", 940 | "quote", 941 | "syn", 942 | "wasm-bindgen-shared", 943 | ] 944 | 945 | [[package]] 946 | name = "wasm-bindgen-macro" 947 | version = "0.2.92" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 950 | dependencies = [ 951 | "quote", 952 | "wasm-bindgen-macro-support", 953 | ] 954 | 955 | [[package]] 956 | name = "wasm-bindgen-macro-support" 957 | version = "0.2.92" 958 | source = "registry+https://github.com/rust-lang/crates.io-index" 959 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 960 | dependencies = [ 961 | "proc-macro2", 962 | "quote", 963 | "syn", 964 | "wasm-bindgen-backend", 965 | "wasm-bindgen-shared", 966 | ] 967 | 968 | [[package]] 969 | name = "wasm-bindgen-shared" 970 | version = "0.2.92" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 973 | 974 | [[package]] 975 | name = "weezl" 976 | version = "0.1.8" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" 979 | 980 | [[package]] 981 | name = "winnow" 982 | version = "0.6.5" 983 | source = "registry+https://github.com/rust-lang/crates.io-index" 984 | checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" 985 | dependencies = [ 986 | "memchr", 987 | ] 988 | 989 | [[package]] 990 | name = "zune-core" 991 | version = "0.4.12" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" 994 | 995 | [[package]] 996 | name = "zune-inflate" 997 | version = "0.2.54" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" 1000 | dependencies = [ 1001 | "simd-adler32", 1002 | ] 1003 | 1004 | [[package]] 1005 | name = "zune-jpeg" 1006 | version = "0.4.11" 1007 | source = "registry+https://github.com/rust-lang/crates.io-index" 1008 | checksum = "ec866b44a2a1fd6133d363f073ca1b179f438f99e7e5bfb1e33f7181facfe448" 1009 | dependencies = [ 1010 | "zune-core", 1011 | ] 1012 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ascii-art" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | image = "0.25.1" -------------------------------------------------------------------------------- /myth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nwaliaez/ascii_art/064595d3c6c0fcbd51ef35950488f41b2ff4d302/myth.png -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use image::GenericImageView; 2 | 3 | fn get_str_ascii(intent: u8) -> &'static str { 4 | let index = intent / 32; 5 | let ascii = [" ", ".", ",", "-", "~", "+", "=", "@"]; 6 | return ascii[index as usize]; 7 | } 8 | 9 | fn get_image(dir: &str, scale: u32) { 10 | let img = image::open(dir).unwrap(); 11 | let (width, height) = img.dimensions(); 12 | for y in 0..height { 13 | for x in 0..width { 14 | if y % (scale * 2) == 0 && x % scale == 0 { 15 | let pix = img.get_pixel(x, y); 16 | let mut intent = pix[0] / 3 + pix[1] / 3 + pix[2] / 3; 17 | if pix[3] == 0 { 18 | intent = 0; 19 | } 20 | print!("{}", get_str_ascii(intent)); 21 | } 22 | } 23 | if y % (scale * 2) == 0 { 24 | println!(""); 25 | } 26 | } 27 | } 28 | fn main() { 29 | get_image("myth.png", 4); 30 | } 31 | --------------------------------------------------------------------------------