├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── art.py ├── build.sh ├── checker.py ├── common.pyx ├── coords.py ├── data ├── adjectives.txt ├── nouns.txt ├── prepositions.txt └── pronouns.txt ├── full_list.py ├── icon.ico ├── images ├── example1.png ├── example2.png ├── example3.png ├── example4.png ├── example5.png ├── example6.png ├── example7.png ├── example8.png ├── example9.png └── gui.png ├── main.py ├── names_generator.py ├── operator_lists.py ├── operators.pyx ├── output └── .donotremove ├── palettes.py ├── read_data.py ├── requirements.txt ├── samples ├── 1.txt ├── 10.txt ├── 11.txt ├── 12.txt ├── 13.txt ├── 14.txt ├── 15.txt ├── 16.txt ├── 17.txt ├── 18.txt ├── 19.txt ├── 2.txt ├── 20.txt ├── 21.txt ├── 22.txt ├── 23.txt ├── 24.txt ├── 25.txt ├── 26.txt ├── 27.txt ├── 28.txt ├── 29.txt ├── 3.txt ├── 30.txt ├── 31.txt ├── 32.txt ├── 33.txt ├── 34.txt ├── 35.txt ├── 36.txt ├── 37.txt ├── 38.txt ├── 39.txt ├── 4.txt ├── 40.txt ├── 41.txt ├── 42.txt ├── 5.txt ├── 6.txt ├── 7.txt ├── 8.txt └── 9.txt └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.pyc 3 | .vscode 4 | *.csv 5 | dist 6 | build 7 | *.spec 8 | output/*.txt 9 | output/*.png 10 | *.so 11 | *.c 12 | *.pyd 13 | *.html 14 | *.cpp -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | ## [0.9.11] - 2020-01-14 5 | ### Changed 6 | - [operators.pyx](operators.pyx) - added Fibonacci operator, 7 | 8 | ## [0.9.10] - 2019-02-19 9 | ### Added 10 | - This file. 11 | 12 | ### Changed 13 | - Checker file - reduced count of checking squares in preview_score(). 14 | - [build.sh](build.sh) - install requirements with --user flag. 15 | 16 | ## [0.9.9] - 2018-12-24 17 | ### Changed 18 | - First release version. 19 | 20 | [0.9.11]: https://github.com/qiray/MathArtist/releases/tag/0.9.11 21 | [0.9.10]: https://github.com/qiray/MathArtist/releases/tag/0.9.10 22 | [0.9.9]: https://github.com/qiray/MathArtist/releases/tag/0.9.9 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MathArtist 2 | 3 | Tool for generating pictures using mathematical formulas. 4 | 5 | drawing 6 | 7 | ## Algorithm 8 | 9 | To create new image we perform these steps: 10 | 11 | * Generate name using data folder with mulltiple nouns, adjectives, prepositions and pronouns and [names_generator](names_generator.py) module to convert single words into fun looking image name. 12 | * Select operators from predefined sets and coordinates conversion transformations. All coordinates are converted to range [-1, 1] because this range nicely fits to many mathematical operations. See [coords](coords.py) module for more information. 13 | * Generate expression tree using operators from previous step that convert each (x, y) point to color. There are multiple operators from simplest VariableX (which converts coordinate to (x, x, x) color) to difficult Mix and Closest (you can see their code in [operators](operators.pyx) module). Tree size is dynamic so there can be something simple like Mix(x, y, Well(x)) or long multiline formula which computing can take some minutes. 14 | * We also use [checker](checker.py) to check if generated formula is bad and recreate it. Checker is very simple - it thinks formula is good when it has different functions, has few well and tent functions (because they produce boring looking lines) and generates multicolor image (because the "Black square" by Malevich already exists). By the way sometimes checker decides that even bad formula should get a chance. It's not a bug, it's a feature. 15 | * And now we convert each point of image to color using coordinates transform from step 2 and expression tree from step 3. After all points have their colors we can draw comleted image. That's all. 16 | 17 | ## Releases 18 | 19 | You can download the last release here: 20 | 21 | https://github.com/qiray/MathArtist/releases 22 | 23 | ## Requirements 24 | 25 | This program uses Python 3 so you need to have Python 3 and pip for build and run it. To install them use instructions for your OS. 26 | 27 | It also needs some extra libraries and applications such as argparse, PIL, numpy, PyQt5, pyinstaller and Cython. This program has script [build.sh](build.sh) for preparing and building binaries. So for installing requirements run: 28 | 29 | ```bash 30 | bash build.sh prebuild 31 | ``` 32 | 33 | Of course you should have bash for running this script. 34 | 35 | Some packages such as PyQt5 require additional packages on some OS. For example on deb-based systems you should also install python3-pyqt5: 36 | 37 | ``` bash 38 | apt install python3-pyqt5 pyqt5-dev-tools 39 | ``` 40 | 41 | This tool also need C/C++ compiler because of using Cython. You can install it following instructions for your OS. 42 | 43 | ## Building 44 | 45 | For making Cython modules you should run: 46 | 47 | ```bash 48 | bash build.sh cython 49 | ``` 50 | 51 | Or for installing requirements and building Cython modules in one step you can run: 52 | 53 | ```bash 54 | bash build.sh 55 | ``` 56 | 57 | ### Pyinstaller 58 | 59 | I prefer to use pyinstaller for building release versions. To build release run: 60 | 61 | ```bash 62 | bash build.sh install 63 | ``` 64 | 65 | The release will be in dist folder. 66 | 67 | ## Usage 68 | 69 | To run app from sources folder type: 70 | 71 | ```bash 72 | python main.py 73 | #or this if your python 3 has name python3: 74 | python3 main.py 75 | ``` 76 | 77 | To run app from release build run double click on mathartist executable or run: 78 | 79 | ```bash 80 | ./mathartist 81 | ``` 82 | 83 | There are 2 work modes: console and GUI. 84 | 85 | ### Console 86 | 87 | In console mode app generates one image, saves it and exits. 88 | 89 | There are some extra modes: 90 | 91 | ``` 92 | usage: MathArtist [-h] [--console] [--name NAME] [--about] [--file FILE] 93 | [--generate_list] 94 | 95 | Tool for generating pictures using mathematical formulas. 96 | 97 | optional arguments: 98 | -h, --help show this help message and exit 99 | --console Run in console mode (no window) 100 | --name Set image name 101 | --about Show about info 102 | --file FILE Load file 103 | --generate_list Generate operators' list (developer option) 104 | ``` 105 | 106 | ### GUI 107 | 108 | GUI in this app is pretty simple. There are 4 buttons: 109 | 110 | - "Random image" which generates new random name and image. 111 | 112 | - "Generate image" which generates new image based on it's name in text field (same names produce same images). 113 | 114 | - "Save image" which saves image in output folder. 115 | 116 | - "Load image" which shows open file dialog to load text file with formula. 117 | 118 | And 1 text field for image name. 119 | 120 | ![](images/gui.png) 121 | 122 | #### Shortcuts 123 | 124 | There are some hotkeys: 125 | 126 | | Shortcut | Command | 127 | | :--------------- | :----------- | 128 | | n, r | Generate new random image | 129 | | g | Generate new image based on it's name in text field | 130 | | o | Open text file with formula | 131 | | s | Save image in output folder | 132 | | a | Show about info | 133 | | Esc | Close app | 134 | | F1 | Show online help (this readme) | 135 | 136 | ### Samples 137 | 138 |

139 | drawing 140 | drawing 141 | drawing 142 |

143 |

144 | drawing 145 | drawing 146 | drawing 147 |

148 |

149 | drawing 150 | drawing 151 | drawing 152 |

153 | 154 | There is samples folder with some nice images in text format. You can use app's read file option ("Load image" button in GUI) to convert these texts into images. 155 | 156 | ## Online content 157 | 158 | Math Artist also has it's own Twitter (https://twitter.com/math_artist) and Instagram (https://www.instagram.com/qarmath/) accounts. You are welcome to follow, like, repost and comment. 159 | 160 | ## License 161 | 162 | In short the MathArtist uses GNU GPL3. For more information see the LICENSE file. 163 | 164 | But there is one nuance. This program uses some code from Andrej Bauer's randomart project. Original randomart project is licensed with BSD 2-clause license. You can download it here - http://math.andrej.com/2010/04/21/random-art-in-python/ 165 | 166 | Andrej Bauer's code in this project is licensed with both BSD 2-clause and GNU GPL3 licenses. The combined project uses only GNU GPL3. You shouldn't use any part of MathArtist with BSD license. Please use GNU GPL3 only. 167 | 168 | ## Thanks 169 | 170 | I'd like to thank: 171 | 172 | Andrej Bauer for wonderful online random art project (http://www.random-art.org/online/), original Python randomart code (http://math.andrej.com/2010/04/21/random-art-in-python/) and great ideas which lead to this project. 173 | 174 | Matt DesLauriers for cool color-wander project (http://color-wander.surge.sh/ and https://github.com/mattdesl/color-wander) and nice palettes used in this project. 175 | 176 | Volodymyr Shymanskyy for his JS randomart project (https://github.com/vshymanskyy/randomart) that gave me some ideas such as mindepth and some operators. 177 | 178 | Halvor Kjærås for random art generator - (http://ironigardinen.net/generatorer/art2/index.html). It gave me some ideas and data for MathArtist art name generator. 179 | -------------------------------------------------------------------------------- /art.py: -------------------------------------------------------------------------------- 1 | 2 | # MathArtist - tool for generating pictures using mathematical formulas. 3 | # Copyright (c) 2018-2019, Yaroslav Zotov, https://github.com/qiray/ 4 | # All rights reserved. 5 | 6 | # This file is part of MathArtist. 7 | 8 | # MathArtist is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | 13 | # MathArtist is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | 18 | # You should have received a copy of the GNU General Public License 19 | # along with MathArtist. If not, see . 20 | 21 | ################################################################################ 22 | 23 | # This file uses code from Andrej Bauer's randomart project under 24 | # following conditions: 25 | 26 | # Copyright (c) 2010, Andrej Bauer, http://andrej.com/ 27 | # All rights reserved. 28 | # 29 | # Redistribution and use in source and binary forms, with or without 30 | # modification, are permitted provided that the following conditions are met: 31 | # 32 | # * Redistributions of source code must retain the above copyright notice, 33 | # this list of conditions and the following disclaimer. 34 | # 35 | # * Redistributions in binary form must reproduce the above copyright 36 | # notice, this list of conditions and the following disclaimer in the 37 | # documentation and/or other materials provided with the distribution. 38 | # 39 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 40 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 41 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 42 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 43 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 44 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 45 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 46 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 47 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 48 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 49 | 50 | import sys 51 | import os 52 | import math 53 | import random 54 | import time 55 | import hashlib 56 | from datetime import datetime 57 | from PIL import Image, ImageDraw 58 | import numpy as np 59 | 60 | from PyQt5 import QtCore 61 | 62 | from common import rgb, int_rgb, get_app_path, SIZE 63 | from operators import Palette 64 | from operator_lists import operatorsLists 65 | from coords import coord_transforms 66 | from read_data import parse_formula, read_file 67 | from names_generator import generate_name 68 | from checker import check_art 69 | 70 | APP_NAME = "MathArtist" 71 | VERSION_MAJOR = 0 72 | VERSION_MINOR = 9 73 | VERSION_BUILD = 11 74 | 75 | class Art(): 76 | """Math art generator class""" 77 | operatorsList = random.choice(operatorsLists) 78 | terminals = [op for op in operatorsList if op.arity == 0] 79 | nonterminals = [op for op in operatorsList if op.arity > 0] 80 | use_depth = True 81 | coord_transform = coord_transforms[0] 82 | polar_shifts = [[0.5, 0.5], [0, 0], [0, 1], [1, 0], [1, 1]] 83 | polar_shift = [0, 0] 84 | 85 | @staticmethod 86 | def init_static_data(): 87 | # We precompute those operators that have arity 0 and arity > 0 88 | Art.operatorsList = random.choice(operatorsLists) 89 | Art.terminals = [op for op in Art.operatorsList if op.arity == 0] 90 | Art.nonterminals = [op for op in Art.operatorsList if op.arity > 0] 91 | 92 | Art.use_depth = True if random.random() >= 0.5 else False 93 | Art.coord_transform = random.choice(coord_transforms) 94 | index = random.randint(-1, len(Art.polar_shifts) - 1) 95 | if index == -1: 96 | Art.polar_shift = [random.random(), random.random()] 97 | else: 98 | Art.polar_shift = Art.polar_shifts[index] 99 | 100 | def __init__(self, name=None, use_checker=False, console=False, load_file=None): 101 | self.need_new_name = True 102 | self.name = self.init_name(name) 103 | self.use_checker = use_checker 104 | self.size = SIZE #we always use constant size = 512 105 | self.size_log = int(math.log(self.size, 2)) 106 | self.img = Image.new('RGBA', (self.size, self.size)) 107 | self.image_draw = ImageDraw.Draw(self.img) 108 | self.functions = {} 109 | self.output_path = os.path.join(get_app_path(), "output/") 110 | self.console = console 111 | self.stop_work = False 112 | self.status = "Drawing" 113 | self.trigger = None 114 | self.image_array = self.init_image_array() 115 | self.filepath = load_file 116 | if self.console: 117 | if load_file: 118 | self.read_file_data(load_file) 119 | exit(0) 120 | self.name = self.init_name(name) 121 | self.redraw() 122 | 123 | def set_name(self, name): 124 | self.name = self.init_name(name) 125 | self.need_new_name = False 126 | 127 | def reset_name(self): 128 | self.name = '' 129 | self.need_new_name = True 130 | random.seed(datetime.now()) 131 | 132 | def stop_drawing(self): 133 | self.stop_work = True 134 | self.status = "Stopped" 135 | 136 | def set_file(self, filepath): 137 | self.filepath = filepath 138 | 139 | def set_trigger(self, trigger): 140 | self.trigger = trigger 141 | 142 | def init_name(self, hash_string): 143 | if hash_string: 144 | hex_string = hashlib.md5(hash_string.encode('utf-8')) 145 | hexdigest = hex_string.hexdigest() 146 | random.seed(int(hexdigest, 16)) 147 | self.need_new_name = False 148 | return hash_string 149 | self.need_new_name = True 150 | random.seed(datetime.now()) 151 | return generate_name() 152 | 153 | def update_functions_dict(self, name): 154 | '''Calc used functions count''' 155 | if not name in self.functions: 156 | self.functions[name] = 1 157 | else: 158 | self.functions[name] += 1 159 | 160 | def generate(self, k=8, depth=0): 161 | '''Randomly generate an expession of a given size.''' 162 | if k <= depth: 163 | # We used up available size, generate a leaf of the expression tree 164 | op = random.choice(Art.terminals) 165 | if self.use_checker: 166 | self.update_functions_dict(op.__name__) 167 | return op() 168 | # randomly pick an operator whose arity > 0 and mindepth <= depth 169 | if Art.use_depth: 170 | nonterminals = [x for x in Art.nonterminals if x.mindepth <= depth] 171 | if nonterminals: #if list is not empty 172 | op = random.choice(nonterminals) 173 | else: 174 | op = random.choice(Art.nonterminals) 175 | else: 176 | op = random.choice(Art.nonterminals) 177 | if self.use_checker: 178 | self.update_functions_dict(op.__name__) 179 | # generate subexpressions 180 | args = [] # the list of generated subexpression 181 | depth += 1 182 | for _ in range(0, op.arity): 183 | args.append(self.generate(k, depth)) 184 | return op(*args) 185 | 186 | def init_image_array(self): 187 | return [[None for _ in range(self.size)] for _ in range(self.size)] 188 | 189 | def prepare(self): 190 | self.name = self.init_name(generate_name()) if self.need_new_name else self.name 191 | Art.init_static_data() 192 | Palette.randomPalette() 193 | self.start = time.time() 194 | self.image_array = self.init_image_array() 195 | self.stop_work = False 196 | self.functions = {} 197 | depth = random.randrange(1, self.size_log + 1) 198 | if self.filepath: 199 | self.stop_work = False 200 | self.read_file_data(self.filepath) 201 | return 202 | self.filepath = None 203 | self.art = self.generate(depth) 204 | if self.use_checker: 205 | result = check_art(self.art, self.functions, Art.coord_transform, depth) 206 | print ('Checker result =', result) 207 | while result <= 0: 208 | print ('Generating new art') 209 | self.functions = {} 210 | depth = random.randrange(1, self.size_log + 1) 211 | self.art = self.generate(depth) 212 | result = check_art(self.art, self.functions, Art.coord_transform, depth) 213 | print ('Checker result =', result) 214 | 215 | def redraw(self): 216 | self.prepare() 217 | self.draw_image() 218 | 219 | def get_output_name(self): 220 | date = str(datetime.now().strftime('%Y-%m-%d %H-%M ')) 221 | return self.output_path + date + self.name 222 | 223 | def save_image_text(self): 224 | self.img.save(self.get_output_name() + ".png") 225 | orig_stdout = sys.stdout #save original stdout 226 | f = open(self.get_output_name() + ".txt", 'w') 227 | sys.stdout = f #redirect stdout to file 228 | self.print_art() 229 | sys.stdout = orig_stdout #restore original stdout 230 | f.close() 231 | print("Saved") 232 | if self.trigger: 233 | self.status = "Saved" 234 | self.trigger.emit() #emit trigger to redraw image 235 | 236 | def draw_image(self): 237 | self.status = "Drawing" 238 | self.print_art() 239 | self.d = 16 # current square size 240 | self.stage = 1 241 | self.stages = int(math.log(self.d, 4)) + 1 242 | if self.console: 243 | self.d = 1 #we don't need previews 244 | self.draw() 245 | if self.console: 246 | self.save_image_text() 247 | 248 | def draw(self): 249 | if self.d < 1 or self.stop_work: 250 | self.end = time.time() 251 | print("Time for drawing:", self.end - self.start) 252 | self.status = "Completed in %g s" % (self.end - self.start) 253 | return 254 | flag = self.d > 1 255 | for y in range(0, self.size, self.d): 256 | if self.stop_work: 257 | break 258 | for x in range(0, self.size, self.d): 259 | if self.stop_work: 260 | break 261 | #Convert coordinates to range [-1, 1] 262 | u, v = Art.coord_transform(x, y, self.size, Art.polar_shift) 263 | if not self.image_array[x][y]: 264 | (r, g, b) = self.art.eval(u, v) 265 | self.image_array[x][y] = int_rgb(r, g, b) 266 | if flag: 267 | self.image_draw.rectangle( 268 | ((x, y), (x + self.d, y + self.d)), 269 | fill=self.image_array[x][y] 270 | ) 271 | if not (self.stop_work or flag): 272 | pixels = np.array(self.image_array) 273 | pixels = np.swapaxes(pixels, 0, 1) 274 | self.img = Image.fromarray(pixels.astype('uint8'), 'RGBA') 275 | self.image_draw = ImageDraw.Draw(self.img) 276 | if self.stage == self.stages: 277 | self.status = "Completed in %g s" % (time.time() - self.start) 278 | else: 279 | self.status = "Drawing (stage %d of %d)" % (self.stage, self.stages) 280 | self.stage += 1 281 | if self.trigger: 282 | self.trigger.emit() #emit trigger to redraw image 283 | self.d = self.d // 4 284 | self.draw() 285 | 286 | def read_file_data(self, path): 287 | try: 288 | art, use_depth, coord_transform, polar_shift, name = read_file(path) 289 | self.read_art_params(art, use_depth, coord_transform, polar_shift, name) 290 | except: 291 | print ("Failed to read file " + path) 292 | 293 | def read_art_params(self, art, use_depth, coord_transform, polar_shift, name): 294 | self.functions = {} 295 | self.art = parse_formula(art) 296 | Art.use_depth = parse_formula(use_depth) 297 | Art.coord_transform = parse_formula(coord_transform) 298 | if polar_shift: 299 | Art.polar_shift = parse_formula(polar_shift) 300 | if name: 301 | self.name = name 302 | else: 303 | self.name = generate_name() 304 | self.start = time.time() 305 | self.draw_image() #draw image with new params 306 | 307 | def print_art(self): 308 | print("Name:", self.name) 309 | print("Using operators:", [x.__name__ for x in Art.operatorsList]) 310 | print("Use depth:", Art.use_depth) 311 | print("Coordinates transform:", Art.coord_transform.__name__) 312 | if Art.coord_transform.__name__ == 'polar': 313 | print("Polar shift:", Art.polar_shift) 314 | print("Formula:", self.art, '\n') #draw art tree 315 | 316 | def get_art_as_object(self): 317 | result = {} 318 | result['coord'] = Art.coord_transform.__name__ 319 | result['shift'] = str(Art.polar_shift).replace("[", "(").replace("]", ")") 320 | result['formula'] = str(self.art) 321 | return result 322 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | PYTHON=python 6 | 7 | check_python() { 8 | command -v "$1" >/dev/null 2>&1 && 9 | "$1" -c 'import sys; assert sys.version_info >= (3, 0)' 2>/dev/null && 10 | echo "$1" 11 | } 12 | 13 | get_python() { 14 | check_python python || check_python python3 || { 15 | echo >&2 "I require python 3 but it's not installed. Aborting." 16 | exit 1 17 | } 18 | } 19 | 20 | build_cython() { 21 | $PYTHON setup.py build_ext --inplace 22 | } 23 | 24 | build_pyinstaller() { 25 | echo "Building executable" 26 | ADD_BINARY="" 27 | if [[ "$OSTYPE" == "linux-gnu" ]]; then 28 | ADD_BINARY=--add-binary="/usr/lib64/libGL.so.1:lib" 29 | fi 30 | pyinstaller --onefile --windowed main.py -n mathartist --hidden-import=palettes $ADD_BINARY --icon=icon.ico 31 | cp -r data dist/ 32 | cp -r samples dist/ 33 | cp icon.ico dist/ 34 | cp README.md dist/ 35 | cp LICENSE dist/ 36 | mkdir -p dist/output 37 | echo "Done!" 38 | } 39 | 40 | echo "Checking for python 3" 41 | PYTHON=$(get_python) 42 | echo "Found python 3 - $PYTHON" 43 | 44 | PREBUILD=false 45 | CYTHON=false 46 | INSTALL=false 47 | CLEAN=false 48 | if [[ $# -eq 0 ]]; then 49 | PREBUILD=true 50 | CYTHON=true 51 | fi 52 | while [[ $# -gt 0 ]]; do 53 | key="$1" 54 | case $key in 55 | install) 56 | INSTALL=true 57 | shift # pass argument 58 | ;; 59 | cython) 60 | CYTHON=true 61 | shift 62 | ;; 63 | full) 64 | PREBUILD=true 65 | CYTHON=true 66 | INSTALL=true 67 | shift 68 | ;; 69 | prebuild) 70 | PREBUILD=true 71 | shift 72 | ;; 73 | clean) 74 | CLEAN=true 75 | shift 76 | ;; 77 | *) 78 | echo "Unknown argument" 79 | exit 0 80 | ;; 81 | esac 82 | done 83 | 84 | $CLEAN && { 85 | rm -f -- *.c *.so *.pyd 86 | exit 0 87 | } 88 | 89 | $PREBUILD && { 90 | echo "Installing requirements" 91 | $PYTHON -m pip install -r requirements.txt --user 92 | } 93 | 94 | $CYTHON && { 95 | build_cython 96 | } 97 | 98 | $INSTALL && { 99 | build_pyinstaller 100 | } 101 | -------------------------------------------------------------------------------- /checker.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2018-2019, Yaroslav Zotov, https://github.com/qiray/ 3 | # All rights reserved. 4 | 5 | # This file is part of MathArtist. 6 | 7 | # MathArtist is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | 12 | # MathArtist is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | 17 | # You should have received a copy of the GNU General Public License 18 | # along with MathArtist. If not, see . 19 | 20 | '''Module for checking generated art''' 21 | 22 | import math 23 | import random 24 | from common import SIZE, float_color_to_int 25 | 26 | def functions_count(total, functions): 27 | result = 0 28 | for i in functions: 29 | if i in total: 30 | result += total[i] 31 | return result 32 | 33 | def color_distance(c1, c2): 34 | (r1, g1, b1) = c1 35 | (r2, g2, b2) = c2 36 | r = abs(r1 - r2)/255 37 | g = abs(g1 - g2)/255 38 | b = abs(b1 - b2)/255 39 | return (r + g + b) / 3 #1 means opposit colors, 0 means same colors 40 | 41 | def preview_score(art, coord_system): 42 | """Check colors count""" 43 | shift = [0, 0] 44 | d = 32 45 | size = SIZE #Is it normal? 46 | colors = [] 47 | for y in range(0, size, d): 48 | for x in range(0, size, d): 49 | u, v = coord_system(x, y, size, shift) 50 | (r, g, b) = art.eval(u, v) 51 | color = (float_color_to_int(r), float_color_to_int(g), float_color_to_int(b)) 52 | colors.append(color) 53 | set_colors = set(colors) 54 | if len(set_colors) == 1: 55 | return -1000 56 | side_size = size//d 57 | count = side_size*side_size 58 | start = 0 59 | diff = 1 60 | distances = [] 61 | #Simulate flood-fill algorithm to get distance 62 | while count > 0: 63 | end = start + diff*side_size 64 | for i in range(start, end, diff): 65 | distances.append(color_distance(colors[i], colors[i - 1])) 66 | count -= 1 67 | start = end + side_size - 1 if diff > 0 else start + 1 68 | diff = -diff 69 | dist_max = max(distances) 70 | if dist_max <= 0.05: #if distance is small the image has few colors 71 | return -100 72 | elif dist_max <= 0.15: 73 | return math.ceil(dist_max)*100 - 15 74 | return 1 75 | 76 | def check_art(art, functions, coord_system, depth): 77 | """Generated art quality checker. 78 | Image is probably bad if: 79 | art's depth is small (1 or 2); 80 | there are too many same functions; 81 | there are many Well and Tent.""" 82 | 83 | coord_system_name = coord_system.__name__ 84 | depth = depth if depth > 0 else 1 85 | count = sum(functions.values()) 86 | if count >= 10000: #Too difficult formula 87 | return -1000 88 | result = 5*len(functions) 89 | count -= functions_count(functions, ['VariableX', 'VariableY']) 90 | well_tent = functions_count(functions, ['Well', 'Tent']) 91 | if well_tent >= 0.6*count: #there are too many well and tent functions 92 | result -= int(well_tent/count*100) 93 | if depth <= 2: #small depth 94 | result -= int(30/depth) 95 | if well_tent >= 0.5*count: #many well and tent functions 96 | result -= int(30/depth) 97 | if coord_system_name == 'polar': # If coord_system is polar, image is often good 98 | result = result if result > 0 else 10 99 | if coord_system_name == 'rotate_coord' or coord_system_name == 'center': # Add some extra score 100 | result += 50 101 | result += preview_score(art, coord_system) 102 | if result < 0 and result > -50 and random.random() > 0.9: #sometimes even a bad picture should get a chance 103 | result = 1 104 | elif result < -50 and random.random() > 0.99: 105 | result = 0.1 106 | return result 107 | -------------------------------------------------------------------------------- /common.pyx: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2018, Yaroslav Zotov, https://github.com/qiray/ 3 | # All rights reserved. 4 | 5 | # This file is part of MathArtist. 6 | 7 | # MathArtist is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | 12 | # MathArtist is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | 17 | # You should have received a copy of the GNU General Public License 18 | # along with MathArtist. If not, see . 19 | 20 | ################################################################################ 21 | 22 | # This file uses code from Andrej Bauer's randomart project under 23 | # following conditions: 24 | 25 | # Copyright (c) 2010, Andrej Bauer, http://andrej.com/ 26 | # All rights reserved. 27 | # 28 | # Redistribution and use in source and binary forms, with or without 29 | # modification, are permitted provided that the following conditions are met: 30 | # 31 | # * Redistributions of source code must retain the above copyright notice, 32 | # this list of conditions and the following disclaimer. 33 | # 34 | # * Redistributions in binary form must reproduce the above copyright 35 | # notice, this list of conditions and the following disclaimer in the 36 | # documentation and/or other materials provided with the distribution. 37 | # 38 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 39 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 40 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 41 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 42 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 43 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 44 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 45 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 46 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 47 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 48 | 49 | # cython: language_level=3 50 | 51 | cimport libc.math as cmath 52 | import os 53 | import sys 54 | import itertools 55 | 56 | CONSOLE = 1 57 | GUI = 2 58 | SIZE = 512 59 | 60 | ctypedef (double, double, double) color 61 | 62 | # File with utility functions 63 | 64 | # Math functions 65 | 66 | cpdef double well(double x): 67 | '''A function which looks a bit like a well.''' 68 | cdef double result = 1 - 2 / cmath.pow(1 + x*x, 8) 69 | result = 1 if result < -1 else result 70 | return result 71 | 72 | cpdef double tent(double x): 73 | '''A function that looks a bit like a tent.''' 74 | return 1 - 2 * cmath.fabs(x) 75 | 76 | cpdef double sin_curve(double x): 77 | cdef double val = x if x != 0 else 1 78 | return cmath.sin(1/val) 79 | 80 | cpdef double abs_sin(double x): 81 | return cmath.sin(cmath.fabs(x)) 82 | 83 | cpdef double wave(double x, double y): 84 | return cmath.sin(cmath.sqrt(x**2 + y**2)) 85 | 86 | # Color functions 87 | 88 | cpdef int float_color_to_int(double c): 89 | return max(0, min(255, int(128 * (c + 1)))) 90 | 91 | cpdef color average(color c1, color c2, double w=0.5): 92 | '''Compute the weighted average of two colors. With w = 0.5 we get the average.''' 93 | (r1, g1, b1) = c1 94 | (r2, g2, b2) = c2 95 | cdef double r3 = w * r1 + (1 - w) * r2 96 | cdef double g3 = w * g1 + (1 - w) * g2 97 | cdef double b3 = w * b1 + (1 - w) * b2 98 | return (r3, g3, b3) 99 | 100 | cpdef (int, int, int, int) int_rgb(double r, double g, double b): 101 | return (float_color_to_int(r), float_color_to_int(g), float_color_to_int(b), 255) 102 | 103 | def rgb(r,g,b): 104 | '''Convert a color represented by (r,g,b) to a string understood by tkinter.''' 105 | cdef int u = float_color_to_int(r) 106 | cdef int v = float_color_to_int(g) 107 | cdef int w = float_color_to_int(b) 108 | return '#%02x%02x%02x' % (u, v, w) 109 | 110 | def parse_color(str): 111 | h = str.lstrip('#') 112 | return tuple(int(h[i:i+2], 16) for i in (0, 2 ,4)) 113 | 114 | cpdef color color_binary(c1, c2, operator): 115 | cdef (int, int, int) colors1 = tuple([float_color_to_int(x) for x in c1]) 116 | cdef (int, int, int) colors2 = tuple([float_color_to_int(x) for x in c2]) 117 | return tuple([2*operator(x1, x2)/255.0 - 1 for x1, x2 in zip(colors1, colors2)]) 118 | 119 | # Aux functions 120 | 121 | def get_app_path(): 122 | if getattr(sys, 'frozen', False): 123 | return os.path.dirname(sys.executable) 124 | elif __file__: 125 | return os.path.dirname(__file__) 126 | return '' 127 | -------------------------------------------------------------------------------- /coords.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2018, Yaroslav Zotov, https://github.com/qiray/ 3 | # All rights reserved. 4 | 5 | # This file is part of MathArtist. 6 | 7 | # MathArtist is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | 12 | # MathArtist is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | 17 | # You should have received a copy of the GNU General Public License 18 | # along with MathArtist. If not, see . 19 | 20 | import math 21 | 22 | def linear_coord(x, y, size, polar_shift=None): 23 | u = 2 * x/size - 1.0 24 | v = 2 * y/size - 1.0 25 | return u, v 26 | 27 | def tent_coord(x, y, size, polar_shift=None): 28 | u = 1 - 2 * abs(x/size) 29 | v = 1 - 2 * abs(y/size) 30 | return u, v 31 | 32 | def sin_coord(x, y, size, polar_shift=None): 33 | u = math.sin(2*math.pi*x/size) 34 | v = math.sin(2*math.pi*y/size) 35 | return u, v 36 | 37 | def rotate_coord(x, y, size, polar_shift=None): 38 | d = abs(x - y)/math.sqrt(2) 39 | u = math.sqrt(8)*d/size - 1 40 | v = math.sqrt(2*(x*x + y*y - d*d))/size - 1 41 | return u, v 42 | 43 | def curved_rotate_coord(x, y, size, polar_shift=None): 44 | u = (x - y)/size 45 | v = math.sqrt(2*(x*x + y*y - u*u))/size - 1 46 | return u, v 47 | 48 | def polar(x, y, size, polar_shift): 49 | x -= polar_shift[0]*size 50 | y -= polar_shift[1]*size 51 | u = math.sqrt(x*x + y*y)/size 52 | v = 0 if x == 0 else math.atan(y/x)*2/math.pi 53 | return u, v 54 | 55 | def center(x, y, size, polar_shift): 56 | half = size/2 57 | if x >= half: 58 | x = size - x 59 | if y >= half: 60 | y = size - y 61 | u = 2 * x/half - 1.0 62 | v = 2 * y/half - 1.0 63 | return u, v 64 | 65 | coord_transforms = [linear_coord, tent_coord, sin_coord, polar, curved_rotate_coord, 66 | rotate_coord, center] #It's nice to find more conversions 67 | -------------------------------------------------------------------------------- /data/adjectives.txt: -------------------------------------------------------------------------------- 1 | Boiled 2 | Pleasant 3 | Terrible 4 | Repressed 5 | Pure 6 | Kinetic 7 | Soft 8 | Clear 9 | Thoughtful 10 | Nasty 11 | Anxious 12 | Vast 13 | Seated 14 | Condemned 15 | Rejected 16 | Uptight 17 | Dull 18 | Concerned 19 | Broken 20 | Nervous 21 | Dying 22 | Arrogant 23 | Thoughtless 24 | Aggressive 25 | Witty 26 | Religious 27 | Magificent 28 | Vanishing 29 | Handsome 30 | Bourgeoisie 31 | Weary 32 | Embarrassed 33 | Effective 34 | Alert 35 | Real 36 | Aesthetic 37 | Tight 38 | Black 39 | Motionless 40 | Invisible 41 | Intuitive 42 | Awful 43 | Mediterranean 44 | Wild 45 | Greener 46 | Mysterious 47 | Bathing 48 | Enthusiastic 49 | Glorious 50 | Superimposed 51 | Smoggy 52 | Speculative 53 | Quant 54 | High 55 | Lively 56 | Comfortable 57 | Clumsy 58 | Evolving 59 | Cloudy 60 | Annoying 61 | Masked 62 | Busy 63 | Degenerated 64 | Joint 65 | Demoralized 66 | Torqued 67 | Meditative 68 | Filthy 69 | Average 70 | Sleepy 71 | Roman 72 | Agreeable 73 | Depressed 74 | Blushing 75 | Muddy 76 | Unsightly 77 | Brave 78 | Mystic 79 | Zany 80 | Eager 81 | Evil 82 | Conceptual 83 | Bad 84 | Horrible 85 | Outstanding 86 | Friendly 87 | Shimmering 88 | Graceful 89 | Misty 90 | Stupid 91 | Mind-Bending 92 | Sparkling 93 | Our 94 | Delightful 95 | Perceptive 96 | Frightened 97 | Unfolding 98 | Cosmic 99 | Dead 100 | Burning 101 | Useless 102 | Complicated 103 | Healthy 104 | Bored 105 | Colorful 106 | Scary 107 | Perky 108 | Funny 109 | Tense 110 | Tough 111 | Perfect 112 | Automatic 113 | Charming 114 | Modern 115 | Thankful 116 | Expensive 117 | Powerful 118 | Lucky 119 | Incidental 120 | Gorgeous 121 | Helpless 122 | Itchy 123 | Curious 124 | Relieved 125 | Established 126 | Jolly 127 | Gifted 128 | Good 129 | Bewildered 130 | Obedient 131 | Selfish 132 | Fatal 133 | Enchanting 134 | Drab 135 | Brainy 136 | Juxtaposed 137 | Inverse 138 | Absentminded 139 | Cautious 140 | Poor 141 | Exuberant 142 | Elegant 143 | Old-fashioned 144 | Smiling 145 | Designated 146 | Foolish 147 | Victorious 148 | Framed 149 | Defiant 150 | Ugliest 151 | Ill 152 | Grumpy 153 | Manufactured 154 | Hurt 155 | Grieving 156 | Underlined 157 | Instant 158 | Preconceived 159 | Angry 160 | Mushy 161 | False 162 | Poised 163 | Silly 164 | Gleaming 165 | Calm 166 | Tired 167 | Dangerous 168 | Reflecting 169 | Strange 170 | Painted 171 | Helpful 172 | Jumping 173 | Lonely 174 | Ashamed 175 | Splendid 176 | Crippled 177 | Wrong 178 | Courageous 179 | Doubtful 180 | Sore 181 | Nice 182 | Super 183 | Remixed 184 | Worrisome 185 | Better 186 | Devious 187 | Ephemeral 188 | Open 189 | Smaller 190 | Prickly 191 | Disgusted 192 | Deaf 193 | Tasty 194 | Successful 195 | Puzzled 196 | Adorable 197 | Overwhelming 198 | Elated 199 | Cruel 200 | Alphanumeric 201 | Bright 202 | Hallucinogenic 203 | Joyous 204 | Adventurous 205 | Long 206 | Lost 207 | Determined 208 | Outrageous 209 | Plain 210 | Tame 211 | Famous 212 | Disintegrated 213 | Shy 214 | Pataphysical 215 | Pathological 216 | Kind 217 | Fine 218 | Ugly 219 | Creepy 220 | Post-Traumatic 221 | Hardly Visible 222 | Beaten 223 | Objective 224 | Fancy 225 | Disturbed 226 | Worried 227 | Glowing 228 | Confused 229 | Clean 230 | Vivacious 231 | Cooperative 232 | Linear 233 | Sacred 234 | Luminous 235 | Rotating 236 | Dizzy 237 | Suspicious 238 | Hungry 239 | Inquisitive 240 | Lovely 241 | Grotesque 242 | Impossible 243 | Innocent 244 | Silent 245 | Wandering 246 | Sinister 247 | Easy 248 | Trapped 249 | Clever 250 | Panicky 251 | Modest 252 | Faithful 253 | Precious 254 | Secret 255 | Reincarnated 256 | Shiny 257 | Trancendental 258 | Articulated 259 | Fierce 260 | Wicked 261 | Envious 262 | Troubled 263 | Obnoxious 264 | Naughty 265 | Emotional 266 | Upset 267 | Undefined 268 | Local 269 | Proud 270 | Cute 271 | Dark 272 | Superior 273 | Frantic 274 | Superficial 275 | Drunk 276 | Unusual 277 | Crazy 278 | Uplifting 279 | Amused 280 | Modular 281 | Inexpensive 282 | Pragmatic 283 | Glamorous 284 | Blue-eyed 285 | Fantastic 286 | Metaphysical 287 | Cheerful 288 | Incoherent 289 | Mechanical 290 | Complex 291 | Screaming 292 | Geometric 293 | Annoyed 294 | Explained 295 | Encouraging 296 | Bloody 297 | Energetic 298 | Gentle 299 | Transparent 300 | Restricted 301 | Hedonic 302 | Attractive 303 | Odd 304 | Homely 305 | Reclining 306 | Difficult 307 | Careful 308 | Transfigured 309 | Uninterested 310 | Commercial 311 | Fair 312 | Combative 313 | Important 314 | Unique 315 | Happy 316 | Breakable 317 | Interfering 318 | Rich 319 | Spotless 320 | Indestructible 321 | Frail 322 | Excited 323 | Fragile 324 | Crowded 325 | Homeless 326 | Talented 327 | Beautiful 328 | Jittery 329 | Lazy 330 | Darkened 331 | Three-Way 332 | Nutty 333 | Visionary 334 | Crying 335 | Deeper 336 | Wide-eyed 337 | Different 338 | Distinct 339 | Zealou 340 | Falling 341 | Alive 342 | Hilarious 343 | Jealous 344 | Rising 345 | Tremulous 346 | Light 347 | Autumnal 348 | Stormy 349 | Defeated 350 | Repulsive -------------------------------------------------------------------------------- /data/nouns.txt: -------------------------------------------------------------------------------- 1 | Dance 2 | Literature 3 | Significance 4 | Summation 5 | Path 6 | Eternity 7 | kind 8 | Journey 9 | week 10 | Altarpiece 11 | Mind 12 | Zeus 13 | Volume 14 | Greed 15 | day 16 | president 17 | fact 18 | home 19 | Child 20 | Appendix 21 | level 22 | Expression 23 | Soul 24 | time 25 | Elegance 26 | Execution 27 | Variation 28 | reason 29 | Poetry 30 | name 31 | Sunset 32 | group 33 | force 34 | Spiral 35 | Blob 36 | Object 37 | people 38 | Ellipse 39 | team 40 | Figure 41 | Abduction 42 | house 43 | Disgust 44 | Season 45 | Depth 46 | company 47 | morning 48 | Digestion 49 | War 50 | Resignation 51 | Distance 52 | Dimension 53 | Metamorphosis 54 | Orpheus 55 | Transformation 56 | Chicken 57 | Cloud 58 | Fire 59 | Incident 60 | Abstraction 61 | Hate 62 | Lair 63 | Air 64 | Structure 65 | Despair 66 | guy 67 | Venus 68 | Formation 69 | student 70 | Joke 71 | story 72 | night 73 | Zone 74 | Lover 75 | Matter 76 | Knowledge 77 | Football 78 | Dot 79 | Maelstrom 80 | way 81 | country 82 | others 83 | kid 84 | moment 85 | Conflict 86 | life 87 | Wheel 88 | system 89 | study 90 | father 91 | parent 92 | Content 93 | Continuation 94 | Nature 95 | Shape 96 | Material 97 | Machine 98 | problem 99 | Simulacrum 100 | line 101 | law 102 | Compilation 103 | Point 104 | Tube 105 | Purpose 106 | Present 107 | Face 108 | hand 109 | year 110 | Aviator 111 | woman 112 | Scarf 113 | Ego 114 | Philosophy 115 | Square 116 | Element 117 | Improvement 118 | book 119 | Investigation 120 | Cannibalism 121 | Sphere 122 | Response 123 | Insight 124 | right 125 | Shade 126 | city 127 | Painting 128 | body 129 | money 130 | education 131 | Translation 132 | Approach 133 | Victim 134 | person 135 | Song 136 | Mechanism 137 | Spoon 138 | Aphrodite 139 | Muse 140 | Logic 141 | game 142 | art 143 | job 144 | Vision 145 | history 146 | Childhood 147 | lot 148 | minute 149 | Analysis 150 | Departure 151 | Compound 152 | Idea 153 | Son 154 | Dream 155 | back 156 | Toreador 157 | Contrast 158 | Autobiography 159 | Echo 160 | program 161 | man 162 | Feeling 163 | Cut 164 | Ghost 165 | Sentiment 166 | family 167 | Substance 168 | Perception 169 | Sorrow 170 | Meditation 171 | Beginning 172 | Love 173 | Reality 174 | member 175 | Context 176 | Idealism 177 | side 178 | Pain 179 | Work 180 | Nothing 181 | door 182 | part 183 | Birth 184 | Sky 185 | area 186 | Intensity 187 | Voice 188 | Velocity 189 | Joy 190 | Process 191 | Rhubarb 192 | Movement 193 | business 194 | Biscuit 195 | Spirit 196 | Water 197 | service 198 | Surface 199 | power 200 | Experience 201 | Scar 202 | Self 203 | result 204 | Brushstroke 205 | Conclusion 206 | car 207 | office 208 | Device 209 | Concept 210 | Illumination 211 | Model 212 | View 213 | question 214 | Passenger 215 | Purity 216 | Creation 217 | Limitation 218 | Gentleman 219 | number 220 | change 221 | Plan 222 | mother 223 | Fountain 224 | research 225 | Action 226 | room 227 | word 228 | Piece 229 | Space 230 | Sister 231 | world 232 | Situation 233 | Boundry 234 | Absence 235 | Design 236 | Circumstance 237 | Desire 238 | community 239 | girl 240 | Babble 241 | Image 242 | friend 243 | state 244 | end 245 | Head 246 | Pole 247 | health 248 | month 249 | Angel 250 | Attention 251 | Rendevouz 252 | issue 253 | Deformation 254 | Future 255 | Information 256 | Component 257 | Hope 258 | Fear 259 | Exclusion 260 | school 261 | Energy 262 | place 263 | teacher 264 | Form 265 | Redhead 266 | Liquid 267 | Soup 268 | Stick 269 | Method 270 | Prediction 271 | Judas 272 | Eye 273 | Emotion 274 | Innocence 275 | Death 276 | Thing 277 | hour 278 | party 279 | Interior 280 | Peace 281 | Sequence 282 | Edge 283 | government 284 | Sadness 285 | Projection 286 | Stain 287 | case -------------------------------------------------------------------------------- /data/prepositions.txt: -------------------------------------------------------------------------------- 1 | of 2 | with 3 | at 4 | from 5 | into 6 | towards 7 | upon 8 | in 9 | for 10 | on 11 | by 12 | about 13 | like 14 | over 15 | before 16 | between 17 | after 18 | since 19 | without 20 | under 21 | within 22 | along 23 | behind 24 | beyond 25 | except 26 | above 27 | near -------------------------------------------------------------------------------- /data/pronouns.txt: -------------------------------------------------------------------------------- 1 | My 2 | Your 3 | Our 4 | Your 5 | His 6 | Her 7 | Their -------------------------------------------------------------------------------- /full_list.py: -------------------------------------------------------------------------------- 1 | 2 | from operators import (VariableX, VariableY, Random, Sum, Product, Mod, Sin, And, 3 | Tent, Well, Level, Mix, Palette, Not, RGB, Closest, White, SinCurve, AbsSin, 4 | Or, Xor, Atan, Far, Wave, Chess, Fibonacci) 5 | -------------------------------------------------------------------------------- /icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/icon.ico -------------------------------------------------------------------------------- /images/example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example1.png -------------------------------------------------------------------------------- /images/example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example2.png -------------------------------------------------------------------------------- /images/example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example3.png -------------------------------------------------------------------------------- /images/example4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example4.png -------------------------------------------------------------------------------- /images/example5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example5.png -------------------------------------------------------------------------------- /images/example6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example6.png -------------------------------------------------------------------------------- /images/example7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example7.png -------------------------------------------------------------------------------- /images/example8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example8.png -------------------------------------------------------------------------------- /images/example9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/example9.png -------------------------------------------------------------------------------- /images/gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/images/gui.png -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # Copyright (c) 2018-2019, Yaroslav Zotov, https://github.com/qiray/ 5 | # All rights reserved. 6 | 7 | # This file is part of MathArtist. 8 | 9 | # MathArtist is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | 14 | # MathArtist is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | 19 | # You should have received a copy of the GNU General Public License 20 | # along with MathArtist. If not, see . 21 | 22 | import sys 23 | import signal 24 | import argparse 25 | import time 26 | from copy import copy 27 | import webbrowser 28 | from PIL import Image, ImageDraw, ImageQt 29 | 30 | from PyQt5 import QtCore, QtGui 31 | from PyQt5.QtWidgets import (QWidget, QGridLayout, QPushButton, QApplication, 32 | QLabel, QFileDialog, QMessageBox, QTextEdit) 33 | from PyQt5.QtGui import QPixmap 34 | from PyQt5.QtCore import QThread, pyqtSignal 35 | 36 | from art import Art, APP_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD 37 | from common import SIZE 38 | 39 | class DrawThread(QThread): 40 | def __init__(self, load_file=""): 41 | self.art = Art(use_checker=True) 42 | QThread.__init__(self) 43 | 44 | def __del__(self): 45 | self.wait() 46 | 47 | def run(self): 48 | self.art.redraw() 49 | 50 | def stop(self): 51 | self.art.stop_drawing() #send signal to art object 52 | self.wait() 53 | 54 | def get_image(self): 55 | return self.art.img 56 | 57 | def set_name(self, name): 58 | self.art.set_name(name) 59 | 60 | def get_name(self): 61 | return self.art.name 62 | 63 | def reset_name(self): 64 | self.art.reset_name() 65 | 66 | def save_image(self): 67 | self.art.save_image_text() 68 | 69 | def get_status(self): 70 | return self.art.status 71 | 72 | def set_trigger(self, trigger): 73 | self.art.set_trigger(trigger) 74 | 75 | def set_file(self, filepath): 76 | self.art.set_file(filepath) 77 | 78 | class GUI(QWidget): 79 | 80 | trigger = pyqtSignal() 81 | 82 | def __init__(self): 83 | super().__init__() 84 | self.draw_thread = None 85 | self.timer = 0 86 | self.need_name_update = True 87 | self.initGUI() 88 | 89 | def keyPressEvent(self, event): #Handle keys 90 | key = event.key() 91 | # modifiers = QApplication.keyboardModifiers() #modifiers == QtCore.Qt.ControlModifier 92 | if key == QtCore.Qt.Key_Escape: 93 | print("Closing...") 94 | self.close() 95 | elif key == QtCore.Qt.Key_N or key == QtCore.Qt.Key_R: 96 | self.new_image_thread() 97 | elif key == QtCore.Qt.Key_G: 98 | self.new_image_name_thread() 99 | elif key == QtCore.Qt.Key_O: 100 | self.load_file() 101 | elif key == QtCore.Qt.Key_S: 102 | self.save_image() 103 | elif key == QtCore.Qt.Key_A: 104 | self.show_about_message() 105 | elif key == QtCore.Qt.Key_F1: 106 | self.show_online_help() 107 | event.accept() 108 | 109 | def show_about_message(self): 110 | QMessageBox.about(self, 'About', get_about_info()) 111 | 112 | def show_online_help(self): 113 | webbrowser.open('https://github.com/qiray/MathArtist') 114 | 115 | def save_image(self): 116 | if self.draw_thread: 117 | self.draw_thread.save_image() 118 | 119 | def update_GUI(self): 120 | self.image = ImageQt.ImageQt(copy(self.draw_thread.get_image())) 121 | pixmap = QPixmap.fromImage(self.image) 122 | self.image_label.setPixmap(pixmap) 123 | name = self.draw_thread.get_name() 124 | if name and self.need_name_update: 125 | self.name_label.setText(name) 126 | self.need_name_update = False 127 | self.status_label.setText(self.draw_thread.get_status()) 128 | 129 | def prepare_new_thread(self): 130 | self.need_name_update = True 131 | if time.time() - self.timer < 1: #prevent from very often image updates 132 | return 133 | self.timer = time.time() 134 | if self.draw_thread: #if thread exists 135 | self.draw_thread.stop() #send signal to art object 136 | else: #init thread 137 | self.trigger.connect(self.update_GUI) 138 | self.draw_thread = DrawThread() 139 | self.draw_thread.set_trigger(self.trigger) 140 | 141 | def new_image_thread(self): 142 | self.prepare_new_thread() 143 | self.draw_thread.reset_name() 144 | self.draw_thread.start() 145 | 146 | def new_image_name_thread(self): 147 | self.prepare_new_thread() 148 | self.draw_thread.set_name(self.name_label.toPlainText()) 149 | self.draw_thread.start() 150 | 151 | def empty_image(self): 152 | size = SIZE 153 | image = Image.new('RGBA', (size, size)) 154 | image_draw = ImageDraw.Draw(image) 155 | image_draw.rectangle(((0, 0,), (size, size)), fill="#FFFFFF") 156 | return ImageQt.ImageQt(image) 157 | 158 | def initGUI(self): 159 | grid = QGridLayout() 160 | self.setLayout(grid) 161 | #IMPORTANT: this image must exist all application lifetime: 162 | self.image = self.empty_image() 163 | pixmap = QPixmap.fromImage(self.image) 164 | self.image_label = QLabel() 165 | self.image_label.setPixmap(pixmap) 166 | grid.addWidget(self.image_label, 0, 0, 1, 2) 167 | 168 | new_button = QPushButton('Random image') 169 | new_button.clicked.connect(self.new_image_thread) 170 | grid.addWidget(new_button, 2, 0) 171 | new_button2 = QPushButton('Generate image') 172 | new_button2.clicked.connect(self.new_image_name_thread) 173 | grid.addWidget(new_button2, 2, 1) 174 | save_button = QPushButton('Save image') 175 | save_button.clicked.connect(self.save_image) 176 | grid.addWidget(save_button, 3, 0) 177 | load_button = QPushButton('Load image') 178 | load_button.clicked.connect(self.load_file) 179 | grid.addWidget(load_button, 3, 1) 180 | self.status_label = QLabel('') 181 | self.status_label.setAlignment(QtCore.Qt.AlignCenter) 182 | grid.addWidget(self.status_label, 4, 0, 1, 2) 183 | 184 | self.name_label = QTextEdit('') 185 | self.name_label.setMaximumHeight(self.status_label.sizeHint().height()*3) 186 | grid.addWidget(self.name_label, 1, 0, 1, 2) 187 | 188 | self.setWindowTitle('Math Artist') 189 | self.setWindowIcon(QtGui.QIcon('icon.ico')) 190 | self.show() 191 | self.new_image_thread() 192 | 193 | def load_file(self): 194 | filepath, _ = QFileDialog.getOpenFileName(self,"QFileDialog.getOpenFileName()", "","Text Files (*.txt)") 195 | if time.time() - self.timer < 1: #prevent from very often image updates 196 | time.sleep(0.5) 197 | self.timer = time.time() 198 | if not filepath: 199 | return 200 | if self.draw_thread: 201 | self.draw_thread.stop() 202 | self.draw_thread.set_trigger(self.trigger) 203 | self.draw_thread.set_file(filepath) 204 | self.draw_thread.start() 205 | 206 | def sigint_handler(sig, frame): 207 | print("Closing...") 208 | sys.exit(0) 209 | 210 | def parse_args(): 211 | """argparse settings""" 212 | parser = argparse.ArgumentParser(prog=APP_NAME, 213 | description='Tool for generating pictures using mathematical formulas.') 214 | parser.add_argument('--console', action='store_true', help='Run in console mode (no window)') 215 | parser.add_argument('--name', type=str, help='Set image name') 216 | parser.add_argument('--about', action='store_true', help='Show about info') 217 | parser.add_argument('--file', type=str, help='Load file') 218 | parser.add_argument('--generate_list', action='store_true', help='Generate operators\' list (developer option)') 219 | return parser.parse_args() 220 | 221 | def get_new_list(): 222 | from operator_lists import generate_lists 223 | terminals, nonterminals = generate_lists() 224 | fulllist = terminals + nonterminals 225 | result = str([x.__name__ for x in fulllist]) 226 | result = result.replace("'", "") 227 | result = result.replace("[", "(") 228 | result = result.replace("]", ")") 229 | return result 230 | 231 | def get_version(): 232 | return "%d.%d.%d" % (VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD) 233 | 234 | def get_about_info(): 235 | return ("\n" + APP_NAME + " " + get_version() + " Copyright (C) 2018-2019 Yaroslav Zotov.\n" + 236 | "Based on \"randomart\" Copyright (C) 2010, Andrej Bauer.\n" 237 | "This program comes with ABSOLUTELY NO WARRANTY.\n" + 238 | "This is free software under GNU GPL3; see the source for copying conditions\n") 239 | 240 | if __name__ == '__main__': 241 | signal.signal(signal.SIGINT, sigint_handler) 242 | args = parse_args() #parse command line arguments 243 | if args.about: 244 | print(get_about_info()) 245 | exit(0) 246 | if args.console: 247 | if args.generate_list: 248 | print(get_new_list()) 249 | exit(0) 250 | art = Art(use_checker=True, name=args.name, console=True, load_file=args.file) 251 | else: 252 | app = QApplication(sys.argv) 253 | window = GUI() 254 | sys.exit(app.exec_()) 255 | -------------------------------------------------------------------------------- /names_generator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # Copyright (c) 2018, Yaroslav Zotov, https:github.com/qiray/ 4 | # All rights reserved. 5 | 6 | # This file is part of MathArtist. 7 | 8 | # MathArtist is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | 13 | # MathArtist is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | 18 | # You should have received a copy of the GNU General Public License 19 | # along with MathArtist. If not, see . 20 | 21 | # Text data from 22 | # https://www.espressoenglish.net/100-common-nouns-in-english/ 23 | # https://grammar.yourdictionary.com/parts-of-speech/adjectives/list-of-adjective-words.html 24 | # https://www.talkenglish.com/vocabulary/top-50-prepositions.aspx 25 | # http://ironigardinen.net/generatorer/art2/index.html 26 | 27 | # Some ideas from http://ironigardinen.net/generatorer/art2/index.html 28 | 29 | import os 30 | import random 31 | 32 | from common import get_app_path 33 | 34 | def file_to_list(path): 35 | lines = [] 36 | with open(os.path.join(get_app_path(), path)) as f: 37 | lines = f.read().splitlines() 38 | return lines 39 | 40 | nouns = file_to_list("data/nouns.txt") 41 | adjectives = file_to_list("data/adjectives.txt") 42 | pronouns = file_to_list("data/pronouns.txt") 43 | prepositions = file_to_list("data/prepositions.txt") 44 | 45 | def adj_or_pronoun(): 46 | return random.choice(adjectives) if random.random() > 0.5 else random.choice(pronouns) 47 | 48 | def two_words(): 49 | word = adj_or_pronoun() 50 | return "%s %s" % ( 51 | word, 52 | random.choice(nouns)) 53 | 54 | def pronoun_adj_noun(): 55 | return "%s %s %s" % ( 56 | random.choice(pronouns), 57 | random.choice(adjectives), 58 | random.choice(nouns)) 59 | 60 | def noun_prep_noun(): 61 | return "%s %s %s" % ( 62 | random.choice(nouns), 63 | random.choice(prepositions), 64 | random.choice(nouns)) 65 | 66 | def noun_prep_adj_noun(): 67 | return "%s %s %s %s" % ( 68 | random.choice(nouns), 69 | random.choice(prepositions), 70 | random.choice(adjectives), 71 | random.choice(nouns)) 72 | 73 | def desc_noun_noun(): 74 | word = adj_or_pronoun() 75 | return "%s %s %s" % ( 76 | word, 77 | random.choice(nouns), 78 | random.choice(nouns)) 79 | 80 | def five_words(): 81 | word1 = adj_or_pronoun() 82 | word2 = adj_or_pronoun() 83 | return "%s %s %s %s %s" % ( 84 | word1, 85 | random.choice(nouns), 86 | random.choice(prepositions), 87 | word2, 88 | random.choice(nouns)) 89 | 90 | def word_chain(): 91 | length = random.randint(1, 2) 92 | result = five_words() 93 | for _ in range(length): 94 | word = adj_or_pronoun() 95 | result += " %s %s %s" % ( 96 | random.choice(prepositions), 97 | word, 98 | random.choice(nouns)) 99 | return result 100 | 101 | generators = [two_words, pronoun_adj_noun, noun_prep_noun, noun_prep_adj_noun, 102 | desc_noun_noun, five_words, word_chain] 103 | 104 | def generate_name(): 105 | result = random.choice(generators)() 106 | result = result.lower().capitalize() 107 | return result 108 | -------------------------------------------------------------------------------- /operator_lists.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2018, Yaroslav Zotov, https://github.com/qiray/ 3 | # All rights reserved. 4 | 5 | # This file is part of MathArtist. 6 | 7 | # MathArtist is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | 12 | # MathArtist is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | 17 | # You should have received a copy of the GNU General Public License 18 | # along with MathArtist. If not, see . 19 | 20 | import random 21 | import math 22 | 23 | from common import SIZE 24 | from coords import (coord_transforms, linear_coord, tent_coord, sin_coord, polar, 25 | curved_rotate_coord, rotate_coord, center) 26 | from full_list import * 27 | 28 | # The following lists of classes that are used for generation of expressions is 29 | # used by the generate function below. Each list should contain at least one 30 | # terminal and nonterminal class. 31 | 32 | fulllist = (VariableX, VariableY, Random, Sum, Product, Mod, Sin, Tent, AbsSin, 33 | Well, Level, Mix, Palette, Not, RGB, Closest, White, SinCurve, And, Or, 34 | Atan, Xor, Far, Wave, Chess, Fibonacci) 35 | 36 | operatorsLists = [ 37 | fulllist, 38 | 39 | (VariableX, VariableY, Random, Sum, Product, Mod, Sin, Tent, Well, Level, Mix), 40 | (VariableX, VariableY, Random, Sum, Product, Mod, Sin, Tent, Well, Level, Mix, Palette), 41 | (VariableX, VariableY, Mix, Well), #minimalism 42 | (VariableX, VariableY, Random, Mix, Well), 43 | (VariableX, VariableY, Palette, Mix, Well), 44 | (VariableX, VariableY, Palette, Mix, Well, Tent), 45 | (VariableX, VariableY, Palette, Mix, Well, Tent, SinCurve), #nice curves 46 | (VariableX, VariableY, Palette, Sin, SinCurve, Mix), #multiple colors 47 | (VariableX, VariableY, White, Palette, Random, RGB), #colors only 48 | 49 | (VariableX, VariableY, Palette, AbsSin, Sin, Mix), 50 | (VariableX, VariableY, Palette, Mix, Well, Tent, SinCurve, AbsSin), 51 | (VariableX, VariableY, Palette, And, Or, Xor), #squares 52 | (VariableX, VariableY, Random, Palette, Mix, Well, Sin, SinCurve, Tent, AbsSin), 53 | (VariableX, VariableY, White, Palette, Random, AbsSin, Mix, Level, RGB, Sum, Mod), #sometimes dark 54 | (VariableX, VariableY, White, Palette, Random, AbsSin, Mix, Level, RGB, Product, 55 | Sum, Mod, Well, Tent), 56 | (VariableX, VariableY, White, Palette, Random, RGB, Sin, SinCurve, Atan, Mix, Closest), 57 | (VariableX, VariableY, White, Palette, Random, RGB, Far, Closest, Mix, Well), 58 | (VariableX, VariableY, White, Palette, Random, RGB, Far, Closest, Mix, Well, Wave), #Strange colored spots 59 | (VariableX, VariableY, Palette, Sin, SinCurve, Mix, Wave), 60 | (VariableX, VariableY, Palette, Sin, SinCurve, Atan, Wave), #not impressive 61 | (VariableX, VariableY, Mix, Well, Not, Palette), 62 | (VariableX, VariableY, Palette, Random, Mix, Well, Tent, Chess), 63 | (VariableX, VariableY, Palette, Random, Mix, Well, Tent, SinCurve), 64 | (VariableX, VariableY, Palette, Random, Mix, SinCurve, Sin, AbsSin, Atan), 65 | (VariableX, VariableY, Fibonacci, Mix), 66 | (VariableX, VariableY, Fibonacci, Mix, Well), 67 | (VariableX, VariableY, Random, Sum, Fibonacci, Sin, Tent, Well, Level, Mix, Palette), 68 | (VariableX, VariableY, Palette, Fibonacci, Mix, Well, Tent, SinCurve), 69 | (VariableX, VariableY, White, Palette, Random, Palette, Sin, SinCurve, Mix, Fibonacci), 70 | 71 | # these lists were made by this program 72 | (White, Palette, Random, VariableX, VariableY, Far, Well, Sin, AbsSin, Product), 73 | (Random, White, VariableY, VariableX, Palette, SinCurve, Level, Atan, Not, Far, Wave, Or, Xor), 74 | (Palette, Random, VariableY, White, VariableX, Well, Mix, Sin, Sum, Not, Tent, Level, Far, And), 75 | (VariableY, VariableX, Random, Product, SinCurve, Mod, Closest, Tent, Well, Sum, RGB, Atan, Xor, 76 | Not, And, Wave, Mix, Level, AbsSin), 77 | (VariableX, VariableY, SinCurve, AbsSin, Sum, Level), 78 | (Random, Palette, VariableY, VariableX, And, Sum, Mod), 79 | (Palette, VariableX, Random, White, VariableY, Atan, Xor, Closest, Mix, Product, RGB, Not, Well), 80 | (Chess, White, RGB, Xor, Far, Well, And, Level, Wave, SinCurve, Mod, Atan), 81 | (Random, Chess, White, Level, Mix, Closest, Xor, Tent, Sin, Wave, Product, Or, Sum, Well, Mod, 82 | Far, Not), 83 | (White, Random, VariableY, Palette, Xor, Far, Sin, Not, Mod, And, Atan, Sum, Wave, Level, Well), 84 | (Random, Palette, VariableY, VariableX, Not, Sin, AbsSin, Product, Far, Or, Atan, Tent, Mod, Xor, 85 | Wave, Sum), 86 | (VariableX, VariableY, White, Mod, Product, Atan, RGB, Mix, SinCurve, Xor, And, Level, Sin, 87 | AbsSin, Well, Tent), 88 | ] 89 | 90 | def generate_lists(): 91 | '''Function for generating operators lists''' 92 | terminals = [op for op in fulllist if op.arity == 0] 93 | nonterminals = [op for op in fulllist if op.arity > 0] 94 | 95 | length = random.randint(0, len(terminals) - 1) #There should be at least one element 96 | random.shuffle(terminals) 97 | terminals = terminals[length:] #Get a part of a list 98 | 99 | length = random.randint(0, len(nonterminals) - 1) 100 | random.shuffle(nonterminals) 101 | nonterminals = nonterminals[length:] #Get a part of a list 102 | 103 | return terminals, nonterminals 104 | -------------------------------------------------------------------------------- /operators.pyx: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2018, Yaroslav Zotov, https://github.com/qiray/ 3 | # All rights reserved. 4 | 5 | # This file is part of MathArtist. 6 | 7 | # MathArtist is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | 12 | # MathArtist is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | 17 | # You should have received a copy of the GNU General Public License 18 | # along with MathArtist. If not, see . 19 | 20 | ################################################################################ 21 | 22 | # This file uses code from Andrej Bauer's randomart project under 23 | # following conditions: 24 | 25 | # Copyright (c) 2010, Andrej Bauer, http://andrej.com/ 26 | # All rights reserved. 27 | # 28 | # Redistribution and use in source and binary forms, with or without 29 | # modification, are permitted provided that the following conditions are met: 30 | # 31 | # * Redistributions of source code must retain the above copyright notice, 32 | # this list of conditions and the following disclaimer. 33 | # 34 | # * Redistributions in binary form must reproduce the above copyright 35 | # notice, this list of conditions and the following disclaimer in the 36 | # documentation and/or other materials provided with the distribution. 37 | # 38 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 39 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 40 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 41 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 42 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 43 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 44 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 45 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 46 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 47 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 48 | 49 | # cython: language_level=3 50 | 51 | import random 52 | import math 53 | 54 | cimport libc.math as cmath 55 | 56 | from common import (average, well, tent, parse_color, sin_curve, abs_sin, 57 | color_binary, wave) 58 | from palettes import palettes 59 | 60 | # We next define classes that represent expression trees. 61 | 62 | # Each object that reprents and expression should have an eval(self, x, y) method 63 | # which computes the value of the expression at (x, y). The __init__ should 64 | # accept the objects representing its subexpressions. The class definition 65 | # should contain the arity attribute which tells how many subexpressions should 66 | # be passed to the __init__ constructor. Classes with arity == 0 are called 67 | # terminals, the others are called nonterminals.The __repr__ method is used to 68 | # print each object as a string. The mindepth attribute shows depth of 69 | # expression tree where it is allowed to use this object. 70 | 71 | # Some operators are adopted from https://github.com/vshymanskyy/randomart 72 | 73 | # Terminals: 74 | 75 | class VariableX(): 76 | arity = 0 77 | mindepth = 4 78 | def __init__(self): 79 | pass 80 | def __repr__(self): 81 | return "x" 82 | def eval(self, x, y): 83 | return (x, x, x) 84 | 85 | class VariableY(): 86 | arity = 0 87 | mindepth = 4 88 | def __init__(self): 89 | pass 90 | def __repr__(self): 91 | return "y" 92 | def eval(self, x, y): 93 | return (y, y, y) 94 | 95 | class Random(): 96 | arity = 0 97 | mindepth = 4 98 | def __init__(self, r = None, g = None, b = None): 99 | if r and g and b: #for parsing 100 | self.c = (r, g, b) 101 | return 102 | self.c = (random.uniform(0, 1), random.uniform(0, 1), random.uniform(0, 1)) 103 | def __repr__(self): 104 | return 'Random(%g,%g,%g)' % self.c 105 | def eval(self, x, y): 106 | return self.c 107 | 108 | class Palette(): 109 | arity = 0 110 | mindepth = 3 111 | palette = palettes[0] 112 | paletteIndex = 0 113 | def __init__(self, r = None, g = None, b = None): 114 | if r and g and b: #for parsing 115 | self.c = (r, g, b) 116 | return 117 | self.hex = Palette.palette[Palette.paletteIndex] 118 | Palette.paletteIndex += 1 119 | if Palette.paletteIndex >= len(Palette.palette): 120 | Palette.paletteIndex = 0 121 | self.c = tuple([x/128.0 - 1.0 for x in parse_color(self.hex)]) 122 | def __repr__(self): 123 | return "Palette(%g, %g, %g)" % self.c 124 | def eval(self, x, y): 125 | return self.c 126 | 127 | @staticmethod 128 | def randomPalette(): #set random palette 129 | Palette.palette = random.choice(palettes) 130 | Palette.paletteIndex = 0 131 | 132 | class White(): 133 | arity = 0 134 | mindepth = 4 135 | def __init__(self, r = None, g = None, b = None): #unused arguments for parsing 136 | self.c = (1, 1, 1) 137 | def __repr__(self): 138 | return 'White(%g, %g, %g)' % self.c 139 | def eval(self, x, y): 140 | return self.c 141 | 142 | class Chess(): 143 | arity = 0 144 | mindepth = 5 145 | def __init__(self, wX=None, wY=None): 146 | if wX and wY: #for parsing 147 | self.wX = wX 148 | self.wY = wY 149 | return 150 | self.wX = random.uniform(0.1, 1.0) 151 | self.wY = random.uniform(0.1, 1.0) 152 | def __repr__(self): 153 | return "Chess(%g, %g)" % (self.wX, self.wY) 154 | def eval(self, x, y): 155 | isOdd = False 156 | isOdd ^= int(cmath.floor(x/self.wX)) & 1 157 | isOdd ^= int(cmath.floor(y/self.wY)) & 1 158 | return (-1, -1, -1) if isOdd else (1, 1, 1) 159 | 160 | class Fibonacci(): 161 | arity = 0 162 | mindepth = 3 163 | fib_array = [0, 1] 164 | def __init__(self): 165 | pass 166 | def __repr__(self): 167 | return "Fibonacci()" 168 | def eval(self, x, y): 169 | result = (self.fibonacci(len(Fibonacci.fib_array) + 1)%255)/255 - 128 170 | return (result, result, result) 171 | def fibonacci(self, n): 172 | if n < 0: 173 | return Fibonacci.fib_array[0] 174 | elif n < len(Fibonacci.fib_array): 175 | return Fibonacci.fib_array[n] 176 | else: 177 | max_limit = 200 if n > 200 else n + 1 178 | for i in range(len(Fibonacci.fib_array), max_limit): 179 | Fibonacci.fib_array.append(Fibonacci.fib_array[i - 1] + Fibonacci.fib_array[i - 2]) 180 | return Fibonacci.fib_array[max_limit - 1] 181 | 182 | # Nonterminals: 183 | 184 | class Well(): 185 | arity = 1 186 | mindepth = 3 187 | def __init__(self, e): 188 | self.e = e 189 | self.e_func = self.e.eval 190 | def __repr__(self): 191 | return 'Well(%s)' % self.e 192 | def eval(self, x, y): 193 | (r, g, b) = self.e_func(x, y) 194 | return (well(r), well(g), well(b)) 195 | 196 | class Tent(): 197 | arity = 1 198 | mindepth = 3 199 | def __init__(self, e): 200 | self.e = e 201 | self.e_func = self.e.eval 202 | def __repr__(self): 203 | return 'Tent(%s)' % self.e 204 | def eval(self, x, y): 205 | (r, g, b) = self.e_func(x, y) 206 | return (tent(r), tent(g), tent(b)) 207 | 208 | class Sin(): 209 | arity = 1 210 | mindepth = 0 211 | def __init__(self, e, phase = None, freq = None): 212 | self.e = e 213 | self.e_func = self.e.eval 214 | if phase and freq: #for parsing 215 | self.phase = phase 216 | self.freq = freq 217 | return 218 | self.phase = random.uniform(0, math.pi) 219 | self.freq = random.uniform(1.0, 6.0) 220 | def __repr__(self): 221 | return 'Sin(%s, %g, %g)' % (self.e, self.phase, self.freq) 222 | def eval(self, x, y): 223 | (r1, g1, b1) = self.e_func(x, y) 224 | r2 = cmath.sin(self.phase + self.freq * r1) 225 | g2 = cmath.sin(self.phase + self.freq * g1) 226 | b2 = cmath.sin(self.phase + self.freq * b1) 227 | return (r2, g2, b2) 228 | 229 | class Not(): 230 | arity = 1 231 | mindepth = 3 232 | def __init__(self, e): 233 | self.e = e 234 | self.e_func = self.e.eval 235 | def __repr__(self): 236 | return "Not(%s)" % self.e 237 | def eval(self, x, y): 238 | (r, g, b) = self.e_func(x, y) 239 | return (-r, -g, -b) 240 | 241 | class SinCurve(): 242 | arity = 1 243 | mindepth = 0 244 | def __init__(self, e): 245 | self.e = e 246 | self.e_func = self.e.eval 247 | def __repr__(self): 248 | return 'SinCurve(%s)' % self.e 249 | def eval(self, x, y): 250 | (r, g, b) = self.e_func(x, y) 251 | return (sin_curve(r), sin_curve(g), sin_curve(b)) 252 | 253 | class AbsSin(): 254 | arity = 1 255 | mindepth = 3 256 | def __init__(self, e): 257 | self.e = e 258 | self.e_func = self.e.eval 259 | def __repr__(self): 260 | return 'AbsSin(%s)' % self.e 261 | def eval(self, x, y): 262 | (r, g, b) = self.e_func(x, y) 263 | return (abs_sin(r), abs_sin(g), abs_sin(b)) 264 | 265 | class Atan(): 266 | arity = 1 267 | mindepth = 0 268 | def __init__(self, e): 269 | self.e = e 270 | self.e_func = self.e.eval 271 | def __repr__(self): 272 | return 'Atan(%s)' % (self.e) 273 | def eval(self, x, y): 274 | (r, g, b) = self.e_func(x, y) 275 | return (cmath.atan(r)*2/cmath.pi, cmath.atan(g)*2/cmath.pi, cmath.atan(b)*2/cmath.pi) 276 | 277 | class Sum(): 278 | arity = 2 279 | mindepth = 2 280 | def __init__(self, e1, e2): 281 | self.e1 = e1 282 | self.e2 = e2 283 | def __repr__(self): 284 | return 'Sum(%s, %s)' % (self.e1, self.e2) 285 | def eval(self, x, y): 286 | return average(self.e1.eval(x, y), self.e2.eval(x, y)) 287 | 288 | class Product(): 289 | arity = 2 290 | mindepth = 2 291 | def __init__(self, e1, e2): 292 | self.e1 = e1 293 | self.e2 = e2 294 | def __repr__(self): 295 | return 'Product(%s, %s)' % (self.e1, self.e2) 296 | def eval(self, x, y): 297 | (r1, g1, b1) = self.e1.eval(x, y) 298 | (r2, g2, b2) = self.e2.eval(x, y) 299 | r3 = r1 * r2 300 | g3 = g1 * g2 301 | b3 = b1 * b2 302 | return (r3, g3, b3) 303 | 304 | class Mod(): 305 | arity = 2 306 | mindepth = 3 307 | def __init__(self, e1, e2): 308 | self.e1 = e1 309 | self.e2 = e2 310 | def __repr__(self): 311 | return 'Mod(%s, %s)' % (self.e1, self.e2) 312 | def eval(self, x, y): 313 | (r1, g1, b1) = self.e1.eval(x, y) 314 | (r2, g2, b2) = self.e2.eval(x, y) 315 | try: 316 | r3 = r1 % r2 317 | g3 = g1 % g2 318 | b3 = b1 % b2 319 | return (r3, g3, b3) 320 | except: 321 | return (0, 0, 0) 322 | 323 | class And(): 324 | arity = 2 325 | mindepth = 0 326 | def __init__(self, e1, e2): 327 | self.e1 = e1 328 | self.e2 = e2 329 | def __repr__(self): 330 | return 'And(%s, %s)' % (self.e1, self.e2) 331 | def eval(self, x, y): 332 | return color_binary(self.e1.eval(x, y), self.e2.eval(x, y), lambda x1,x2 : x1 & x2) 333 | 334 | class Or(): 335 | arity = 2 336 | mindepth = 0 337 | def __init__(self, e1, e2): 338 | self.e1 = e1 339 | self.e2 = e2 340 | def __repr__(self): 341 | return 'Or(%s, %s)' % (self.e1, self.e2) 342 | def eval(self, x, y): 343 | return color_binary(self.e1.eval(x, y), self.e2.eval(x, y), lambda x1,x2 : x1 | x2) 344 | 345 | class Xor(): 346 | arity = 2 347 | mindepth = 0 348 | def __init__(self, e1, e2): 349 | self.e1 = e1 350 | self.e2 = e2 351 | def __repr__(self): 352 | return 'Xor(%s, %s)' % (self.e1, self.e2) 353 | def eval(self, x, y): 354 | return color_binary(self.e1.eval(x, y), self.e2.eval(x, y), lambda x1,x2 : x1 ^ x2) 355 | 356 | class Wave(): 357 | arity = 2 358 | mindepth = 0 359 | def __init__(self, e1, e2): 360 | self.e1 = e1 361 | self.e2 = e2 362 | def __repr__(self): 363 | return 'Wave(%s, %s)' % (self.e1, self.e2) 364 | def eval(self, x, y): 365 | (r1, g1, b1) = self.e1.eval(x, y) 366 | (r2, g2, b2) = self.e2.eval(x, y) 367 | return (wave(r1, r2), wave(g1, g2), wave(b1, b2)) 368 | 369 | class Level(): 370 | arity = 3 371 | mindepth = 0 372 | def __init__(self, level, e1, e2, treshold = None): 373 | self.treshold = treshold if treshold else random.uniform(-1.0, 1.0) #for parsing 374 | self.level = level 375 | self.e1 = e1 376 | self.e2 = e2 377 | def __repr__(self): 378 | return 'Level(%s, %s, %s, %g)' % (self.level, self.e1, self.e2, self.treshold) 379 | def eval(self, x, y): 380 | (r1, g1, b1) = self.level.eval(x, y) 381 | (r2, g2, b2) = self.e1.eval(x, y) 382 | (r3, g3, b3) = self.e2.eval(x, y) 383 | r4 = r2 if r1 < self.treshold else r3 384 | g4 = g2 if g1 < self.treshold else g3 385 | b4 = b2 if b1 < self.treshold else b3 386 | return (r4, g4, b4) 387 | 388 | class Mix(): 389 | arity = 3 390 | mindepth = 0 391 | def __init__(self, w, e1, e2): 392 | self.w = w 393 | self.e1 = e1 394 | self.e2 = e2 395 | self.w_func = self.w.eval 396 | self.e1_func = self.e1.eval 397 | self.e2_func = self.e2.eval 398 | def __repr__(self): 399 | return 'Mix(%s, %s, %s)' % (self.w, self.e1, self.e2) 400 | def eval(self, x, y): 401 | w = 0.5 * (self.w_func(x, y)[0] + 1.0) 402 | c1 = self.e1_func(x, y) 403 | c2 = self.e2_func(x, y) 404 | return average(c1, c2, w) 405 | 406 | class RGB(): 407 | arity = 3 408 | mindepth = 4 409 | def __init__(self, e1, e2, e3): 410 | self.e1 = e1 411 | self.e2 = e2 412 | self.e3 = e3 413 | self.e1_func = self.e1.eval 414 | self.e2_func = self.e2.eval 415 | self.e3_func = self.e3.eval 416 | def __repr__(self): 417 | return 'RGB(%s, %s, %s)' % (self.e1, self.e2, self.e3) 418 | def eval(self, x, y): 419 | (r, _, _) = self.e1_func(x, y) 420 | (_, g, _) = self.e2_func(x, y) 421 | (_, _, b) = self.e3_func(x, y) 422 | return (r, g, b) 423 | 424 | class Closest(): 425 | arity = 3 426 | mindepth = 3 427 | def __init__(self, target, e1, e2): 428 | self.target = target 429 | self.e1 = e1 430 | self.e2 = e2 431 | self.target_func = self.target.eval 432 | self.e1_func = self.e1.eval 433 | self.e2_func = self.e2.eval 434 | def __repr__(self): 435 | return 'Closest(%s, %s, %s)' % (self.target, self.e1, self.e2) 436 | def eval(self, x, y): 437 | (r1, g1, b1) = self.target_func(x, y) 438 | (r2, g2, b2) = self.e1_func(x, y) 439 | (r3, g3, b3) = self.e2_func(x, y) 440 | #distances between colors: 441 | d1 = math.sqrt((r2-r1)**2+(g2-g1)**2+(b2-b1)**2) 442 | d2 = math.sqrt((r3-r1)**2+(g3-g1)**2+(b3-b1)**2) 443 | 444 | return (r2, g2, b2) if d1 < d2 else (r3, g3, b3) 445 | 446 | class Far(): 447 | arity = 3 448 | mindepth = 3 449 | def __init__(self, target, e1, e2): 450 | self.target = target 451 | self.e1 = e1 452 | self.e2 = e2 453 | self.target_func = self.target.eval 454 | self.e1_func = self.e1.eval 455 | self.e2_func = self.e2.eval 456 | def __repr__(self): 457 | return 'Far(%s, %s, %s)' % (self.target, self.e1, self.e2) 458 | def eval(self, x, y): 459 | (r1, g1, b1) = self.target_func(x, y) 460 | (r2, g2, b2) = self.e1_func(x, y) 461 | (r3, g3, b3) = self.e2_func(x, y) 462 | #distances between colors: 463 | d1 = math.sqrt((r2-r1)**2+(g2-g1)**2+(b2-b1)**2) 464 | d2 = math.sqrt((r3-r1)**2+(g3-g1)**2+(b3-b1)**2) 465 | 466 | return (r2, g2, b2) if d1 > d2 else (r3, g3, b3) 467 | -------------------------------------------------------------------------------- /output/.donotremove: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiray/MathArtist/40820ba318e3134522bc37a88c9fda5f5a0386bf/output/.donotremove -------------------------------------------------------------------------------- /palettes.py: -------------------------------------------------------------------------------- 1 | 2 | #palettes from https://github.com/mattdesl/color-wander/blob/master/lib/color-palettes.json 3 | 4 | palettes = [ 5 | ["#69D2E7","#A7DBD8","#E0E4CC","#F38630","#FA6900"], 6 | ["#FE4365","#FC9D9A","#F9CDAD","#C8C8A9","#83AF9B"], 7 | ["#ECD078","#D95B43","#C02942","#542437","#53777A"], 8 | ["#556270","#4ECDC4","#C7F464","#FF6B6B","#C44D58"], 9 | ["#774F38","#E08E79","#F1D4AF","#ECE5CE","#C5E0DC"], 10 | ["#E8DDCB","#CDB380","#036564","#033649","#031634"], 11 | ["#490A3D","#BD1550","#E97F02","#F8CA00","#8A9B0F"], 12 | ["#594F4F","#547980","#45ADA8","#9DE0AD","#E5FCC2"], 13 | ["#00A0B0","#6A4A3C","#CC333F","#EB6841","#EDC951"], 14 | ["#E94E77","#D68189","#C6A49A","#C6E5D9","#F4EAD5"], 15 | ["#D9CEB2","#948C75","#D5DED9","#7A6A53","#99B2B7"], 16 | ["#FFFFFF","#CBE86B","#F2E9E1","#1C140D","#CBE86B"], 17 | ["#EFFFCD","#DCE9BE","#555152","#2E2633","#99173C"], 18 | ["#3FB8AF","#7FC7AF","#DAD8A7","#FF9E9D","#FF3D7F"], 19 | ["#343838","#005F6B","#008C9E","#00B4CC","#00DFFC"], 20 | ["#413E4A","#73626E","#B38184","#F0B49E","#F7E4BE"], 21 | ["#99B898","#FECEA8","#FF847C","#E84A5F","#2A363B"], 22 | ["#FF4E50","#FC913A","#F9D423","#EDE574","#E1F5C4"], 23 | ["#554236","#F77825","#D3CE3D","#F1EFA5","#60B99A"], 24 | ["#351330","#424254","#64908A","#E8CAA4","#CC2A41"], 25 | ["#00A8C6","#40C0CB","#F9F2E7","#AEE239","#8FBE00"], 26 | ["#FF4242","#F4FAD2","#D4EE5E","#E1EDB9","#F0F2EB"], 27 | ["#655643","#80BCA3","#F6F7BD","#E6AC27","#BF4D28"], 28 | ["#8C2318","#5E8C6A","#88A65E","#BFB35A","#F2C45A"], 29 | ["#FAD089","#FF9C5B","#F5634A","#ED303C","#3B8183"], 30 | ["#BCBDAC","#CFBE27","#F27435","#F02475","#3B2D38"], 31 | ["#D1E751","#FFFFFF","#000000","#4DBCE9","#26ADE4"], 32 | ["#FF9900","#424242","#E9E9E9","#BCBCBC","#3299BB"], 33 | ["#5D4157","#838689","#A8CABA","#CAD7B2","#EBE3AA"], 34 | ["#5E412F","#FCEBB6","#78C0A8","#F07818","#F0A830"], 35 | ["#EEE6AB","#C5BC8E","#696758","#45484B","#36393B"], 36 | ["#1B676B","#519548","#88C425","#BEF202","#EAFDE6"], 37 | ["#F8B195","#F67280","#C06C84","#6C5B7B","#355C7D"], 38 | ["#452632","#91204D","#E4844A","#E8BF56","#E2F7CE"], 39 | ["#F04155","#FF823A","#F2F26F","#FFF7BD","#95CFB7"], 40 | ["#F0D8A8","#3D1C00","#86B8B1","#F2D694","#FA2A00"], 41 | ["#2A044A","#0B2E59","#0D6759","#7AB317","#A0C55F"], 42 | ["#67917A","#170409","#B8AF03","#CCBF82","#E33258"], 43 | ["#B9D7D9","#668284","#2A2829","#493736","#7B3B3B"], 44 | ["#BBBB88","#CCC68D","#EEDD99","#EEC290","#EEAA88"], 45 | ["#A3A948","#EDB92E","#F85931","#CE1836","#009989"], 46 | ["#E8D5B7","#0E2430","#FC3A51","#F5B349","#E8D5B9"], 47 | ["#B3CC57","#ECF081","#FFBE40","#EF746F","#AB3E5B"], 48 | ["#AB526B","#BCA297","#C5CEAE","#F0E2A4","#F4EBC3"], 49 | ["#607848","#789048","#C0D860","#F0F0D8","#604848"], 50 | ["#515151","#FFFFFF","#00B4FF","#EEEEEE"], 51 | ["#3E4147","#FFFEDF","#DFBA69","#5A2E2E","#2A2C31"], 52 | ["#300030","#480048","#601848","#C04848","#F07241"], 53 | ["#1C2130","#028F76","#B3E099","#FFEAAD","#D14334"], 54 | ["#A8E6CE","#DCEDC2","#FFD3B5","#FFAAA6","#FF8C94"], 55 | ["#EDEBE6","#D6E1C7","#94C7B6","#403B33","#D3643B"], 56 | ["#FDF1CC","#C6D6B8","#987F69","#E3AD40","#FCD036"], 57 | ["#AAB3AB","#C4CBB7","#EBEFC9","#EEE0B7","#E8CAAF"], 58 | ["#CC0C39","#E6781E","#C8CF02","#F8FCC1","#1693A7"], 59 | ["#3A111C","#574951","#83988E","#BCDEA5","#E6F9BC"], 60 | ["#FC354C","#29221F","#13747D","#0ABFBC","#FCF7C5"], 61 | ["#B9D3B0","#81BDA4","#B28774","#F88F79","#F6AA93"], 62 | ["#5E3929","#CD8C52","#B7D1A3","#DEE8BE","#FCF7D3"], 63 | ["#230F2B","#F21D41","#EBEBBC","#BCE3C5","#82B3AE"], 64 | ["#5C323E","#A82743","#E15E32","#C0D23E","#E5F04C"], 65 | ["#4E395D","#827085","#8EBE94","#CCFC8E","#DC5B3E"], 66 | ["#DAD6CA","#1BB0CE","#4F8699","#6A5E72","#563444"], 67 | ["#C2412D","#D1AA34","#A7A844","#A46583","#5A1E4A"], 68 | ["#D1313D","#E5625C","#F9BF76","#8EB2C5","#615375"], 69 | ["#9D7E79","#CCAC95","#9A947C","#748B83","#5B756C"], 70 | ["#1C0113","#6B0103","#A30006","#C21A01","#F03C02"], 71 | ["#8DCCAD","#988864","#FEA6A2","#F9D6AC","#FFE9AF"], 72 | ["#CFFFDD","#B4DEC1","#5C5863","#A85163","#FF1F4C"], 73 | ["#75616B","#BFCFF7","#DCE4F7","#F8F3BF","#D34017"], 74 | ["#382F32","#FFEAF2","#FCD9E5","#FBC5D8","#F1396D"], 75 | ["#B6D8C0","#C8D9BF","#DADABD","#ECDBBC","#FEDCBA"], 76 | ["#E3DFBA","#C8D6BF","#93CCC6","#6CBDB5","#1A1F1E"], 77 | ["#A7C5BD","#E5DDCB","#EB7B59","#CF4647","#524656"], 78 | ["#9DC9AC","#FFFEC7","#F56218","#FF9D2E","#919167"], 79 | ["#413D3D","#040004","#C8FF00","#FA023C","#4B000F"], 80 | ["#EDF6EE","#D1C089","#B3204D","#412E28","#151101"], 81 | ["#A8A7A7","#CC527A","#E8175D","#474747","#363636"], 82 | ["#7E5686","#A5AAD9","#E8F9A2","#F8A13F","#BA3C3D"], 83 | ["#FFEDBF","#F7803C","#F54828","#2E0D23","#F8E4C1"], 84 | ["#C1B398","#605951","#FBEEC2","#61A6AB","#ACCEC0"], 85 | ["#5E9FA3","#DCD1B4","#FAB87F","#F87E7B","#B05574"], 86 | ["#951F2B","#F5F4D7","#E0DFB1","#A5A36C","#535233"], 87 | ["#FFFBB7","#A6F6AF","#66B6AB","#5B7C8D","#4F2958"], 88 | ["#000000","#9F111B","#B11623","#292C37","#CCCCCC"], 89 | ["#9CDDC8","#BFD8AD","#DDD9AB","#F7AF63","#633D2E"], 90 | ["#EFF3CD","#B2D5BA","#61ADA0","#248F8D","#605063"], 91 | ["#84B295","#ECCF8D","#BB8138","#AC2005","#2C1507"], 92 | ["#FCFEF5","#E9FFE1","#CDCFB7","#D6E6C3","#FAFBE3"], 93 | ["#0CA5B0","#4E3F30","#FEFEEB","#F8F4E4","#A5B3AA"], 94 | ["#4D3B3B","#DE6262","#FFB88C","#FFD0B3","#F5E0D3"], 95 | ["#B5AC01","#ECBA09","#E86E1C","#D41E45","#1B1521"], 96 | ["#379F7A","#78AE62","#BBB749","#E0FBAC","#1F1C0D"], 97 | ["#FFE181","#EEE9E5","#FAD3B2","#FFBA7F","#FF9C97"], 98 | ["#4E4D4A","#353432","#94BA65","#2790B0","#2B4E72"], 99 | ["#A70267","#F10C49","#FB6B41","#F6D86B","#339194"], 100 | ["#30261C","#403831","#36544F","#1F5F61","#0B8185"], 101 | ["#2D2D29","#215A6D","#3CA2A2","#92C7A3","#DFECE6"], 102 | ["#F38A8A","#55443D","#A0CAB5","#CDE9CA","#F1EDD0"], 103 | ["#793A57","#4D3339","#8C873E","#D1C5A5","#A38A5F"], 104 | ["#11766D","#410936","#A40B54","#E46F0A","#F0B300"], 105 | ["#AAFF00","#FFAA00","#FF00AA","#AA00FF","#00AAFF"], 106 | ["#C75233","#C78933","#D6CEAA","#79B5AC","#5E2F46"], 107 | ["#F8EDD1","#D88A8A","#474843","#9D9D93","#C5CFC6"], 108 | ["#6DA67A","#77B885","#86C28B","#859987","#4A4857"], 109 | ["#1B325F","#9CC4E4","#E9F2F9","#3A89C9","#F26C4F"], 110 | ["#BED6C7","#ADC0B4","#8A7E66","#A79B83","#BBB2A1"], 111 | ["#046D8B","#309292","#2FB8AC","#93A42A","#ECBE13"], 112 | ["#82837E","#94B053","#BDEB07","#BFFA37","#E0E0E0"], 113 | ["#312736","#D4838F","#D6ABB1","#D9D9D9","#C4FFEB"], 114 | ["#E5EAA4","#A8C4A2","#69A5A4","#616382","#66245B"], 115 | ["#6DA67A","#99A66D","#A9BD68","#B5CC6A","#C0DE5D"], 116 | ["#395A4F","#432330","#853C43","#F25C5E","#FFA566"], 117 | ["#331327","#991766","#D90F5A","#F34739","#FF6E27"], 118 | ["#FDFFD9","#FFF0B8","#FFD6A3","#FAAD8E","#142F30"], 119 | ["#E21B5A","#9E0C39","#333333","#FBFFE3","#83A300"], 120 | ["#FBC599","#CDBB93","#9EAE8A","#335650","#F35F55"], 121 | ["#C7FCD7","#D9D5A7","#D9AB91","#E6867A","#ED4A6A"], 122 | ["#EC4401","#CC9B25","#13CD4A","#7B6ED6","#5E525C"], 123 | ["#BF496A","#B39C82","#B8C99D","#F0D399","#595151"], 124 | ["#FFEFD3","#FFFEE4","#D0ECEA","#9FD6D2","#8B7A5E"], 125 | ["#F1396D","#FD6081","#F3FFEB","#ACC95F","#8F9924"], 126 | ["#F6F6F6","#E8E8E8","#333333","#990100","#B90504"], 127 | ["#261C21","#6E1E62","#B0254F","#DE4126","#EB9605"], 128 | ["#E9E0D1","#91A398","#33605A","#070001","#68462B"], 129 | ["#F2E3C6","#FFC6A5","#E6324B","#2B2B2B","#353634"], 130 | ["#FFAB07","#E9D558","#72AD75","#0E8D94","#434D53"], 131 | ["#59B390","#F0DDAA","#E47C5D","#E32D40","#152B3C"], 132 | ["#FDE6BD","#A1C5AB","#F4DD51","#D11E48","#632F53"], 133 | ["#E4E4C5","#B9D48B","#8D2036","#CE0A31","#D3E4C5"], 134 | ["#512B52","#635274","#7BB0A8","#A7DBAB","#E4F5B1"], 135 | ["#805841","#DCF7F3","#FFFCDD","#FFD8D8","#F5A2A2"], 136 | ["#E65540","#F8ECC2","#65A8A6","#79896D"], 137 | ["#CAFF42","#EBF7F8","#D0E0EB","#88ABC2","#49708A"], 138 | ["#595643","#4E6B66","#ED834E","#EBCC6E","#EBE1C5"], 139 | ["#E4DED0","#ABCCBD","#7DBEB8","#181619","#E32F21"], 140 | ["#058789","#503D2E","#D54B1A","#E3A72F","#F0ECC9"], 141 | ["#FF003C","#FF8A00","#FABE28","#88C100","#00C176"], 142 | ["#311D39","#67434F","#9B8E7E","#C3CCAF","#A51A41"], 143 | ["#EFD9B4","#D6A692","#A39081","#4D6160","#292522"], 144 | ["#C6CCA5","#8AB8A8","#6B9997","#54787D","#615145"], 145 | ["#CC5D4C","#FFFEC6","#C7D1AF","#96B49C","#5B5847"], 146 | ["#111625","#341931","#571B3C","#7A1E48","#9D2053"], 147 | ["#EFEECC","#FE8B05","#FE0557","#400403","#0AABBA"], 148 | ["#CCF390","#E0E05A","#F7C41F","#FC930A","#FF003D"], 149 | ["#73C8A9","#DEE1B6","#E1B866","#BD5532","#373B44"], 150 | ["#79254A","#795C64","#79927D","#AEB18E","#E3CF9E"], 151 | ["#E0EFF1","#7DB4B5","#FFFFFF","#680148","#000000"], 152 | ["#F06D61","#DA825F","#C4975C","#A8AB7B","#8CBF99"], 153 | ["#2D1B33","#F36A71","#EE887A","#E4E391","#9ABC8A"], 154 | ["#2B2726","#0A516D","#018790","#7DAD93","#BACCA4"], 155 | ["#95A131","#C8CD3B","#F6F1DE","#F5B9AE","#EE0B5B"], 156 | ["#360745","#D61C59","#E7D84B","#EFEAC5","#1B8798"], 157 | ["#E3E8CD","#BCD8BF","#D3B9A3","#EE9C92","#FE857E"], 158 | ["#807462","#A69785","#B8FAFF","#E8FDFF","#665C49"], 159 | ["#4B1139","#3B4058","#2A6E78","#7A907C","#C9B180"], 160 | ["#FC284F","#FF824A","#FEA887","#F6E7F7","#D1D0D7"], 161 | ["#FFB884","#F5DF98","#FFF8D4","#C0D1C2","#2E4347"], 162 | ["#027B7F","#FFA588","#D62957","#BF1E62","#572E4F"], 163 | ["#80A8A8","#909D9E","#A88C8C","#FF0D51","#7A8C89"], 164 | ["#A69E80","#E0BA9B","#E7A97E","#D28574","#3B1922"], 165 | ["#A1DBB2","#FEE5AD","#FACA66","#F7A541","#F45D4C"], 166 | ["#641F5E","#676077","#65AC92","#C2C092","#EDD48E"], 167 | ["#FFF3DB","#E7E4D5","#D3C8B4","#C84648","#703E3B"], 168 | ["#F5DD9D","#BCC499","#92A68A","#7B8F8A","#506266"], 169 | ["#2B222C","#5E4352","#965D62","#C7956D","#F2D974"], 170 | ["#D4F7DC","#DBE7B4","#DBC092","#E0846D","#F51441"], 171 | ["#A32C28","#1C090B","#384030","#7B8055","#BCA875"], 172 | ["#85847E","#AB6A6E","#F7345B","#353130","#CBCFB4"], 173 | ["#E6B39A","#E6CBA5","#EDE3B4","#8B9E9B","#6D7578"], 174 | ["#11644D","#A0B046","#F2C94E","#F78145","#F24E4E"], 175 | ["#6D9788","#1E2528","#7E1C13","#BF0A0D","#E6E1C2"], 176 | ["#23192D","#FD0A54","#F57576","#FEBF97","#F5ECB7"], 177 | ["#EB9C4D","#F2D680","#F3FFCF","#BAC9A9","#697060"], 178 | ["#D3D5B0","#B5CEA4","#9DC19D","#8C7C62","#71443F"], 179 | ["#452E3C","#FF3D5A","#FFB969","#EAF27E","#3B8C88"], 180 | ["#041122","#259073","#7FDA89","#C8E98E","#E6F99D"], 181 | ["#B1E6D1","#77B1A9","#3D7B80","#270A33","#451A3E"], 182 | ["#9D9E94","#C99E93","#F59D92","#E5B8AD","#D5D2C8"], 183 | ["#FDCFBF","#FEB89F","#E23D75","#5F0D3B","#742365"], 184 | ["#540045","#C60052","#FF714B","#EAFF87","#ACFFE9"], 185 | ["#B7CBBF","#8C886F","#F9A799","#F4BFAD","#F5DABD"], 186 | ["#280904","#680E34","#9A151A","#C21B12","#FC4B2A"], 187 | ["#F0FFC9","#A9DA88","#62997A","#72243D","#3B0819"], 188 | ["#429398","#6B5D4D","#B0A18F","#DFCDB4","#FBEED3"], 189 | ["#E6EBA9","#ABBB9F","#6F8B94","#706482","#703D6F"], 190 | ["#A3C68C","#879676","#6E6662","#4F364A","#340735"], 191 | ["#44749D","#C6D4E1","#FFFFFF","#EBE7E0","#BDB8AD"], 192 | ["#322938","#89A194","#CFC89A","#CC883A","#A14016"], 193 | ["#CFB590","#9E9A41","#758918","#564334","#49281F"], 194 | ["#FA6A64","#7A4E48","#4A4031","#F6E2BB","#9EC6B8"], 195 | ["#1D1313","#24B694","#D22042","#A3B808","#30C4C9"], 196 | ["#F6D76B","#FF9036","#D6254D","#FF5475","#FDEBA9"], 197 | ["#E7EDEA","#FFC52C","#FB0C06","#030D4F","#CEECEF"], 198 | ["#373737","#8DB986","#ACCE91","#BADB73","#EFEAE4"], 199 | ["#161616","#C94D65","#E7C049","#92B35A","#1F6764"], 200 | ["#26251C","#EB0A44","#F2643D","#F2A73D","#A0E8B7"], 201 | ["#4B3E4D","#1E8C93","#DBD8A2","#C4AC30","#D74F33"], 202 | ["#8D7966","#A8A39D","#D8C8B8","#E2DDD9","#F8F1E9"], 203 | ["#F2E8C4","#98D9B6","#3EC9A7","#2B879E","#616668"], 204 | ["#5CACC4","#8CD19D","#CEE879","#FCB653","#FF5254"] 205 | ] 206 | -------------------------------------------------------------------------------- /read_data.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2018, Yaroslav Zotov, https://github.com/qiray/ 3 | # All rights reserved. 4 | 5 | # This file is part of MathArtist. 6 | 7 | # MathArtist is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | 12 | # MathArtist is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | 17 | # You should have received a copy of the GNU General Public License 18 | # along with MathArtist. If not, see . 19 | 20 | import parser 21 | import re 22 | from full_list import * 23 | from coords import (linear_coord, tent_coord, sin_coord, polar, curved_rotate_coord, 24 | rotate_coord, center) 25 | 26 | def parse_formula(formula): 27 | '''Parse formula and return it's code.''' 28 | regex_x = re.compile(r"\bx\b") 29 | regex_y = re.compile(r"\by\b") 30 | try: 31 | formula = regex_x.sub("VariableX()", formula) 32 | formula = regex_y.sub("VariableY()", formula) 33 | code = parser.expr(formula).compile() 34 | return eval(code) 35 | except: 36 | return eval("VariableX()") 37 | 38 | def read_file(filepath): 39 | try: 40 | f = open(filepath, "r") 41 | use_depth = None 42 | art = None 43 | coord_transform = None 44 | polar_shift = None 45 | name = None 46 | for line in f.readlines(): 47 | if line.startswith("Use depth:"): 48 | use_depth = line.split(':')[1].replace(" ", "") 49 | elif line.startswith("Coordinates transform:"): 50 | coord_transform = line.split(':')[1].replace(" ", "") 51 | elif line.startswith("Polar shift:"): 52 | polar_shift = line.split(':')[1].replace(" ", "") 53 | elif line.startswith("Formula:"): 54 | art = line.split(':')[1].replace(" ", "") 55 | elif line.startswith("Name:"): 56 | name = line.split(':')[1] 57 | return art, use_depth, coord_transform, polar_shift, name 58 | except: 59 | return "", "", "", None 60 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow 2 | argparse 3 | pyinstaller 4 | PyQt5 5 | Cython 6 | numpy 7 | -------------------------------------------------------------------------------- /samples/1.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Sin', 'SinCurve', 'Mix'] 2 | Use depth: False 3 | Coordinates transform: polar 4 | Polar shift: [1, 0] 5 | Formula: SinCurve(Mix(Mix(x, y, y), SinCurve(x), Mix(Palette(-0.21875, -0.757812, -0.265625), Palette(-0.195312, -0.25, -0.0703125), y))) -------------------------------------------------------------------------------- /samples/10.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent'] 2 | Use depth: True 3 | Coordinates transform: linear_coord 4 | Formula: Well(Tent(Tent(Tent(Mix(Tent(Mix(Well(x), Well(Palette(0.8125, 0.664062, 0.429688)), Well(x))), Tent(Tent(Mix(Palette(-0.890625, -0.71875, -0.625), Palette(0.96875, -0.546875, -0.367188), y))), Mix(Well(Well(y)), Tent(Well(y)), Well(Tent(x)))))))) -------------------------------------------------------------------------------- /samples/11.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Random', 'Palette', 'Mix', 'Well', 'Sin', 'SinCurve', 'Tent', 'AbsSin'] 2 | Use depth: False 3 | Coordinates transform: sin_coord 4 | Formula: Tent(Well(Well(AbsSin(AbsSin(Mix(x, y, Palette(0.296875, 0.234375, 0))))))) -------------------------------------------------------------------------------- /samples/12.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent', 'SinCurve'] 2 | Use depth: True 3 | Coordinates transform: linear_coord 4 | Formula: Tent(Tent(SinCurve(SinCurve(Well(Mix(SinCurve(Tent(Tent(Palette(-0.0859375, -0.242188, -0.164062)))), Tent(Well(Mix(Palette(0.492188, 0.617188, 0.929688), Palette(0.71875, 0.78125, 0.929688), Palette(0.9375, 0.898438, 0.492188)))), Tent(Mix(Mix(x, x, y), Mix(y, Palette(0.648438, -0.5, -0.820312), Palette(-0.0859375, -0.242188, -0.164062)), Mix(x, y, Palette(0.492188, 0.617188, 0.929688)))))))))) -------------------------------------------------------------------------------- /samples/13.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent'] 2 | Use depth: True 3 | Coordinates transform: polar 4 | Polar shift: [1, 0] 5 | Formula: Tent(Well(Tent(Tent(Tent(Mix(Mix(Well(Tent(x)), Tent(Well(Palette(-0.773438, -0.851562, -0.851562))), Mix(Tent(x), Well(x), Tent(y))), Well(Tent(Mix(y, Palette(-0.71875, 0.421875, 0.15625), Palette(0.640625, -0.75, -0.484375)))), Tent(Mix(Tent(x), Tent(x), Mix(x, Palette(0.273438, 0.4375, -0.9375), x))))))))) -------------------------------------------------------------------------------- /samples/14.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['White', 'Palette', 'Random', 'VariableX', 'VariableY', 'Far', 'Well', 'Sin', 'AbsSin', 'Product'] 2 | Use depth: False 3 | Coordinates transform: polar 4 | Polar shift: [0.5, 0.5] 5 | Formula: Far(Well(x), Product(Random(0.574928,0.255763,0.100623), y), Sin(Random(0.03488,0.156455,0.524925), 2.85516, 5.24514)) -------------------------------------------------------------------------------- /samples/15.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['White', 'VariableX', 'Palette', 'Random', 'VariableY', 'RGB', 'Atan', 'Mix', 'SinCurve', 'AbsSin', 'Level', 'Not', 'Xor', 'And', 'Well', 'Sin', 'Mod', 'Sum', 'Closest', 'Far', 'Product', 'Or', 'Tent'] 2 | Use depth: True 3 | Coordinates transform: polar 4 | Polar shift: [0.5, 0.5] 5 | Formula: And(Sum(Well(Sum(SinCurve(Level(Random(0.14543,0.0719313,0.708717), White(1,1,1), y, 0.562283)), Xor(SinCurve(White(1,1,1)), Sin(White(1,1,1), 1.66952, 3.12385)))), Xor(Or(Or(Closest(y, White(1,1,1), White(1,1,1)), AbsSin(x)), RGB(Mix(Random(0.421675,0.222685,0.401171), White(1,1,1), Palette(-0.625, -1, -0.625)), Not(Palette(-0.4375, -1, -0.4375)), And(x, x))), Sin(RGB(Level(x, White(1,1,1), x, -0.989373), SinCurve(Random(0.460635,0.968284,0.768944)), Well(Random(0.596107,0.462497,0.926276))), 0.25099, 3.52247))), Level(Atan(Or(Tent(Tent(x)),AbsSin(Xor(White(1,1,1), White(1,1,1))))), Tent(And(Product(RGB(White(1,1,1), Palette(-0.25, -0.8125, -0.4375), y), Level(y, y, Random(0.449178,0.094108,0.873117), -0.500537)), Atan(Far(Palette(0.5, -0.4375, -0.4375), White(1,1,1), Random(0.944703,0.852125,0.414432))))), SinCurve(Sum(SinCurve(Product(x, x)), Atan(Not(x)))), -0.312889)) -------------------------------------------------------------------------------- /samples/16.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Sin', 'SinCurve', 'Mix', 'Wave'] 2 | Use depth: True 3 | Coordinates transform: sin_coord 4 | Formula: Sin(Mix(Mix(Wave(SinCurve(x), SinCurve(y)), SinCurve(Wave(y, x)), SinCurve(SinCurve(x))), SinCurve(Sin(Mix(y, x, y), 2.63811, 3.65718)), SinCurve(SinCurve(Mix(y, x, y)))), 0.824872, 5.89621) -------------------------------------------------------------------------------- /samples/17.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableY', 'VariableX', 'Random', 'Product', 'SinCurve', 'Mod', 'Closest', 'Tent', 'Well', 'Sum', 'RGB', 'Atan', 'Xor', 'Not', 'And', 'Wave', 'Mix', 'Level', 'AbsSin'] 2 | Use depth: True 3 | Coordinates transform: polar 4 | Polar shift: [1, 0] 5 | Formula: SinCurve(And(Well(Xor(Sum(RGB(Wave(y, x), And(x, x), Mod(x, x)), And(RGB(x, x, Random(0.995092,0.232524,0.469811)), Product(y, Random(0.851703,0.790299,0.966867)))), Wave(Closest(Mod(Random(0.282738,0.522468,0.500929), Random(0.444906,0.810091,0.629031)), Xor(y, Random(0.962337,0.989543,0.665515)), Well(x)), Wave(Mix(y, y, Random(0.994445,0.0915055,0.334581)), Level(y, y, Random(0.777716,0.895803,0.412739), -0.648048))))), AbsSin(RGB(Mod(RGB(Wave(Random(0.668626,0.878374,0.162498), x), Xor(Random(0.853673,0.652367,0.924754), x), AbsSin(x)), Atan(RGB(y, y, Random(0.157743,0.618242,0.63066)))), Xor(Sum(Tent(x), Mod(y, x)), Product(Product(x, Random(0.55291,0.363607,0.767718)), Mix(y, Random(0.825751,0.917975,0.959491), x))), Mix(RGB(Wave(y, y), Atan(y), AbsSin(x)), Sum(SinCurve(y), SinCurve(Random(0.021478,0.214036,0.280344))), Level(Wave(y, Random(0.407967,0.423659,0.0595785)), Well(Random(0.931158,0.99123,0.485326)), Closest(x, y, Random(0.827581,0.511108,0.762656)), 0.180014)))))) -------------------------------------------------------------------------------- /samples/18.txt: -------------------------------------------------------------------------------- 1 | Name: Your expression 2 | Using operators: ['White', 'Palette', 'Random', 'VariableX', 'VariableY', 'Far', 'Well', 'Sin', 'AbsSin', 'Product'] 3 | Use depth: False 4 | Coordinates transform: curved_rotate_coord 5 | Formula: Far(Far(Far(Well(Far(Well(AbsSin(x)), Product(Sin(Palette(0.992188, 0.335938, -0.945312), 0.0522372, 2.31473), Well(x)), Sin(Product(White(1, 1, 1), y), 1.4756, 3.18534))), AbsSin(Well(Well(Well(White(1, 1, 1))))), Well(Product(Product(AbsSin(Random(0.696641,0.814408,0.155988)), Far(White(1, 1, 1), Palette(0.820312, 0.664062, -0.3125), Random(0.463376,0.00375051,0.850839))), AbsSin(Far(x, x, Random(0.433374,0.319048,0.65956)))))), Far(Sin(Far(AbsSin(AbsSin(y)), AbsSin(Sin(y, 1.95475, 3.80413)), Product(AbsSin(y), AbsSin(White(1, 1, 1)))), 2.55713, 3.91623), AbsSin(Sin(Sin(AbsSin(x), 2.20868, 2.34948), 2.50126, 3.08439)), Product(Far(AbsSin(Far(Palette(-0.109375, 0.351562, -0.0859375), Palette(-0.890625, 0.101562, 0.15625), Random(0.988348,0.635361,0.574959))), AbsSin(Product(y, Palette(-0.476562, -0.398438, -0.351562))), Well(Well(White(1, 1, 1)))), Well(Far(Well(x), Product(y, Palette(0.992188, 0.335938, -0.945312)), Product(x, y))))), Sin(Sin(Well(Sin(Well(y), 1.20358, 1.3064)), 1.58003, 5.79953), 2.61913, 3.19119)), Sin(Sin(Product(Sin(Well(AbsSin(y)), 1.84434, 3.75526), Well(Far(Well(x), Sin(White(1, 1, 1), 0.543518, 5.92878), Far(y, White(1, 1, 1), x)))), 0.903739, 4.33626), 1.25893, 3.06275), Sin(Product(Sin(Well(AbsSin(Product(Palette(0.820312, 0.664062, -0.3125), x))), 3.00678, 5.3002), Well(Sin(Sin(Product(Random(0.420378,0.353222,0.0648981), x), 1.42921, 5.28297), 1.17117, 1.07672))), 1.09923, 4.8844)) -------------------------------------------------------------------------------- /samples/19.txt: -------------------------------------------------------------------------------- 1 | Name: Distinct art near your word 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Sin', 'SinCurve', 'Mix'] 3 | Use depth: False 4 | Coordinates transform: sin_coord 5 | Formula: SinCurve(Mix(Mix(Mix(Sin(Sin(y, 1.34393, 5.94934), 1.25925, 2.78049), Sin(Mix(Palette(-0.179688, 0.640625, 0.804688), Palette(0.304688, 0.710938, 0.6875), Palette(0.75, 0.78125, 0.59375)), 0.149496, 2.95451), Mix(Mix(y, Palette(0.898438, 0.046875, -0.625), x), SinCurve(Palette(0.953125, -0.179688, -1)), Mix(Palette(-0.179688, 0.640625, 0.804688), y, x))), Mix(SinCurve(SinCurve(Palette(0.304688, 0.710938, 0.6875))), SinCurve(Mix(x, Palette(0.75, 0.78125, 0.59375), y)), Sin(Mix(Palette(0.898438, 0.046875, -0.625), y, y), 1.47412, 5.61951)), SinCurve(Sin(Mix(x, y, y), 3.01847, 1.80096))), Mix(Mix(Sin(Sin(y, 3.13996, 4.20579), 0.357129, 4.04177), Sin(SinCurve(Palette(0.953125, -0.179688, -1)), 1.74689, 2.65907), Sin(Sin(x, 2.98225, 2.80602), 2.23139, 2.01527)), Sin(Mix(SinCurve(y), Sin(Palette(-0.179688, 0.640625, 0.804688), 1.1494, 1.58484), Sin(y, 0.415235, 2.72809)), 1.99123, 2.41796), Sin(Sin(SinCurve(Palette(0.304688, 0.710938, 0.6875)), 0.775409, 1.51351), 1.61999, 1.9491)), Sin(Sin(Mix(Mix(Palette(0.75, 0.78125, 0.59375), y, Palette(0.898438, 0.046875, -0.625)), SinCurve(Palette(0.953125, -0.179688, -1)), Mix(Palette(-0.179688, 0.640625, 0.804688), x, y)), 1.24024, 2.34887), 1.46061, 3.47057))) -------------------------------------------------------------------------------- /samples/2.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Sin', 'SinCurve', 'Mix'] 2 | Use depth: False 3 | Coordinates transform: sin_coord 4 | Formula: SinCurve(Sin(Mix(y, x, Palette(0.960938, 0.539062, 0.195312)), 1.00736, 3.24802)) -------------------------------------------------------------------------------- /samples/20.txt: -------------------------------------------------------------------------------- 1 | Name: Velocity within point 2 | Using operators: ['VariableX', 'VariableY', 'Random', 'Palette', 'Mix', 'Well', 'Sin', 'SinCurve', 'Tent', 'AbsSin'] 3 | Use depth: False 4 | Coordinates transform: linear_coord 5 | Formula: SinCurve(Mix(Sin(Well(Well(AbsSin(AbsSin(Tent(y))))), 1.67504, 3.6473), SinCurve(AbsSin(Tent(AbsSin(Tent(Mix(y, Palette(0.648438, 0.664062, 0.375), Palette(0.414062, 0.609375, 0.28125))))))), Sin(SinCurve(Mix(Tent(AbsSin(Sin(x, 1.38864, 4.95517))), Sin(Sin(Tent(y), 1.33181, 4.12144), 1.81643, 2.6157), Sin(Mix(AbsSin(Random(0.0223482,0.67068,0.771686)), SinCurve(Random(0.958236,0.0929607,0.522756)), Tent(Random(0.753181,0.0351527,0.0635145))), 0.929822, 5.65076))), 3.02643, 1.04586))) -------------------------------------------------------------------------------- /samples/21.txt: -------------------------------------------------------------------------------- 1 | Name: Their repressed insight 2 | Using operators: ['VariableX', 'VariableY', 'White', 'Palette', 'Random', 'AbsSin', 'Mix', 'Level', 'RGB', 'Product', 'Sum', 'Mod', 'Well', 'Tent'] 3 | Use depth: True 4 | Coordinates transform: curved_rotate_coord 5 | Formula: Product(Tent(RGB(Level(0.0563609, y, y, x), Sum(x, White(1, 1, 1)), AbsSin(Random(0.720201,0.321649,0.302112)))), AbsSin(AbsSin(Level(-0.350706, Palette(-0.0546875, -0.710938, -0.421875), White(1, 1, 1), White(1, 1, 1))))) -------------------------------------------------------------------------------- /samples/22.txt: -------------------------------------------------------------------------------- 1 | Name: Their education except splendid shape 2 | Using operators: ['VariableX', 'VariableY', 'White', 'Mod', 'Product', 'Atan', 'RGB', 'Mix', 'SinCurve', 'Xor', 'And', 'Level', 'Sin', 'AbsSin', 'Well', 'Tent'] 3 | Use depth: False 4 | Coordinates transform: linear_coord 5 | Formula: AbsSin(Level(-0.254855, Level(0.300284, SinCurve(And(White(1, 1, 1), y)), Atan(RGB(White(1, 1, 1), White(1, 1, 1), White(1, 1, 1))), Mix(Mix(White(1, 1, 1), y, y), RGB(y, y, y), Mod(White(1, 1, 1), y))), AbsSin(Xor(SinCurve(White(1, 1, 1)), Tent(x))), Product(Level(-0.553345,RGB(x, x, x), Product(White(1, 1, 1), x), Mod(White(1, 1, 1), White(1, 1, 1))), Mod(Level(0.780113, y, White(1, 1, 1), y), And(x, y))))) -------------------------------------------------------------------------------- /samples/23.txt: -------------------------------------------------------------------------------- 1 | Name: Autobiography for maelstrom 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Sin', 'SinCurve', 'Mix'] 3 | Use depth: True 4 | Coordinates transform: tent_coord 5 | Formula: SinCurve(SinCurve(Sin(Sin(Mix(Mix(x, y, x), Mix(Palette(-0.335938, -0.234375, -0.125), x, x), Sin(y, 2.11201, 4.17401)), 1.26394, 1.70206), 0.151744, 5.62284))) -------------------------------------------------------------------------------- /samples/24.txt: -------------------------------------------------------------------------------- 1 | Name: My analysis 2 | Using operators: ['Palette', 'VariableX', 'Random', 'White', 'VariableY', 'Atan', 'Xor', 'Closest', 'Mix', 'Product', 'RGB', 'Not', 'Well'] 3 | Use depth: False 4 | Coordinates transform: center 5 | Formula: Xor(Xor(Closest(Product(RGB(Not(White(1, 1, 1)), Closest(x, White(1, 1, 1), Palette(-0.265625, 0.242188, 0.273438)), Atan(White(1, 1,1))), Well(Atan(Palette(0.71875, 0.632812, 0.40625)))), Product(RGB(RGB(Palette(0.953125, 0.4375, -0.0078125), Palette(0.9375, -0.015625, -0.0390625), White(1, 1, 1)), Mix(y, x, White(1, 1, 1)), Not(y)), Atan(Closest(White(1, 1, 1), y, y))), Closest(Well(Mix(y, y, y)), RGB(Not(White(1, 1, 1)), Atan(White(1, 1, 1)), Closest(y, Palette(0.375, -0.335938, -0.09375), White(1, 1, 1))), Well(RGB(Palette(-0.265625, 0.242188, 0.273438), x, x)))), Mix(Atan(Atan(Well(Palette(0.71875, 0.632812, 0.40625)))), Closest(Not(Closest(Random(0.887059,0.489931,0.889813), Palette(0.953125, 0.4375, -0.0078125), x)), Mix(Not(Palette(0.9375, -0.015625, -0.0390625)), Well(Palette(0.375, -0.335938, -0.09375)), Atan(x)), Atan(Product(Palette(-0.265625, 0.242188, 0.273438), Random(0.804309,0.239453,0.981027)))), Mix(Not(Product(Palette(0.71875, 0.632812, 0.40625), x)), Closest(Xor(White(1, 1, 1), Palette(0.953125, 0.4375, -0.0078125)), Well(White(1, 1, 1)), Well(Palette(0.9375, -0.015625, -0.0390625))), Atan(RGB(Random(0.898144,0.277199,0.457962), y, Random(0.334158,0.399516,0.121683)))))), Atan(Mix(Closest(RGB(Closest(Random(0.200551,0.974668,0.586989),Palette(0.375, -0.335938, -0.09375), White(1, 1, 1)), Well(Palette(-0.265625, 0.242188, 0.273438)), Mix(White(1, 1, 1), y, y)), Closest(Mix(Random(0.766248,0.337404,0.390311), Random(0.14019,0.7521,0.816471), Random(0.849862,0.83531,0.894419)), Not(Palette(0.71875, 0.632812, 0.40625)), Not(Palette(0.953125, 0.4375, -0.0078125))), Closest(Closest(Palette(0.9375, -0.015625, -0.0390625), Palette(0.375, -0.335938, -0.09375), White(1, 1, 1)), Atan(White(1, 1, 1)), Product(x, Random(0.577218,0.0466442,0.428428)))), Not(Xor(Closest(Random(0.238724,0.104149,0.115236), White(1, 1, 1), White(1, 1, 1)), Closest(y, White(1, 1, 1), x))), Product(RGB(RGB(Random(0.915524,0.320965,0.534624), y, y), Xor(y, y), RGB(White(1, 1, 1), Random(0.573812,0.956577,0.0990325), White(1, 1, 1))), Xor(Mix(x, Random(0.306043,0.889547,0.361188), Random(0.279061,0.813765,0.356812)), Well(y)))))) -------------------------------------------------------------------------------- /samples/25.txt: -------------------------------------------------------------------------------- 1 | Name: Transformation of painted birth 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well'] 3 | Use depth: True 4 | Coordinates transform: curved_rotate_coord 5 | Formula: Well(Mix(Well(Mix(Mix(Mix(Mix(x, y, x), Well(Palette(-0.96875, -0.867188, -0.734375)), Mix(Palette(-0.710938, 0.125, -0.101562), x, y)), Mix(Well(x), Well(y), Well(y)), Well(Well(Palette(-0.0078125, 0.703125, 0.0703125)))), Well(Well(Well(x))), Well(Well(Well(y))))), Mix(Well(Mix(Well(Well(x)), Well(Mix(y, y, x)), Well(Well(Palette(0.5625, 0.820312, 0.109375))))), Mix(Mix(Mix(Mix(y, Palette(0.796875, 0.945312, 0.226562), y), Well(x), Well(Palette(-0.96875, -0.867188, -0.734375))), Mix(Well(Palette(-0.710938, 0.125, -0.101562)), Well(x), Mix(y, Palette(-0.0078125, 0.703125, 0.0703125), y)), Well(Mix(x, y, Palette(0.5625, 0.820312, 0.109375)))), Well(Mix(Well(Palette(0.796875, 0.945312, 0.226562)),Mix(x, y, y), Well(x))), Well(Well(Well(y)))), Mix(Well(Well(Well(x))), Well(Well(Mix(Palette(-0.96875, -0.867188, -0.734375), y, y))), Well(Well(Mix(x, x, Palette(-0.710938, 0.125, -0.101562)))))), Mix(Well(Well(Well(Mix(y, y, y)))), Mix(Well(Mix(Well(Palette(-0.0078125, 0.703125, 0.0703125)), Mix(Palette(0.5625, 0.820312, 0.109375), x, Palette(0.796875, 0.945312, 0.226562)), Mix(Palette(-0.96875, -0.867188, -0.734375), Palette(-0.710938, 0.125, -0.101562), x))), Well(Well(Well(Palette(-0.0078125, 0.703125, 0.0703125)))), Mix(Well(Well(x)), Mix(Mix(y, Palette(0.5625, 0.820312, 0.109375), y), Mix(x, x, Palette(0.796875, 0.945312, 0.226562)), Mix(x, x, Palette(-0.96875, -0.867188, -0.734375))), Well(Well(x)))), Mix(Well(Mix(Mix(Palette(-0.710938, 0.125, -0.101562), y, Palette(-0.0078125, 0.703125, 0.0703125)), Well(Palette(0.5625, 0.820312, 0.109375)), Mix(x, x, y))), Well(Well(Mix(y, x, Palette(0.796875, 0.945312, 0.226562)))), Well(Mix(Mix(y, Palette(-0.96875, -0.867188, -0.734375), Palette(-0.710938, 0.125, -0.101562)), Well(x), Well(x))))))) -------------------------------------------------------------------------------- /samples/26.txt: -------------------------------------------------------------------------------- 1 | Name: Happy man 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Random', 'Mix', 'Well', 'Tent', 'Chess'] 3 | Use depth: False 4 | Coordinates transform: rotate_coord 5 | Formula: Mix(Well(Tent(Tent(Well(y)))), Mix(Well(Tent(Mix(y, Palette(0.3125, 0.796875, 0.609375), Random(0.22999,0.225828,0.58828)))), Well(Tent(Mix(Random(0.713522,0.50531,0.469267), Palette(0.71875, 0.851562, 0.515625), Chess(0.200054, 0.229368)))), Well(Tent(Well(y)))), Tent(Tent(Well(Mix(x, Palette(0.992188, 0.648438, 0.414062), Chess(0.880232, 0.762425)))))) 6 | -------------------------------------------------------------------------------- /samples/27.txt: -------------------------------------------------------------------------------- 1 | Name: Your friendly others 2 | Using operators: ['VariableX', 'VariableY', 'Random', 'Sum', 'Product', 'Mod', 'Sin', 'Tent', 'Well', 'Level', 'Mix', 'Palette'] 3 | Use depth: False 4 | Coordinates transform: polar 5 | Polar shift: [0.5, 0.5] 6 | Formula: Sin(Sin(Tent(Mod(Well(Palette(0.992188, 0.867188, 0.648438)), Mod(x, Palette(0.992188, 0.984375, 0.78125)))), 1.83104, 1.43092), 2.40113, 2.07643) -------------------------------------------------------------------------------- /samples/28.txt: -------------------------------------------------------------------------------- 1 | Name: His mushy area 2 | Using operators: ['VariableX', 'VariableY', 'Random', 'Mix', 'Well'] 3 | Use depth: False 4 | Coordinates transform: center 5 | Formula: Mix(Mix(Mix(Well(Well(Mix(Random(0.293487,0.0893424,0.547334), Random(0.905054,0.0831484,0.241111), Random(0.0172704,0.413258,0.803932)))), Mix(Mix(Mix(y, y, Random(0.689242,0.365491,0.606348)), Well(x), Mix(y, x, y)), Mix(Mix(y, Random(0.601041,0.10701,0.0482917), x), Well(x), Well(y)), Mix(Well(y), Well(Random(0.815602,0.348599,0.732731)), Mix(Random(0.58127,0.120136,0.302255), x, Random(0.664971,0.769422,0.51322)))), Mix(Mix(Well(x), Mix(y, x, Random(0.992478,0.87996,0.315093)), Well(Random(0.512935,0.27494,0.267797))), Well(Well(y)), Mix(Mix(Random(0.429708,0.0847171,0.0117883), Random(0.976909,0.0211983,0.85755), x), Mix(y, Random(0.438827,0.374943,0.189475), Random(0.562047,0.770067,0.529325)), Mix(x, x, x)))), Mix(Mix(Well(Mix(x, y, y)), Mix(Well(y), Mix(y, x, Random(0.728287,0.231983,0.274245)), Mix(x, x, x)), Mix(Mix(Random(0.150758,0.986102,0.117753), Random(0.794084,0.969045,0.0368764), x), Well(y), Well(Random(0.289439,0.446064,0.965324)))), Mix(Well(Mix(Random(0.89196,0.830831,0.917498), Random(0.972982,0.788732,0.483542), x)), Well(Well(y)), Mix(Well(x), Well(x), Mix(x, y, y))), Mix(Well(Mix(x, Random(0.819427,0.00864955,0.72159), y)), Well(Mix(y, x, Random(0.0776703,0.698145,0.760284))), Well(Mix(y, y, x)))), Mix(Well(Well(Well(x))), Mix(Well(Well(x)), Mix(Well(y), Mix(x, y, Random(0.553389,0.497786,0.400425)), Well(x)), Mix(Well(Random(0.262103,0.400762,0.243752)), Well(x), Well(y))), Mix(Well(Well(Random(0.116071,0.443534,0.0472649))), Mix(Mix(y, y, x), Mix(x, x, y), Mix(x, Random(0.655401,0.327037,0.41798), y)), Mix(Well(y), Mix(x, x, y), Mix(y, x, Random(0.204645,0.644769,0.783919)))))), Well(Mix(Well(Mix(Well(Random(0.871261,0.526758,0.233806)), Mix(y, y, y), Mix(y, x, y))), Well(Well(Mix(x, x, Random(0.904975,0.718723,0.414851)))), Well(Mix(Mix(x, y, x), Well(y), Well(y))))), Well(Well(Well(Well(Mix(Random(0.0125884,0.802079,0.379344), y, x)))))) -------------------------------------------------------------------------------- /samples/29.txt: -------------------------------------------------------------------------------- 1 | Name: Your jolly despair 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'AbsSin', 'Sin', 'Mix'] 3 | Use depth: True 4 | Coordinates transform: curved_rotate_coord 5 | Formula: Sin(AbsSin(AbsSin(Sin(Mix(Mix(AbsSin(Sin(Sin(Palette(0.460938, 0.460938, 0.0625), 2.27908, 3.87572), 0.224145, 1.39203)), Sin(Sin(AbsSin(Palette(0.59375, 0.546875, 0.101562)), 0.606463, 4.1096), 0.430546, 2.91053), Sin(Sin(Sin(y, 0.256139, 4.65898), 0.0179289, 4.43246), 0.760295, 4.61378)), Sin(Mix(AbsSin(Sin(y, 2.54422, 3.84986)), Mix(Sin(Palette(0.859375, 0.726562, 0.195312), 1.42256, 5.11668), Sin(Palette(0.859375, 0.515625, 0.125), 1.67943, 2.07746), Mix(Palette(0.859375, 0.328125, 0.0625), y, Palette(0.460938, 0.460938, 0.0625))), Sin(Mix(y, x, x), 0.264898, 4.24099)), 1.95491, 2.87881), Mix(AbsSin(AbsSin(Sin(y, 0.928111, 4.35093))), AbsSin(Sin(AbsSin(y), 2.2441, 3.62377)), AbsSin(AbsSin(Mix(y, y, x))))), 1.40754, 3.51971))), 0.561892, 5.29625) -------------------------------------------------------------------------------- /samples/3.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent'] 2 | Use depth: False 3 | Coordinates transform: tent_coord 4 | Formula: Tent(Mix(x, y, Palette(0.820312, 0.75, 0.632812))) -------------------------------------------------------------------------------- /samples/30.txt: -------------------------------------------------------------------------------- 1 | Name: Appendix of contrast 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'AbsSin', 'Sin', 'Mix'] 3 | Use depth: False 4 | Coordinates transform: rotate_coord 5 | Formula: Sin(Sin(Sin(Mix(Mix(Sin(Palette(-0.578125, -0.945312, -0.460938), 2.1658, 2.7498), Mix(y, x, x), AbsSin(y)), Sin(Mix(Palette(0.671875, -0.78125, -0.304688), y, x), 1.79861, 4.40506), Mix(Mix(y, Palette(0.804688, 0.6875, -0.414062), x), Mix(x, y, y), Mix(Palette(0.867188, 0.828125, 0.539062), x, Palette(-0.789062, 0.0546875, 0.1875)))), 0.509853, 1.94753), 1.60346, 4.52132), 0.666452, 2.83759) -------------------------------------------------------------------------------- /samples/31.txt: -------------------------------------------------------------------------------- 1 | Name: Philosophy between state 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent', 'SinCurve'] 3 | Use depth: False 4 | Coordinates transform: rotate_coord 5 | Formula: Tent(SinCurve(Tent(Mix(x, Palette(0.9375, 0.382812, 0.164062), y)))) -------------------------------------------------------------------------------- /samples/32.txt: -------------------------------------------------------------------------------- 1 | Name: Quant mind guy 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'AbsSin', 'Sin', 'Mix'] 3 | Use depth: False 4 | Coordinates transform: center 5 | Formula: Sin(Mix(Mix(Sin(Palette(0.820312, -0.390625, -0.0703125), 2.07389, 3.45281), Mix(x, y, y), Mix(y, x, y)), Mix(Mix(Palette(0.671875, 0.0078125, 0.0703125), Palette(0.546875, 0.28125, 0.203125), x), AbsSin(x), Mix(Palette(0.546875, 0.789062, 0.695312), y, Palette(0.90625, 0.828125, 0.664062))), AbsSin(Mix(y, Palette(0.820312, -0.390625, -0.0703125), x))), 1.97428, 5.53189) -------------------------------------------------------------------------------- /samples/33.txt: -------------------------------------------------------------------------------- 1 | Name: Muse on aphrodite 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent', 'SinCurve'] 3 | Use depth: True 4 | Coordinates transform: rotate_coord 5 | Formula: Tent(Well(Tent(Tent(Mix(Mix(Well(Palette(0.164062, -0.757812, -0.664062)), Mix(y, Palette(0.914062, 0.90625, 0.679688), Palette(0.75,0.742188, 0.382812)), Tent(Palette(0.289062, 0.273438, -0.15625))), SinCurve(Mix(x, y, Palette(-0.351562, -0.359375, -0.601562))), Well(Tent(Palette(0.164062, -0.757812, -0.664062)))))))) -------------------------------------------------------------------------------- /samples/34.txt: -------------------------------------------------------------------------------- 1 | Name: Soup on relieved month 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent', 'SinCurve'] 3 | Use depth: False 4 | Coordinates transform: rotate_coord 5 | Formula: Tent(Tent(Tent(Tent(Tent(Tent(Mix(x, x, y))))))) -------------------------------------------------------------------------------- /samples/35.txt: -------------------------------------------------------------------------------- 1 | Name: Teacher over student 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent', 'SinCurve', 'AbsSin'] 3 | Use depth: False 4 | Coordinates transform: linear_coord 5 | Formula: Mix(AbsSin(SinCurve(Well(Well(AbsSin(Well(Tent(y))))))), Tent(Tent(Well(SinCurve(AbsSin(Mix(Tent(x), Well(y), Mix(x, x, x))))))), AbsSin(Well(Tent(Well(Well(Tent(AbsSin(Palette(-0.28125, -0.609375, -0.515625))))))))) -------------------------------------------------------------------------------- /samples/36.txt: -------------------------------------------------------------------------------- 1 | Name: Your view about puzzled process into falling son 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Random', 'Mix', 'Well', 'Tent', 'SinCurve'] 3 | Use depth: False 4 | Coordinates transform: center 5 | Formula: SinCurve(Mix(Mix(Well(Random(0.584006,0.906031,0.109326)), Well(Random(0.523024,0.597008,0.491977)), Tent(Random(0.19684,0.624945,0.920284))), Well(Mix(y, Palette(0.953125, 0.625, 0.0703125), x)), Well(SinCurve(x)))) -------------------------------------------------------------------------------- /samples/37.txt: -------------------------------------------------------------------------------- 1 | Name: Jittery spirit for overwhelming brushstroke over proud gentleman towards happy ego 2 | Using operators: ['VariableX', 'VariableY', 'White', 'Palette', 'Random', 'RGB', 'Far', 'Closest', 'Mix', 'Well'] 3 | Use depth: False 4 | Coordinates transform: center 5 | Formula: Mix(Well(Closest(Closest(y, White(1, 1, 1), Palette(-0.265625, -0.492188, -0.632812)), RGB(Palette(0.96875, 0.835938, 0.421875), White(1, 1, 1), Random(0.635464,0.405347,0.153554)), RGB(x, y, Random(0.651827,0.78222,0.799243)))), RGB(Closest(Mix(White(1, 1, 1), y, Palette(-0.0625, 0.5, 0.3125)), RGB(White(1, 1, 1), y, Palette(0.875, 6 | -0.0625, -0.8125)), Far(y, White(1, 1, 1), x)), RGB(Well(Random(0.0719684,0.855684,0.943754)), Closest(y, Random(0.396099,0.38396,0.318024), x), RGB(Palette(0.875, 0.3125, 7 | -0.625), y, White(1, 1, 1))), RGB(Far(Palette(-0.265625, -0.492188, -0.632812), x, x), RGB(Palette(0.96875, 0.835938, 0.421875), y, Palette(-0.0625, 0.5, 0.3125)), Mix(y, White(1, 1, 1), White(1, 1, 1)))), Closest(Far(RGB(White(1, 1, 1), Palette(0.875, -0.0625, -0.8125), y), RGB(White(1, 1, 1), y, x), Far(White(1, 1, 1), y, Random(0.47275,0.906728,0.112657))), Mix(Mix(White(1, 1, 1), x, Palette(0.875, 0.3125, -0.625)), Mix(White(1, 1, 1), White(1, 1, 1), Random(0.430498,0.710957,0.774806)), Closest(y, y, y)), Mix(RGB(White(1, 1, 1), y, Random(0.728051,0.673818,0.577295)), Far(y, Palette(-0.265625, -0.492188, -0.632812), y), Far(White(1, 1, 1), x, White(1, 1, 1))))) -------------------------------------------------------------------------------- /samples/38.txt: -------------------------------------------------------------------------------- 1 | Name: Our redhead above cautious water like darkened intensity at reclining dream 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Random', 'Mix', 'SinCurve', 'Sin', 'AbsSin', 'Atan'] 3 | Use depth: False 4 | Coordinates transform: rotate_coord 5 | Formula: Sin(Sin(SinCurve(AbsSin(Atan(SinCurve(SinCurve(Mix(AbsSin(x), Atan(Random(0.180378,0.718652,0.400515)), AbsSin(y))))))), 2.25006, 1.831), 0.954884, 2.66912) -------------------------------------------------------------------------------- /samples/39.txt: -------------------------------------------------------------------------------- 1 | Name: Joyous conflict 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent', 'SinCurve', 'AbsSin'] 3 | Use depth: True 4 | Coordinates transform: sin_coord 5 | Formula: AbsSin(SinCurve(Well(Mix(AbsSin(y), Well(Palette(-0.304688, -0.382812, -0.382812)), AbsSin(x))))) -------------------------------------------------------------------------------- /samples/4.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent', 'SinCurve'] 2 | Use depth: True 3 | Coordinates transform: linear_coord 4 | Formula: Tent(SinCurve(Mix(Well(Tent(Tent(y))), Tent(Tent(SinCurve(x))), SinCurve(Mix(Mix(x, Palette(0.976562, 0.617188, 0.492188), x), Mix(x, Palette(0.984375, 0.4375, 0.242188), x), SinCurve(Palette(0.765625, -0.523438, -0.0859375))))))) -------------------------------------------------------------------------------- /samples/40.txt: -------------------------------------------------------------------------------- 1 | Name: Your problem family 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Sin', 'SinCurve', 'Mix'] 3 | Use depth: False 4 | Coordinates transform: tent_coord 5 | Formula: Sin(Sin(SinCurve(Mix(Mix(SinCurve(Palette(-0.335938, -0.484375, -0.578125)), Sin(x, 0.284353, 4.37239), Sin(y, 0.206711, 5.87174)), Mix(SinCurve(Palette(0.929688, -0.0625, -0.710938)), Mix(Palette(0.648438, 0.609375, -0.523438), y, Palette(0.882812, 0.867188, 0.289062)), Mix(x, x, x)), SinCurve(Sin(Palette(-0.25, 0.445312, 0.203125), 2.83971, 1.66042)))), 1.33448, 2.0417), 0.03254, 4.09633) -------------------------------------------------------------------------------- /samples/41.txt: -------------------------------------------------------------------------------- 1 | Name: Your angel near your insight 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent'] 3 | Use depth: False 4 | Coordinates transform: rotate_coord 5 | Formula: Tent(Tent(Well(Tent(Mix(Well(x), Well(y), Mix(y, x, Palette(0.796875, 0.398438, 0.203125))))))) -------------------------------------------------------------------------------- /samples/42.txt: -------------------------------------------------------------------------------- 1 | Name: His time 2 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent'] 3 | Use depth: False 4 | Coordinates transform: curved_rotate_coord 5 | Formula: Mix(Tent(Mix(Mix(Well(Tent(Mix(Tent(Tent(y)), Mix(Well(Palette(-0.703125, -0.710938, -0.78125)), Tent(y), Mix(Palette(0.835938, -0.921875, -0.46875), y, x)), Well(Mix(y, y, x))))), Well(Tent(Tent(Mix(Mix(Palette(0.890625, -0.21875, -0.523438), Palette(0.890625, 0.304688, -0.523438), Palette(0.25, 0.8125, 0.429688)), Tent(y), Mix(x, y, Palette(-0.703125, -0.710938, -0.78125)))))), Well(Mix(Mix(Well(Tent(Palette(0.835938, -0.921875, -0.46875))), Tent(Tent(Palette(0.890625, -0.21875, -0.523438))), Mix(Well(x), Mix(y, x, x), Tent(Palette(0.890625, 0.304688, -0.523438)))), Mix(Tent(Mix(Palette(0.25, 0.8125, 0.429688), Palette(-0.703125, -0.710938, -0.78125), y)), Mix(Well(x), Tent(Palette(0.835938, -0.921875, -0.46875)), Tent(x)), Tent(Mix(y, Palette(0.890625, -0.21875, -0.523438), Palette(0.890625, 0.304688, -0.523438)))), Mix(Well(Well(y)), Mix(Well(Palette(0.25, 0.8125, 0.429688)), Tent(x), Mix(Palette(-0.703125, -0.710938, -0.78125), x, y)), Well(Tent(Palette(0.835938, -0.921875, -0.46875))))))), Well(Mix(Well(Mix(Well(Mix(Palette(0.890625, -0.21875, -0.523438), y, Palette(0.890625, 0.304688, -0.523438))), Mix(Tent(y), Tent(Palette(0.25, 0.8125, 0.429688)), Mix(x, x, y)), Mix(Mix(y, x, Palette(-0.703125, -0.710938, -0.78125)), Tent(Palette(0.835938, -0.921875, -0.46875)), Well(y)))), Mix(Tent(Well(Well(Palette(0.890625, -0.21875, -0.523438)))), Tent(Well(Mix(Palette(0.890625, 0.304688, -0.523438), Palette(0.25, 0.8125, 0.429688), Palette(-0.703125, -0.710938, -0.78125)))), Mix(Mix(Well(x), Mix(Palette(0.835938, -0.921875, -0.46875), x, x), Well(Palette(0.890625, -0.21875, -0.523438))), Well(Well(y)), Tent(Mix(x, Palette(0.890625, 0.304688, -0.523438), Palette(0.25, 0.8125, 0.429688))))), Tent(Mix(Tent(Mix(Palette(-0.703125, -0.710938, -0.78125), Palette(0.835938, -0.921875, -0.46875), Palette(0.890625, -0.21875, -0.523438))), Mix(Well(Palette(0.890625, 0.304688, -0.523438)), Tent(x), Well(y)), Tent(Tent(x)))))), Mix(Tent(Well(Mix(Well(Mix(x, Palette(0.25, 0.8125, 0.429688), Palette(-0.703125, -0.710938, -0.78125))), Tent(Mix(Palette(0.835938, -0.921875, -0.46875), x, y)), Mix(Mix(Palette(0.890625, -0.21875, -0.523438), Palette(0.890625, 0.304688, -0.523438), Palette(0.25, 0.8125, 0.429688)), Well(x), Mix(Palette(-0.703125, -0.710938, -0.78125), y, Palette(0.835938, -0.921875, -0.46875)))))), Mix(Well(Mix(Mix(Mix(Palette(0.890625, -0.21875, -0.523438), y, y), Mix(Palette(0.890625, 0.304688, -0.523438), y, Palette(0.25, 0.8125, 0.429688)), Well(y)), Tent(Tent(y)), Mix(Mix(x, Palette(-0.703125, -0.710938, -0.78125), x), Tent(x), Mix(y, x, Palette(0.835938, -0.921875, -0.46875))))), Mix(Mix(Well(Tent(Palette(0.890625, -0.21875, -0.523438))), Mix(Mix(x, Palette(0.890625, 0.304688, -0.523438), y), Well(Palette(0.25, 0.8125, 0.429688)), Well(Palette(-0.703125, -0.710938, -0.78125))), Well(Well(y))), Mix(Tent(Mix(x, x, x)), Tent(Tent(Palette(0.835938, -0.921875, -0.46875))), Tent(Mix(y, x, x))), Tent(Well(Tent(y)))), Mix(Tent(Mix(Mix(Palette(0.890625, -0.21875, -0.523438), y, y), Tent(y), Mix(x, y, Palette(0.890625, 0.304688, -0.523438)))), Well(Tent(Tent(x))), Well(Tent(Mix(y, x, y))))), Mix(Mix(Tent(Tent(Mix(Palette(0.25, 0.8125, 0.429688), Palette(-0.703125, -0.710938, -0.78125), Palette(0.835938, -0.921875, -0.46875)))), Mix(Well(Tent(y)), Well(Mix(x, y, Palette(0.890625, -0.21875, -0.523438))), Tent(Mix(Palette(0.890625, 0.304688, -0.523438), x, y))), Well(Well(Mix(y, Palette(0.25, 0.8125, 0.429688), y)))), Mix(Well(Well(Mix(y, y, Palette(-0.703125, -0.710938, -0.78125)))), Mix(Mix(Tent(Palette(0.835938, -0.921875, -0.46875)), Tent(x), Mix(y, Palette(0.890625, -0.21875, -0.523438), x)), Mix(Well(y), Well(y), Tent(y)), Tent(Tent(y))), Tent(Tent(Tent(y)))), Well(Well(Tent(Tent(x)))))))), Tent(Tent(Well(Mix(Mix(Mix(Well(Tent(x)), Mix(Tent(y), Mix(Palette(0.890625, 0.304688, -0.523438), Palette(0.25, 0.8125, 0.429688), y), Tent(x)), Well(Tent(x))), Well(Well(Mix(x, Palette(-0.703125, -0.710938, -0.78125), x))), Well(Well(Tent(y)))), Well(Mix(Well(Well(x)), Mix(Tent(y), Well(y), Mix(x, x, Palette(0.835938, -0.921875, -0.46875))), Well(Tent(Palette(0.890625, -0.21875, -0.523438))))), Mix(Mix(Mix(Well(x), Well(Palette(0.890625, 0.304688, -0.523438)), Well(Palette(0.25, 0.8125, 0.429688))), Tent(Well(Palette(-0.703125, -0.710938, -0.78125))), Tent(Mix(Palette(0.835938, -0.921875, -0.46875), x, Palette(0.890625, -0.21875, -0.523438)))), Well(Tent(Mix(x, y, y))), Well(Mix(Mix(Palette(0.890625, 0.304688, -0.523438), Palette(0.25, 0.8125, 0.429688), y), Mix(Palette(-0.703125, -0.710938, -0.78125), Palette(0.835938, -0.921875, -0.46875), y), Mix(x, y, Palette(0.890625, -0.21875, -0.523438))))))))), Mix(Well(Well(Tent(Tent(Well(Mix(Tent(y), Tent(x), Well(y))))))), Mix(Mix(Well(Mix(Mix(Tent(Mix(Palette(0.890625, 0.304688, -0.523438), y, y)), Mix(Tent(x), Mix(x, Palette(0.25, 0.8125, 0.429688), y), Mix(Palette(-0.703125, -0.710938, -0.78125), y, Palette(0.835938, -0.921875, -0.46875))), Mix(Tent(x), Mix(Palette(0.890625, -0.21875, -0.523438), x, y), Mix(x, y, y))), Well(Well(Well(x))), Well(Mix(Mix(y, x, y), Well(Palette(0.890625, 0.304688, -0.523438)), Mix(x, x, y))))), Tent(Mix(Mix(Mix(Tent(y), Well(Palette(0.25, 0.8125, 0.429688)), Well(y)), Tent(Well(y)), Mix(Tent(Palette(-0.703125, -0.710938, -0.78125)), Well(x), Mix(y, y, y))), Tent(Mix(Tent(y), Mix(y, Palette(0.835938, -0.921875, -0.46875), x), Mix(y, Palette(0.890625, -0.21875, -0.523438), Palette(0.890625, 0.304688, -0.523438)))), Well(Well(Mix(y, Palette(0.25, 0.8125, 0.429688), y))))), Tent(Tent(Tent(Tent(Well(Palette(-0.703125, -0.710938, -0.78125))))))), Mix(Tent(Mix(Tent(Mix(Mix(y, y, Palette(0.835938, -0.921875, -0.46875)), Tent(y), Mix(Palette(0.890625, -0.21875, -0.523438), y, Palette(0.890625, 0.304688, -0.523438)))), Well(Tent(Well(y))), Well(Well(Well(x))))), Well(Tent(Tent(Mix(Mix(y, Palette(0.25, 0.8125, 0.429688), x), Tent(y), Tent(x))))), Well(Well(Tent(Well(Well(x)))))), Tent(Well(Well(Well(Mix(Tent(y), Mix(x, y, Palette(-0.703125, -0.710938, -0.78125)), Well(y))))))), Well(Well(Mix(Tent(Well(Mix(Mix(y, x, y), Tent(x), Tent(x)))), Well(Well(Well(Tent(y)))), Well(Tent(Tent(Mix(Palette(0.835938, -0.921875, -0.46875), x, Palette(0.890625, -0.21875, -0.523438)))))))))) 6 | 7 | -------------------------------------------------------------------------------- /samples/5.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Sin', 'SinCurve', 'Mix'] 2 | Use depth: False 3 | Coordinates transform: tent_coord 4 | Formula: SinCurve(Mix(Sin(x, 2.59752, 2.50746), Sin(y, 0.768903, 4.21003), Mix(Palette(-0.398438, -0.539062, -0.539062), x, x))) -------------------------------------------------------------------------------- /samples/6.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Mix', 'Well', 'Tent'] 2 | Use depth: True 3 | Coordinates transform: sin_coord 4 | Formula: Tent(Well(Well(Mix(Mix(Tent(Palette(-0.335938, -0.484375, -0.578125)), Well(x), Tent(Palette(0.929688, -0.0625, -0.710938))), Well(Mix(y, y, Palette(0.648438, 0.609375, -0.523438))), Mix(Mix(y, y, y), Tent(x), Mix(Palette(0.882812, 0.867188, 0.289062), x, y)))))) -------------------------------------------------------------------------------- /samples/7.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'Sin', 'SinCurve', 'Mix'] 2 | Use depth: False 3 | Coordinates transform: linear_coord 4 | Formula: SinCurve(Mix(SinCurve(y), Sin(Palette(-0.46875, -0.09375, 0.226562), 0.294927, 2.06359), Mix(Palette(0.546875, 0.65625, 0.757812), x, x))) -------------------------------------------------------------------------------- /samples/8.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'Palette', 'And', 'Or', 'Xor'] 2 | Use depth: False 3 | Coordinates transform: polar 4 | Polar shift: [0, 0] 5 | Formula: Or(Xor(x, x), And(y, x)) -------------------------------------------------------------------------------- /samples/9.txt: -------------------------------------------------------------------------------- 1 | Using operators: ['VariableX', 'VariableY', 'White', 'Palette', 'Random', 'AbsSin', 'Mix', 'Level', 'RGB', 'Sum', 'Mod'] 2 | Use depth: False 3 | Coordinates transform: linear_coord 4 | Formula: Mod(Level(y, y, x, -0.947116), Sum(y, White(1,1,1))) -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from distutils.extension import Extension 3 | from Cython.Build import cythonize 4 | from Cython.Distutils import build_ext 5 | 6 | # python3 setup.py build_ext --inplace 7 | 8 | setup( 9 | ext_modules = [ 10 | Extension( 11 | 'common', 12 | sources =["common.pyx"], 13 | extra_compile_args=['-O3'], 14 | ), 15 | Extension( 16 | 'operators', 17 | sources =["operators.pyx"], 18 | extra_compile_args=['-O3'], 19 | ), 20 | ], 21 | cmdclass = {'build_ext': build_ext} 22 | ) --------------------------------------------------------------------------------