{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%reload_ext autoreload\n", "%autoreload 2\n", "\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from PIL import Image, ImageOps\n", "import excolor" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Sigmoid wallpaper" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "green, blue = \"#CCFF66\", \"#2980BA\"\n", "img = excolor.sigmoid_wallpaper(colors=green, background=blue, n=3, midpoint=0.3)\n", "img" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Perlin wallpaper" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "# [Optional] Load background image\n", "url = \"https://github.com/timpyrkov/excolor/blob/master/img/image_color.png?raw=true\"\n", "bg = excolor.load_image(url)\n", "bg = excolor.greyscale_image(bg)\n", "\n", "# Draw patches distorted by Perlin noise \n", "img = excolor.perlin_wallpaper('rtd_r', n=5, background=bg, size=(1280, 960))\n", "img" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Perlin lines" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# [Optional] Load background image\n", "url = \"https://github.com/timpyrkov/excolor/blob/master/img/image_color.png?raw=true\"\n", "bg = excolor.load_image(url)\n", "bg = excolor.greyscale_image(bg)\n", "\n", "# Draw lines distorted by Perlin noise \n", "img = excolor.perlin_lines('rtd_r', m=6, background=bg, size=(1280, 960))\n", "img" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Gradient wallpaper" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "green, blue = \"#CCFF66\", \"#2980BA\"\n", "img = excolor.gradient_wallpaper([green, blue], angle=-30)\n", "img" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Low-polygon wallpaper" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "colors = excolor.get_colors('rtd', n=10)\n", "img = excolor.triangle_wallpaper(colors, size=(1280, 720), distortion=0.5)\n", "img" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.11" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 1 }