從turtle海龜動畫 學習 Python - 高中彈性課程系列 10.2 藝術畫 Python 製作生成式藝術略覽

46 篇文章 1 订阅
32 篇文章 1 订阅

Goal: 藉由有趣的「海龜繪圖」學會基礎的 Python 程式設計
本篇著重在以 Python 海龜繪圖模擬藝術圖形, 討論與生成式藝術的關聯.

本篇我們列舉一些網路上見到的, 用電腦程式或某些軟體產生美麗的圖形的例子, 挑選數學味道較重的, 許多都是用程式語言 Processing 來繪製, (或是 在 Processing 打開 Python mode, 語法是 Python, 但是繪圖指令是 Processing 才有的)
我們之後會再分篇討論是否可以用 Python 來製作類似的效果.


“Talk is cheap. Show me the code.”
― Linus Torvalds

老子第41章
上德若谷
大白若辱
大方無隅
大器晚成
大音希聲
大象無形
道隱無名

拳打千遍, 身法自然

“There’s no shortage of remarkable ideas, what’s missing is the will to execute them.” – Seth Godin
「很棒的點子永遠不會匱乏,然而缺少的是執行點子的意志力。」—賽斯.高汀

本系列文章之連結

  • 從turtle海龜動畫學習Python-高中彈性課程1 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 2 安裝 Python, 線上執行 Python link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 3 烏龜繪圖 所需之Python基礎 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 4 烏龜開始畫圖 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 5 用函數封裝重複性指令-呼叫函數令烏龜畫正 n 邊形 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 6 畫多重旋轉圓,螺旋正方形 link

  • 從turtle海龜動畫 學習 Python - 7 遞歸 recursive - 高中彈性課程系列 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 8 碎形 (分形 fractal) link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 8.1 碎形 L-system link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 9 Python 物件導向介紹 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 9.1 Python 物件導向的練習 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 10 藝術畫 自定義海龜形狀 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 10.1 藝術畫 python繪製天然雪花結晶 https://blog.csdn.net/m0_47985483/article/details/122262036 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 10.2 藝術畫 Python 製作生成式藝術 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 11.1 氣泡排序 - 用 turtle 呈現演算法之執行動作 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 11.2 maze 迷宮 - 用 turtle 呈現演算法之執行動作 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 11.3 連分數演算法與轉轉相除法- 用 turtle 呈現演算法之執行動作 link

  • 從turtle海龜動畫 學習 Python - 高中彈性課程系列 11.4 最短路徑 Dijkstra- 用 turtle 呈現演算法之執行動作 link



主題: 列舉一些網路上見到的, 用電腦產生美麗圖形的例子, 挑選數學味道較重的,

以下我們列舉一些網路上見到的, 用電腦程式或某些軟體產生美麗的圖形的例子, 挑選數學味道較重的, 許多都是用程式語言 processing 來繪製, (或是 在 Processing 打開 Python mode, 語法是 Python, 但是繪圖指令是 Processing 才有的)
我們之後會再分篇討論是否可以用 Python 來製作類似的效果.

Sher Minn Chong 螢幕保護程式與生成式藝術

exploring the beauty of algorithms with generative art - talk
https://youtu.be/Y1bPsh1mFUI link
SM C (Sher Minn Chong)
本影片講者來自馬來西亞, 她提到這些早年的螢幕保護程式其實就是生成式藝術的濫觴!
(可惜 Linux RedHat 7 或 8 的那些碎形的螢幕保護程式, 當時曾令我極為驚嘆, 這個演講並沒有講到, 我一直不知如何找到他們的原始碼.)
螢幕保護程式與生成式藝術
螢幕保護程式與生成式藝術

螢幕保護程式與生成式藝術
本影片講者自己做的:
螢幕保護程式與生成式藝術
螢幕保護程式與生成式藝術

Koch 島圍繞著8個小 Koch 島所形成的磁磚:
螢幕保護程式與生成式藝術

Coding Cassowary

他有一系列用 Python 繪製 generative art 的教學:
https://www.youtube.com/playlist?list=PLBLV84VG7Md9oO4MUOhyqz7gBFOzx8XIw link

Generative art in Python: Basic Tiling

https://youtu.be/Cm_SzDlQ2cM link

Generative art in Python: Basic Tiling
觀看次數:1,405次
2022年2月20日

This video is the the start for a a new series of videos on how you can create generative art in Python using the Turtle module. In this first video I cover one of the most basic techniques in generative art which is tiling. The canvas is divided recursively into a number of small areas. In each of these areas a line is randomly drawn in one of two possible ways. And with just a few levels of recursion this can already lead to some surprising results.

