<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pife5734</id>
	<title>Medien Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pife5734"/>
	<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/Special:Contributions/Pife5734"/>
	<updated>2026-05-16T23:34:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=IFD:Kolloq_SS16&amp;diff=80076</id>
		<title>IFD:Kolloq SS16</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=IFD:Kolloq_SS16&amp;diff=80076"/>
		<updated>2016-03-24T14:56:33Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: /* Syllabus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[:Category:Kolloquium|Kolloquium]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;Lehrperson:&#039;&#039; [[Michael Markert]], [[Jason Reizner]], [[Martin Schied]], [[Florian Wittig]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;Bewertung:&#039;&#039; up to 6 [[ECTS]] (depending on the relevant study version), 2 [[SWS]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;Termin:&#039;&#039; periodically Wednesdays, &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10:00 to 12:00 h&amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;Ort:&#039;&#039; Marienstraße 7b, Raum 101 &#039;&#039;&#039;subject to change!&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;First Meeting:&#039;&#039; Wed, April 20th, 10 am &#039;&#039;&#039;subject to change!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Beschreibung==&lt;br /&gt;
Das Interface-Design Kolloquium lädt unregelmäßig Mittwochs zu einem kleinen Vortrag aus der Praxis (von Studierenden, Gästen oder Mitarbeitern) ein. Im Anschluss wird über das Thema des Vortrags diskutiert.&lt;br /&gt;
&lt;br /&gt;
==English description==&lt;br /&gt;
We are inviting students, guests and lecturers to present their works. There will be a brief discussion afterwards.&lt;br /&gt;
&lt;br /&gt;
== Anmeldung ==&lt;br /&gt;
Der Besuch ist offen für alle und erfordert keine Anmeldung&lt;br /&gt;
&lt;br /&gt;
==Zielgruppe==&lt;br /&gt;
Alle Bachelor- und Master-Studenten, Absolventen und Mitarbeiter der Professur Interface-Design.&lt;br /&gt;
&lt;br /&gt;
== Hinweise für Vortragende ==&lt;br /&gt;
&lt;br /&gt;
Normalerweise gibt es zwei Redner pro Termin. Es gibt einen Beamer (VGA-Connector!), wenn Sie Sound oder einen Computer benötigen, melden Sie sich bitte bei [[User:Mm|Michael]]. Falls Sie die Präsentation auf einem USB-Stick mitbringen, dann bitte entweder als Mac-Keynote oder als PDF. Wir haben nur eventuell Zugriff auf einen Windows-PC mit Powerpoint.&lt;br /&gt;
&lt;br /&gt;
Ein Internetzugang steht über das WiFi Netzwerk &amp;quot;eduroam&amp;quot; zur Verfügung. Falls Sie kein Universitätslogin haben, melden Sie sich bitte rechtzeitig, damit wir einen Gastzugang beantragen können.&lt;br /&gt;
&lt;br /&gt;
Sie können Ihre Vortragssprache (Deutsch/Englisch) frei wählen. Es sind jedoch üblicherweise 5 bis 10% fremdsprachige Teilnehmer anwesend, die i.d.R. besser Englisch als Deutsch verstehen.&lt;br /&gt;
&lt;br /&gt;
Die Präsentation sollte eine Dauer von etwa ~20 Minuten haben. Bitte haben Sie Verständnis dafür, wenn wir nach spätestens 30 Minuten abbrechen, denn wir möchten noch genügend Zeit für Feedback, Fragen und kurze Anschlussdiskussionen haben.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes for Speakers ==&lt;br /&gt;
&lt;br /&gt;
If you feel you have something interesting to share, please contact us. We are always looking for interesting things to share and talk about.&lt;br /&gt;
&lt;br /&gt;
Typically, we have two presentations per meeting. There is a projector with VGA Connector. If you need Sound or a Computer, please contact [[User:Mm|Michael]]. If you bring your presentation on a USB-Stick, please use either Mac-Keynote or PDF, because we may or may not find a Windows-PC with Powerpoint.&lt;br /&gt;
&lt;br /&gt;
To connect to the internet, you can use the &amp;quot;eduroam&amp;quot; WiFi network. If you have no University login, please get in touch, so we can arrange a guest account.&lt;br /&gt;
&lt;br /&gt;
The language of your talk (German/English) is up to you to decide. Usually, there are about 5 to 10% Students that understand English better than German.&lt;br /&gt;
&lt;br /&gt;
The presentation should have a duration of about ~ 20 minutes. Please understand that we need to stop the talk after 30 minutes latest, because there should be time for feedback, questions and short discussions.&lt;br /&gt;
&lt;br /&gt;
==Syllabus==&lt;br /&gt;
Vorläufiger Semesterplan:&lt;br /&gt;
  BITTE MINIMAL + MAXIMAL ZWEI VORTRÄGE PRO TERMIN!&lt;br /&gt;
  DIE VERANSTALTUNG FINDET NUR STATT, WENN ES ZWEI VORTRÄGE GIBT!&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;del&amp;gt;Wed, 06.April: no meeting due to LOPEC fair in Munich&amp;lt;/del&amp;gt;&lt;br /&gt;
# &amp;lt;del&amp;gt;Wed, 13. April: no meeting due to staff member meeting&amp;lt;/del&amp;gt;&lt;br /&gt;
# Wed, 20. April: Emma Gonzalez (Master Thesis), Arezoo Araznoor (Praktikum Report)&lt;br /&gt;
# Wed, 27. April: Apasri Titatarn(Master Thesis)&lt;br /&gt;
# Wed, 04. May: tba&lt;br /&gt;
# Wed, 11. May: tba&lt;br /&gt;
# &amp;lt;del&amp;gt;Wed, 18. May: no meeting (Pfingsten)&amp;lt;/del&amp;gt;&lt;br /&gt;
# Wed, 25. May: tba&lt;br /&gt;
# Wed, 01. June: tba&lt;br /&gt;
# Wed, 08. June: tba&lt;br /&gt;
# Wed, 15. June: tba&lt;br /&gt;
# &amp;lt;del&amp;gt;Wed, 22. June: no meeting (Eignungsprüfungen)&amp;lt;/del&amp;gt;&lt;br /&gt;
# Wed, 29. June: tba&lt;br /&gt;
# Wed, 06. July: tba&lt;br /&gt;
# &amp;lt;del&amp;gt;Wed, 13. July: no meeting due to Summaery preparations&amp;lt;/del&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  MINIMUM + MAXIMUM TWO PRESENTATIONS PER DAY!&lt;br /&gt;
  THE KOLLOQUIUM WILL ONLY TAKE PLACE IF THERE ARE TWO PRESENTATIONS!&lt;br /&gt;
&lt;br /&gt;
== Previous Semesters ==&lt;br /&gt;
* [[IFD:Kolloq WS15]]&lt;br /&gt;
* [[IFD:Kolloq SS15]]&lt;br /&gt;
* [[IFD:Kolloq WS14]]&lt;br /&gt;
* [[IFD:Kolloq SS14]]&lt;br /&gt;
* [[IFD:Kolloq WS13]]&lt;br /&gt;
* [[IFD:Kolloq SS12]]&lt;br /&gt;
* [[IFD:Kolloq WS12]]&lt;br /&gt;
* [[IFD:Kolloq SS13]]&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* tba&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74146</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74146"/>
		<updated>2015-10-16T10:03:25Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final result take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trace back what the source image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINAL BOT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
more examples of the final result !!&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|320 px]]&lt;br /&gt;
[[File:Kaleidoexample2.gif|320 px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The complete code of the final version can be found here in the GitHub link&#039;&#039;&#039;. [https://github.com/AaeApasri/KaleidoGIFBot]&lt;br /&gt;
feel free to download and develop it further if you are interested.  ;)&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74145</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74145"/>
		<updated>2015-10-16T09:57:36Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
more examples of the final result !!&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|320 px]]&lt;br /&gt;
[[File:Kaleidoexample2.gif|320 px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The complete code of the final version can be found here in the GitHub link&#039;&#039;&#039;. [https://github.com/AaeApasri/KaleidoGIFBot]&lt;br /&gt;
feel free to download and develop it further if you are interested.  ;)&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74022</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74022"/>
		<updated>2015-10-11T19:50:35Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
more examples of the final result !!&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|320 px]]&lt;br /&gt;
[[File:Kaleidoexample2.gif|320 px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The complete code of the final version can be found here in the GitHub link&#039;&#039;&#039;. [https://github.com/AaeApasri/KaleidoGIFBot]&lt;br /&gt;
feel free to download and develop it further if you are interested.  ;)&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74016</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74016"/>
		<updated>2015-10-08T12:08:45Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
more examples of the final result !!&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|320 px]]&lt;br /&gt;
[[File:Kaleidoexample2.gif|320 px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The complete code of the final version can be found here in the GitHub link&#039;&#039;&#039;.&lt;br /&gt;
feel free to download and develop it further if you are interested.  ;)&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74015</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74015"/>
		<updated>2015-10-08T12:07:02Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|320 px]]&lt;br /&gt;
[[File:Kaleidoexample2.gif|320 px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The complete code of the final version can be found here in the GitHub link&#039;&#039;&#039;.&lt;br /&gt;
feel free to download and develop it further if you are interested.  ;)&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74014</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74014"/>
		<updated>2015-10-08T12:05:31Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|320 px]]&lt;br /&gt;
[[File:Kaleidoexample2.gif|320 px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74013</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74013"/>
		<updated>2015-10-08T12:04:30Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|320 px]]&lt;br /&gt;
[[File:Kaleidoexample2.gif|320 px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74012</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74012"/>
		<updated>2015-10-08T12:03:39Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|300 px]]&lt;br /&gt;
[[File:Kaleidoexample2.gif.gif|300 px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidoexample2.gif&amp;diff=74011</id>
		<title>File:Kaleidoexample2.gif</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidoexample2.gif&amp;diff=74011"/>
		<updated>2015-10-08T12:03:33Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74010</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74010"/>
		<updated>2015-10-08T11:58:39Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|900px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|350 px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74009</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74009"/>
		<updated>2015-10-08T11:57:25Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif|400 px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74008</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74008"/>
		<updated>2015-10-08T11:56:43Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif| 500px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidoexample3.gif.gi| 500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74007</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74007"/>
		<updated>2015-10-08T11:56:34Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif| 500px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidoexample3.gif.gi| 500pxf]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74006</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74006"/>
		<updated>2015-10-08T11:55:50Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidoexample3.gif.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74005</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74005"/>
		<updated>2015-10-08T11:54:56Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidoexample3.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74004</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74004"/>
		<updated>2015-10-08T11:53:50Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
[[File:Kaleidoexample3.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FINISHING STEP&#039;&#039;&#039;&lt;br /&gt;
Last step . . . for the summaery event , I improved a bit the quality of the &lt;br /&gt;
GIF by editing the code to be able to make best quality it can and also the final GIF is not larger that the twitter status update limit.&lt;br /&gt;
&lt;br /&gt;
So I added lines of code to get the size of the final GIF and resize it if it exceed the limit.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code of the final version can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidoexample3.gif.gif&amp;diff=74003</id>
		<title>File:Kaleidoexample3.gif.gif</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidoexample3.gif.gif&amp;diff=74003"/>
		<updated>2015-10-08T11:53:23Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: uploaded a new version of &amp;amp;quot;File:Kaleidoexample3.gif.gif&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidoexample3.gif.gif&amp;diff=74002</id>
		<title>File:Kaleidoexample3.gif.gif</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidoexample3.gif.gif&amp;diff=74002"/>
		<updated>2015-10-08T11:52:44Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74001</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74001"/>
		<updated>2015-10-08T11:34:58Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 3 Making the bot works online&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74000</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=74000"/>
		<updated>2015-10-08T11:33:07Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 3 Making the bot works online&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73999</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73999"/>
		<updated>2015-10-08T11:32:21Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 3 Making the bot works online&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
Link : [KaleidoGIF twitter|https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73998</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73998"/>
		<updated>2015-10-08T11:31:06Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 3 Making the bot works online&lt;br /&gt;
&lt;br /&gt;
The @kaleidogif twiiter account is created to be the page for the bot. &lt;br /&gt;
( Before that I just did trial and errors with my own account)&lt;br /&gt;
Link : [https://twitter.com/kaleidogif]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Botscreen1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Botscreen1.PNG&amp;diff=73997</id>
		<title>File:Botscreen1.PNG</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Botscreen1.PNG&amp;diff=73997"/>
		<updated>2015-10-08T11:27:28Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73984</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73984"/>
		<updated>2015-10-07T14:31:27Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Botexamplegif2.gif]]&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73983</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73983"/>
		<updated>2015-10-07T14:29:55Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
[[File:Kaleidogif2.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete code can be found here in the GitHub link.&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Botexamplegif2.gif&amp;diff=73982</id>
		<title>File:Botexamplegif2.gif</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Botexamplegif2.gif&amp;diff=73982"/>
		<updated>2015-10-07T14:29:37Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73981</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73981"/>
		<updated>2015-10-07T14:15:40Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|210 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73980</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73980"/>
		<updated>2015-10-07T14:14:55Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |200px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|250 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73979</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73979"/>
		<updated>2015-10-07T14:14:16Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png|200 px]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidogif1.gif&amp;diff=73978</id>
		<title>File:Kaleidogif1.gif</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidogif1.gif&amp;diff=73978"/>
		<updated>2015-10-07T14:10:54Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: uploaded a new version of &amp;amp;quot;File:Kaleidogif1.gif&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73977</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73977"/>
		<updated>2015-10-07T14:09:29Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png]]&lt;br /&gt;
[[File:Kaleidogif1.gif]]&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidogif1.gif&amp;diff=73976</id>
		<title>File:Kaleidogif1.gif</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidogif1.gif&amp;diff=73976"/>
		<updated>2015-10-07T14:08:29Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73975</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73975"/>
		<updated>2015-10-07T13:21:34Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
[[File:Botexample1.png]]&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73974</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73974"/>
		<updated>2015-10-07T13:20:51Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
[[File:&lt;br /&gt;
Botexample1.png]]&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Botexample1.png&amp;diff=73973</id>
		<title>File:Botexample1.png</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Botexample1.png&amp;diff=73973"/>
		<updated>2015-10-07T13:20:20Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73972</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73972"/>
		<updated>2015-10-07T13:15:34Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
In the code, I made the variable &#039;n&#039; and &#039;a&#039; to be able to adjust the the result GIF file. &lt;br /&gt;
n is the number of the rotation time&lt;br /&gt;
a is the degree of the rotation&lt;br /&gt;
&lt;br /&gt;
so they will affect how smooth the animated GIF going to be.&lt;br /&gt;
&lt;br /&gt;
This is the example result.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73971</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73971"/>
		<updated>2015-10-07T13:11:23Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  &lt;br /&gt;
&lt;br /&gt;
I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73970</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73970"/>
		<updated>2015-10-07T13:10:28Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The next step is to make the bot gives more feeling of Kaleidoscope. The nice part of Kaleidoscope is whhen one rotate it around and see the abtract patterns moving.  I try to make it the similar feeling here with the bot that each still image is so abstact but when one finish watching the whole loop of rotation then you will have clue about what is the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart2.jpg]]&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73969</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73969"/>
		<updated>2015-10-07T13:05:05Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 1: Still Kaleido&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like but it is the preparation for the next step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STEP 2 : moving Kaleido&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73968</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73968"/>
		<updated>2015-10-07T13:02:57Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
As can be seen here,in this step, the final resault take only small part of the source image.&lt;br /&gt;
&lt;br /&gt;
It is quite difficult to trance back what the sorce image look like. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidochart2.jpg&amp;diff=73967</id>
		<title>File:Kaleidochart2.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidochart2.jpg&amp;diff=73967"/>
		<updated>2015-10-07T12:58:17Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73966</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73966"/>
		<updated>2015-10-07T12:42:29Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. &lt;br /&gt;
I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
&lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73965</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73965"/>
		<updated>2015-10-07T12:42:01Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
My midtern project is making a image processing bot which make a kaleidoscope style image out of an image. I want the result to look nice and  can totally show the kaleidoscope style whatever the source image is. &lt;br /&gt;
This is the structure of how I &#039;kaleidify&#039; the source image.&lt;br /&gt;
&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73964</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73964"/>
		<updated>2015-10-07T12:37:44Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
[[File:kaleidochart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidochart1.jpg&amp;diff=73963</id>
		<title>File:Kaleidochart1.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidochart1.jpg&amp;diff=73963"/>
		<updated>2015-10-07T12:36:24Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: uploaded a new version of &amp;amp;quot;File:Kaleidochart1.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidochart1.jpg&amp;diff=73962</id>
		<title>File:Kaleidochart1.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=File:Kaleidochart1.jpg&amp;diff=73962"/>
		<updated>2015-10-07T12:35:49Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&lt;br /&gt;
== Copyright status: ==&lt;br /&gt;
&lt;br /&gt;
== Source: ==&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73961</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73961"/>
		<updated>2015-10-07T12:08:27Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Cloud Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73960</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73960"/>
		<updated>2015-10-07T12:07:15Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
	<entry>
		<id>https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73959</id>
		<title>GMU:Bots &#039;n&#039; Plots/Apasri Titatarn</title>
		<link rel="alternate" type="text/html" href="https://www.uni-weimar.de/kunst-und-gestaltung/wiki/index.php?title=GMU:Bots_%27n%27_Plots/Apasri_Titatarn&amp;diff=73959"/>
		<updated>2015-10-07T12:06:50Z</updated>

		<summary type="html">&lt;p&gt;Pife5734: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;APASRI TITATARN : Bots n Plots class&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First touch with Python . . . .gettin to know how to draw basic shapes&lt;br /&gt;
&lt;br /&gt;
Here is my first drawing in class with coding. &lt;br /&gt;
my sheep robot. . . funny one &lt;br /&gt;
[[File:Sheep.png |100px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My Aim about this class :&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;quot; I would like to make imageBot and furthur step would be to make it move as &lt;br /&gt;
short animated GIF&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Homework 2nd week&#039;&#039;&#039;&lt;br /&gt;
Assignment to make your own moving robot.&lt;br /&gt;
&lt;br /&gt;
This is my CloudBot. A cloud with falling  snowflakes GIF.&lt;br /&gt;
I coded in processing with python language. &lt;br /&gt;
Here is the code . . .&lt;br /&gt;
&lt;br /&gt;
[[File:Cloud_bot_s.gif]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----Code----&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:smaller&amp;quot; &amp;gt;&lt;br /&gt;
#cloud&lt;br /&gt;
width = 400&lt;br /&gt;
posx = [width/4,width/3,3*width/5,width/2,width/5,2*width/3,3.8*width/5,width/2.3]&lt;br /&gt;
&lt;br /&gt;
def setup():&lt;br /&gt;
    size(400,400)&lt;br /&gt;
    background(255)&lt;br /&gt;
    frameRate(12)&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
def draw():&lt;br /&gt;
    noStroke()&lt;br /&gt;
    background(179,226,228)&lt;br /&gt;
    change= sin(frameCount*0.1)&lt;br /&gt;
    drawcloud(change)&lt;br /&gt;
    sx= width/2&lt;br /&gt;
    n = frameCount&lt;br /&gt;
    textsnow(posx,change)&lt;br /&gt;
  &lt;br /&gt;
    saveFrame(&amp;quot;cloudbot##.jpg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
def drawcloud(change):&lt;br /&gt;
    print change&lt;br /&gt;
    fluffy = change*5&lt;br /&gt;
    fill(255)&lt;br /&gt;
    #cloud 1 S&lt;br /&gt;
    ellipse(1.25*width/5,0.9*height/1.8,80+fluffy,80+fluffy)&lt;br /&gt;
    #cloud 2 M&lt;br /&gt;
    ellipse(2*width/5,height/1.8-height/10,130+2*fluffy,120+1.5*fluffy)&lt;br /&gt;
    #cloud 3 L&lt;br /&gt;
    ellipse(2.7*width/5,0.95*height/1.8-height/10,120+fluffy,145+fluffy)&lt;br /&gt;
    #cloud 4 M&lt;br /&gt;
    ellipse(3.5*width/5,height/1.8-height/10,110+2.5*fluffy,110+2*fluffy)&lt;br /&gt;
    &lt;br /&gt;
    #face&lt;br /&gt;
    fill(80)&lt;br /&gt;
    ellipse(width/3,height/2,7,7)&lt;br /&gt;
    ellipse(2*width/3,height/2,7,7)&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
def textsnow(posx,change):&lt;br /&gt;
    fill(255)&lt;br /&gt;
    textSize(32)&lt;br /&gt;
    i=0&lt;br /&gt;
    while i &amp;lt;7:&lt;br /&gt;
        text(&amp;quot;*&amp;quot;,posx[i]+change*i,height/1.8+frameCount*(i+1)/5)&lt;br /&gt;
        i =i+1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TwitterBot :MID TERM ASSIGNMENT&lt;br /&gt;
======Kaleidoscope Bot=======&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
RESULT PICTURE&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2558-06-16 at 7.43.39 PM.png]]&lt;br /&gt;
[[File:Screen Shot 2558-06-17 at 12.03.18 AM.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
code for the image processing&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
def makekaleido():&lt;br /&gt;
#put image path&lt;br /&gt;
    imgfile = &amp;quot;img.jpg&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
&lt;br /&gt;
#adjust the source image a bit for nicer result&lt;br /&gt;
    base = source.rotate(31)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/14 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (x/3,int(0.9*y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
#print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
#pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    output.save(&amp;quot;final.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
    makekaleido()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I also made the gif version of Kaleidoscope by make 35 different images each turning 10 degree of the source image.&lt;br /&gt;
&lt;br /&gt;
Source image : illustration from Oliver Jeffers&lt;br /&gt;
[[File:JEFFERS&amp;gt;JPG]]&lt;br /&gt;
&lt;br /&gt;
This is the code of Gif Version&lt;br /&gt;
&lt;br /&gt;
[[Media:jeffers.gif |Example result .GIF]]&lt;br /&gt;
&lt;br /&gt;
======Kaleidoscope 360 GIF ========&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size:normal&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
from PIL import Image, ImageDraw,ImageFilter&lt;br /&gt;
import PIL.ImageOps as im&lt;br /&gt;
import numpy as np&lt;br /&gt;
import moviepy.editor as mpy&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def onepic():&lt;br /&gt;
    global output&lt;br /&gt;
	#creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, base.size, (255,255,255,0))&lt;br /&gt;
    x, y = base.size&lt;br /&gt;
    print(&amp;quot;base size: %sx%s&amp;quot;%(x,y))&lt;br /&gt;
&lt;br /&gt;
# one variable to vary the size of triangle&lt;br /&gt;
    var = y/28 &lt;br /&gt;
&lt;br /&gt;
# Define triangle mask position (triangle with 20 degree)&lt;br /&gt;
    (originx,originy) = (int(0.4*x),int(y))&lt;br /&gt;
    trih = int(12*var)  #fix formular for triangle height&lt;br /&gt;
    triw = int(4.2*var) #fix formular for triangle width&lt;br /&gt;
    polygonpos = [(originx,originy),&lt;br /&gt;
    (originx+triw,originy), &lt;br /&gt;
    (originx+triw/2,originy-trih)]&lt;br /&gt;
    print(trih,triw)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Create mask&lt;br /&gt;
    draw = ImageDraw.Draw(mask,&#039;RGBA&#039;)&lt;br /&gt;
    draw.polygon(polygonpos,(0,0,0,255))&lt;br /&gt;
    del draw&lt;br /&gt;
    mask.save(&amp;quot;mask.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Get the Alpha band from the template&lt;br /&gt;
    tmplt = Image.open(&#039;mask.png&#039;)&lt;br /&gt;
    A = tmplt.split()[3]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make one piece of triangle on transparent bg&lt;br /&gt;
    [R,G,B]=base.split()&lt;br /&gt;
    tri = Image.merge(&#039;RGBA&#039;, (R, G, B, A))&lt;br /&gt;
&lt;br /&gt;
#crop it to the exact size of triangle!! to create primary pattern&lt;br /&gt;
#box (left, top , right, buttom)&lt;br /&gt;
    box =(originx,(originy-trih),(originx+triw),originy)&lt;br /&gt;
    pattern_plain=tri.crop(box)&lt;br /&gt;
    pattern_plain.save(&#039;pattern_plain.png&#039;)&lt;br /&gt;
    print(&#039;....pattern created....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# add style to pattern&lt;br /&gt;
    pattern = pattern_plain&lt;br /&gt;
    #pattern= pattern_plain.filter(ImageFilter.EDGE_ENHANCE)&lt;br /&gt;
    pattern.save(&#039;pattern_tri.png&#039;)&lt;br /&gt;
    print(&#039;....stylized pattern....&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#make square canvas for the output (wide = double size of height of primary pattern)&lt;br /&gt;
    canvas =Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
    canvas.save(&#039;tmpcanvas.png&#039;)&lt;br /&gt;
    pcanvas=Image.new(&#039;RGBA&#039;,(2*trih,2*trih), (255,255,255,0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#put pattern on the canvas&lt;br /&gt;
#make sure to put the tip of the triangle at the center of the canvas&lt;br /&gt;
#because when we rotate the center of the object is the pivot point&lt;br /&gt;
#note: paste command require the coordinate of top left corner&lt;br /&gt;
#so point to paste the pattern is . . .&lt;br /&gt;
    ccenterx = int(trih-triw/2) &lt;br /&gt;
    canvas.paste(pattern_plain,(ccenterx,trih))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# start rotate the pattern around every 40 degree&lt;br /&gt;
&lt;br /&gt;
    for i in range (0,360,40):&lt;br /&gt;
        tmpcanvas = canvas&lt;br /&gt;
        tmppat = canvas.rotate(i)&lt;br /&gt;
        canvas= Image.alpha_composite(tmpcanvas,tmppat)&lt;br /&gt;
&lt;br /&gt;
# now we get half of the things&lt;br /&gt;
    half = canvas&lt;br /&gt;
    print(&#039;half already&#039;)&lt;br /&gt;
#mirror the half and put in the space to create simple kaleidoscpoe effect&lt;br /&gt;
    mirror = im.mirror(half)&lt;br /&gt;
    half2= mirror.rotate(20)&lt;br /&gt;
    print(&#039;mirrored&#039;)&lt;br /&gt;
&lt;br /&gt;
#merge 2 half&lt;br /&gt;
    output=Image.alpha_composite(half,half2)&lt;br /&gt;
    output.save(&amp;quot;output.png&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#def makegif():&lt;br /&gt;
    #clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    #clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
&lt;br /&gt;
def makekaleido(image) :&lt;br /&gt;
    global base, filename, source, imgfile, n, outfilename&lt;br /&gt;
    #IN CASE Working on filename in the laptop&lt;br /&gt;
    #put image path&lt;br /&gt;
    imgfile = &amp;quot;tweetimg.jpg&amp;quot;&lt;br /&gt;
    filename = imgfile[:-4]&lt;br /&gt;
    print(filename)&lt;br /&gt;
    &lt;br /&gt;
    #load Image&lt;br /&gt;
    source = Image.open(imgfile)&lt;br /&gt;
    &lt;br /&gt;
    #source = image.copy()&lt;br /&gt;
    x, y = source.size&lt;br /&gt;
&lt;br /&gt;
    if x &amp;gt; 1000:&lt;br /&gt;
        newy = int(1000*y/x)&lt;br /&gt;
        source =source.resize((1000,newy), Image.ANTIALIAS)&lt;br /&gt;
        print(&#039;resize to %sx%s&#039;%source.size)&lt;br /&gt;
&lt;br /&gt;
    #creat mask base the same size with source image &lt;br /&gt;
    mask = Image.new(&#039;RGBA&#039;, source.size, (255,255,255,0))&lt;br /&gt;
    print(&amp;quot;mask size:%sx%s&amp;quot;%source.size)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    #rotate source n times for a degree&lt;br /&gt;
    n= 10&lt;br /&gt;
    outfilename=[]&lt;br /&gt;
    for a in range(n+n-2):&lt;br /&gt;
        outfilename.insert(a,&#039;0&#039;)&lt;br /&gt;
    a= 10&lt;br /&gt;
    base = source&lt;br /&gt;
    for i in range(n):&lt;br /&gt;
        base = source.rotate(31+i*a)&lt;br /&gt;
        onepic()&lt;br /&gt;
        output.save(&#039;%s%s.png&#039;%(filename,i))&lt;br /&gt;
        outfilename[i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
        if i!=0:&lt;br /&gt;
            outfilename[2*n-2-i] = filename+str(i)+&#039;.png&#039;&lt;br /&gt;
    &lt;br /&gt;
    clip = mpy.ImageSequenceClip(outfilename, fps=3)&lt;br /&gt;
    clip.write_gif(&amp;quot;%s.gif&amp;quot;%filename)&lt;br /&gt;
    image2 = Image.open(&#039;tweetimg3.png&#039;)&lt;br /&gt;
&lt;br /&gt;
    return image2,clip&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
if __name__ == &#039;__main__&#039;:&lt;br /&gt;
&lt;br /&gt;
    makekaleido(image)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pife5734</name></author>
	</entry>
</feed>