Contents
00:00 Introduction
01:35 Turtle basics
04:00 Vertical and horizontal lines
06:02 Recursive tiling
10:24 First results
12:05 Diagonal lines

Generative art in Python Basic Tiling
我照著他的影片走一遍, 把第一份tiling 的線條是垂直的程式碼試成功:

# Generative art in Python Basic Tiling.py
# 20220704 Noted by Prof. P-J Lai MATH NKNU
# 初版, 沒有使用 theme.py
##https://youtu.be/Cm_SzDlQ2cM
##Generative art in Python: Basic Tiling

from turtle import *
#from theme import set_theme
import random

setup(800, 800)

def tiling(x, y, s, level):
    # We have reached the final level recursion
    # and we now draw
    if level == 0:
        # 隨機畫直線段或橫線段
        if random.random() < 0.5:
            penup()
            goto(x,y-s)
            pendown()
            goto(x, y+s)
        else:
            penup()
            goto(x-s, y)
            pendown()
            goto(x+s, y)

    # Split the screen and go to next level of recursion
    else:
        s /= 2
        level -= 1
        # 左上區塊繼續分支
        tiling(x-s, y+s, s, level)
        # 右上區塊
        tiling(x+s, y+s, s, level)
        # 左下區塊
        tiling(x-s, y-s, s, level)
        # 右下區塊
        tiling(x+s, y-s, s, level)

################
width(2)
hideturtle()
tracer(False)

tiling(0,0,400,5)

tracer(True)
exitonclick()

Generative art in Python: Nested Squares

https://youtu.be/XruRIaB01Ls link

Coding Cassowary
329 位訂閱者
In this video we have a look at an early piece of computer-generated art. The canvas is tiled with squares. Within each of these “outer” squares there are a bunch of “inner” squares stacked into one another. Random offsets in either direction make for a 3D-like overall effect.

Contents:
00:00 Introduction
02:07 draw_squares( )
05:15 Drawing the outer squares
06:50 Drawing the inner squares
09:20 Shrinkage
10:58 set_theme( )

Generative art in Python: Nested Squares

以下是我嘗試的程式碼, 特別注意, 這份會用到他加寫的 theme.py,
我是照著他的影片, 自己打入他的 theme.py 的 codes 存成 theme.py,
需要在一開始引入
from theme import set_theme
其實不使用也沒關係, theme.py 只是一個畫布呈現風格的設定檔, 較方便使用而已:

# Generative_art_in_Python_NestedSquares_set_theme.py
#比前一版 Generative_art_in_Python_NestedSquares.py
# 增加 from theme import set_theme
# 20220630 Noted by Prof. P-J Lai MATH NKNU

# Generative art in Python_Nested Squares

# https://youtu.be/XruRIaB01Ls

##Coding Cassowary

from turtle import *
from theme import set_theme
import random

def draw_square(x, y, s):
    penup()
    goto(x-s/2, y-s/2)
    pendown()
    for i in range(4):
        forward(s)
        left(90)
        
##setup(800, 800)
##width(2)
##hideturtle()
##tracer(False)
set_theme(thickness=2)    
############
# codes:

noise = 5
size = 100
shrink = 15

for x in range(-300+int(size/2), 300, size):
    for y in range(-400+int(size/2), 400, size):
        # the draw the outer square
        draw_square(x, y, size)

        # determine the offsets
        x_off = random.uniform(-noise, noise)
        y_off = random.uniform(-noise, noise)

        # draw the inner suqares
        for i in range(6):
            draw_square(x+i*x_off, y+i*y_off, size-i*shrink)

################
tracer(True)
exitonclick()

以下是執行的結果:
Generative_art_in_Python_NestedSquares_ 使用shrink_2述

How To Draw With Code | Casey Reas

How To Draw With Code | Casey Reas, https://youtu.be/_8DMEHxOLQE
link

有很多數學的 motiv

YouTube上的:

Creators

For Casey Reas, software is the most natural medium to work with. He uses code to express his thoughts—starting with a sketch, composing it in code, and witnessing the imagery that it ultimately creates. We visit his studio to see how he uses color to convey emotion and how his programming language Processing is closing the gap between software and object.

The Creators Project is a partnership between Intel and VICE: http://thecreatorsproject.com/

Casey Reas 有一本書:
Casey Reas, Processing, second edition, A Programming Handbook for Visual Designers and Artists.

裡面有很多用 Processing 畫的有數學動機的美麗圖案, 讀者可以試著用 Python 重現看看,

Casey Reas

Casey Reas

Casey Reas
Casey Reas

Hari Dulal: Generative Art Tutorial for Beginners- Introduction to Processing

https://youtu.be/dGleb-w14w4 link
他的 YouTube站的影片, 有一系列 Generative Art 的入門影片, 有一些不是太難, 但是也很有數學之美的圖案, 也有難度較高的, 也是用 Processing 寫的,

Hari Dulal generative arts 系列- YouTube

  • Generative Art Tutorial for Beginners- Introduction to Processing
    https://youtu.be/dGleb-w14w4 link

  • Generative Art- Sinusoidal Circles
    https://youtu.be/DQAEfXFjn-A link

  • Generative Art- Sinusoidal Circles in Processing
    https://youtu.be/YOSSfVrzFwc link

  • Sinusoidal circles
    https://youtu.be/9Y9DipPhsb4 link

  • Generative Art Tutorial for Beginners- Trippy Rectangles Animation in Processing
    https://youtu.be/US-Y9q-wqV0 link

  • Sierpinski triangle (Fractal Triangle) from fractal tree…
    https://youtu.be/t_TO94uqvSU link
    碎形樹的動畫, 海龜繪圖較困難

  • Spot-light effect效果, 海龜繪圖較困難
    Generative Art- Spot-light effect and fractal tree in Processing
    https://youtu.be/N1I4WIquDN8 link

  • Generative Art- Kaleidoscope
    https://youtu.be/PMi2YZg8_zI link
    Hari Dulal

Perlin Noise 數位藝術家很常用的方法 用來產生流體的美

Generative Art using Perlin Noise in Processing
https://youtu.be/Z3tZM-Jxl7Y link
Hari Dulal

Generative Art using Perlin Noise in Processing
Hari Dulal 這個站對於原理, 幾乎很少解說,
Perlin Noise 是數位藝術家很常用的方法, 常用來產生流體的美, 詳細的說明可以看
I.2 Introduction - Perlin Noise and p5.js Tutorial
https://youtu.be/Qf4dIN99e2w link

Coding Challenge #24 Perlin Noise Flow Field
https://youtu.be/BjoM9oKOAKY link

Coding Challenge #24 Perlin Noise Flow Field
Live Stream #46 Perlin Noise and Flow Fields
彩色的
https://youtu.be/sor1nwNIP9A link
The Coding Train

Live Stream #46 Perlin Noise and Flow Fields彩色

Eric Davidson, TheBuffED

在 github上有不少難度較高的設計, Eric Davidson, https://github.com/erdavids/Generative-Art link

TheBuffED

Basic Introduction to Circle Packing
https://youtu.be/QkJHDIwPQ9E link
circle packing
circle packing

极创意MAXIDEA: 顛覆傳統的AR投影儀,能編輯投影區域,讓現實更虛幻

https://youtu.be/EWE5N4mQJSQ link

极创意MAXIDEA
22.7萬 位訂閱者

AR投影儀小助手,有了它,就可以全地形無縫完美投影,家裏隨便什麽東西、犄角旭旯隨便什麽地兒都能拿來顯示,而且還是在現實物體上疊加虛擬動畫,讓妳不用戴AR眼鏡就能看到夢幻的AR效果。

顛覆傳統的AR投影儀,能編輯投影區域,讓現實更虛幻0

顛覆傳統的AR投影儀,能編輯投影區域,讓現實更虛幻1

顛覆傳統的AR投影儀,能編輯投影區域,讓現實更虛幻2

顛覆傳統的AR投影儀,能編輯投影區域,讓現實更虛幻3

顛覆傳統的AR投影儀,能編輯投影區域,讓現實更虛幻4

20211007【潮玩科技】藝術科技體驗展

20211007【潮玩科技】藝術科技體驗展
https://youtu.be/aF6TXriRBT8 link

Now 財經 新聞
19萬 位訂閱者
【Now財經台】以科技創作數碼化的藝術作品,是不少藝術家追求的方向,隨著NFT興起,解決了版權保護、交易對價以及收藏等難題,數碼藝術變得有價有市。

要用到 演算法, 人工智能
以科技創作數碼化的藝術作品要用到 演算法, 人工智能

在这里插入图片描述

Processing艺术编程: 从迷宫生成算法到创意编程, AI遷移學習畫畫

https://www.youtube.com/channel/UCpvDfd3kBdGvNV9Sw6fSH_A/featured link

Processing艺术编程
770 位訂閱者
迷宫生成算法虽然原理简单,但我们可以用它串联起很多有意思的领域。


AI遷移學習畫畫:
设计师之光,最好的Processing中文教程,Processing之完全介绍
https://youtu.be/6SEUWJ82OXI link

rocessing以其超强的视觉表现力和易学的语法成为很多设计师和艺术家的得力武器,以及大量编程初学者的入门语言。,


Loren Sherman: Generative Art

https://youtu.be/cKzK88y3o1Q link

Loren Sherman
515 位訂閱者
This is all just a bunch of lines of code.

Loren Sherman_Generative Art_0

Loren Sherman_Generative Art_1

Loren Sherman_Generative Art_2

Brain Flicks: 用 Python 的 turtle 模組畫美麗的設計藝術圖 Top 15 Python Design Using Turtle

用 Python 的 turtle 模組畫美麗的設計藝術圖
https://youtu.be/hPsjMTz-aDQ link
Brain Flicks
2250 位訂閱者
How to design beautiful art work in Python Using Turtle.
Using Turtle Library in Python we can design anything like shown in this video.
This video is just an introduction or say output of the codes that we will be going to see further this this series.
In upcoming videos i will explain the code in best possible way i can.
Comment Down the design you Like the most and Any name if you got any name for any design. Feel free to comment down below.
Codes will be given either on my website or on GitHub Soon.
Keep Supporting Keep Loving And KEEP CREATING

Our Website►https://www.gyanbucket.com

Top 15 Python Design Using Turtle  Must Watch  1 Minute Craft_6_31秒

codewithnaim: Create a favorite design python turtle Graphics

https://youtu.be/rG2MeJiixnM link
codewithnaim
64 位訂閱者
In this tutorial to provide the knowledge of -PYTHON TURTLE GRAPHICS- to learn the python and practice from here and this python function.

#python create a tree with turtle design
https://youtu.be/G37YAx6IqAc

#python create a star turtle design
https://youtu.be/OoYab3LX-Q8

more videos

#python Create sun rises | turtle tutorial_#03
https://youtu.be/GfQCd5vDiZw

new design turtle tutorial_01
https://www.youtube.com/watch?v=aFTqZ…

turtle tutorial 01
https://youtu.be/mnuI2m1TUrs

best to very nice turtle graph
https://youtu.be/TA2Usp0rtA8

turtle graphic python best graphic
https://youtube.com/shorts/FYvdXHHV9n…

installing vs code to full setup in python programmer
https://youtu.be/0pTNEoAkW-U

#this tutorial code in--

import turtle as tu
import colorsys as cs
tu.setup(800,800)
tu.speed(0)
tu.tracer(10)
tu.width(2)
tu.bgcolor("black")
for j in range(25):
    for i in range(15):
        tu.color(cs.hsv_to_rgb(i/15, j/25, 1))
        tu.right(90)
        tu.circle(200-j*4,90)
        tu.left(90)
        tu.circle(200-j*4,90)
        tu.right(180)
        tu.circle(50,24)
tu.hideturtle()
tu.done()

Create a favorite design  python turtle Graphics  #tutorial_#04

References

  • Casey Reas, Processing, second edition, A Programming Handbook for Visual Designers and Artists.

  • How To Draw With Code | Casey Reas, https://youtu.be/_8DMEHxOLQE
    link

  • Generative Art- Kaleidoscope
    https://youtu.be/PMi2YZg8_zI

  • Eric Davidson, 在 github上有不少難度較高的設計, Eric Davidson, https://github.com/erdavids/Generative-Art
    link

  • Eric Davidson, Basic Introduction to Circle Packing
    https://youtu.be/QkJHDIwPQ9E link

  • 美麗的圖形 https://www.pinterest.com/drnagy18/fonalgrafika1/ link

  • Python带你找回童年的万花尺, http://baijiahao.baidu.com/s?id=1651085589151024260 link

  • 使用python成为藝術家, https://my.oschina.net/u/4531265/blog/4278176 link

  • 等等!等高線居然可以有非凡的藝術氣質?!https://www.getit01.com/p2018041735235656/ link

  • Python——畫一棵漂亮的樱花樹, https://blog.csdn.net/weixin_43943977/article/details/102691392 link
    非常漂亮的樹!

  • 生成式藝術和演算法創作07 L, https://zhuanlan.zhihu.com/p/50712698 link

  • Michael Hansmeyer:塑造不可思议, https://v.youku.com/v_show/id_XNDc4MDM2NzA4.html link

  • https://youtu.be/qtPi0JvmWbs
    Generative Art
    生成藝術暑期工作營
    東南大學建築學院 建築運算與應用研究所

  • (Sher Minn Chong) exploring the beauty of algorithms with generative art - talk
    https://youtu.be/Y1bPsh1mFUI link

  • Sher Minn Chong Make art with JavaScript!
    https://youtu.be/HiCK8e1ElRQ link

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值