Programming For Artists - PowerPoint PPT Presentation

1 / 74
About This Presentation
Title:

Programming For Artists

Description:

... tandem bikes, for example, all share the characteristics of bicycles (current ... features that make them different: tandem bicycles have two seats and two ... – PowerPoint PPT presentation

Number of Views:144
Avg rating:3.0/5.0
Slides: 75
Provided by: dare
Category:

less

Transcript and Presenter's Notes

Title: Programming For Artists


1
Programming For Artists
Lesson 6
2
Photomontage possibilities for
your mini-projects.
3
This will be a mini-project which you will
present during the last Programming For Artists
class on Saturday September 17th 10 am
4
This week well look briefly at the history of
photomontage and some techniques for creating
photomontage computationally. The project will be
an opportunity to look at arrays, different types
of translations and image processing filters.
5
The writer Katherine Hayles argues that we live
in an age of intermediation that challenges our
ideas about language, subjectivity, literary
objects, and textuality. This process of
intermediation takes place where digital media
interact with cultural practices associated with
older media..
6
  • Photomontage goes back to the earliest days of
    photography
  • It is linked to the technological deficiencies
    of the emerging medium
  • Landscape photographers in particular found that
    they had difficulty getting the
  • exposure correct for both the land and the sky,
    to get round this difficulty they
  • resorted to creating two images and then
    combing them to create a landscape
  • Image with the correct exposures, these
    combination prints or composite images
  • represent the birth of photo-montage.
  • The technical term for creating photomontage is
    compositing

7
      Oscar G. Rejlander   The Two Ways of Life
1857
Photographic purists frowned upon the practice of
composite photography which was actually banned
by the French Photographic Society.
Other Photographers such as Oscar G. Rejlander
used composite images to create works that
continued the painting traditions of previous
centuries
8
Henry Peach Robinson, Fading Away, composite or
combination print 1858
9
A variety of methods for making composite
photographs was discovered during the Victorian
era. The more complex examples were constructed
in the darkroom using multiple exposures onto the
same plate, with unexposed areas being masked by
pieces of black velvet, presaging the precise
realism of the likes of John Heartfield who
employed professional photographers to seamlessly
blend his ideas in the darkroom. Other images
were produced from a more primitive "cut and
paste" technique, and the final picture then
re-photographed, an approach to montage that has
persisted ever since, and still finds favour with
some of today's montage artists like Sean Hillen
Sean Hillens work has been engaged thematically
with The British military presence in Northern
Ireland
Sean Hillen http//www.irelantis.com/
10
Victorian photomontage 1902
Anonymous
11
But it was not until the revolutionary era
following the "Great War" that artists began to
see the use of montage as a truly new art form.
The centre of this explosion of creativity was
Berlin, where the Dada group of artists were
looking for a new means of expression one that
had more meaning than the prevailing drift into
abstraction, but that did not simply return to
the traditions of figurative painting.
12
"Montage" in German means "fitting" or "assembly
line" and "monteur" means "mechanic" or
"engineer". John Heartfield, the best known
practitioner of montage who used to work in
overalls, came to be known as Monteur Heartfield,
in recognition of his attitude to the world of
art. Hannah Höch, who uniquely continued to
produce montages throughout her long and varied
life, said "Our whole purpose was to integrate
objects from the world of machines and industry
into the world of art."
13
                            There will always
be an argument over who invented the word
"photomontage". What is not at issue is that it
was one of the members of the Berlin Dada group
the debate is about which one. This is hardly
surprising since much of the early montage work
was the result of collaboration, and many early
works are credited to more than one artist. So
the official (and diplomatic) version is that the
five exponents of Dada montage, John Heartfield,
Hannah Höch, Johannes Baader, Raoul Hausmann, and
George Grosz all agreed that their new art form
required a new name (to distinguish it from the
painterly collage of the Cubists.)
Johh Heartfield
Hannah Höch,
Raoul Hausmann
14
Raoul Hausmann
15
Hannah Höch
16
Illustration by John Heartfield on cover of
Arbeiter-Internationale-Zeitung October 1932.
Millionen stehen hinter mir!I've got millions
standing behind me
17
As Surrealism became the dominant European art
form, photomontage gradually faded into obscurity
for many years, until there was a revival in the
1960s, partly inspired by a renewed interest in
Dada. Several of the artists connected with the
Pop Art movement used magazine photos and text to
convey the ethos of the age. At this time, and to
an extent in response to the increasing populism
of art, advertisers jumped on the bandwagon and
started to produce more photomontages, a trend
that continues to this day.
Richard Hamilton
18
The next great revival in the use of montage in
Europe was connected with the politics of the
anti-nuclear movement of the 1980s. Much of the
imagery at this time was designed for use in
banners for demonstrations, producing a very
graphic means of communication.
Peter Kennard has spent most of his life in
London, and has been considerably more involved
than most in the capital's political gatherings
during the last 25 years.
19
As a young artist he was a painter, much
influenced by the "intense and merciless"
etchings of Goya. Dissatisfied with painting's
lack of immediacy, he took up photomontage for
its ability to show the "unrevealed truth" behind
the image.
      Peter Kennard Defended To Death 1982  
20
Jeff Wall
21
David Hockney Photomontage
22
David Hockney Photomontage
23
MICHAEL DICKINSON (Istanbul Collage Stuckists)
Website does come with a warning that it contains
images that may be offensive http//www.stuckism.c
om/Dickinson/New.html
24
Mark Napier's Shredder 1.0
25
Shredder 1.0 works by passing the code in which a
Web page is written through a Perl script, a
rudimentary program that parses and rearranges
the original code before handing it off to your
Web browser. Although traces of the original
site's design and content can sometimes be
identified in the distorted logos and fragments
of text that remain, 'the shredded versions more
closely resemble the non-representational
paintings of Hans Hoffman or Gerhard Richter than
the slick interfaces of the Web sites from which
Napier's compositions derive. Napier's approach
to Net art reflects his own background as a
painter the images that Shredder 1.0 generates
demonstrate a refined awareness of color and
shape. Hans Hoffman and other Abstract
Expressionists reduced painting to its intrinsic
formal characteristics, such as the flatness of
the picture plane and the plasticity of paint.
Napier draws our attention to the fundamental
technological properties of the Internet, from
the complexity of code to the variability of
images.
26
The ethics of photomontage A photomontage may
contain elements at once real and imaginary.
Two-dimensional representation of physical space
in a picture is, by definition, an illusion. Such
combined photos and digital manipulation can set
up a collision between aesthetics and ethics -
for instance, in faked news photographs that are
presented to the world as real. In the United
States, for example, the National Press
Photographers Association (NPPA) have set out a
Code of Ethics promoting the accuracy of
published images, advising that photographers "do
not manipulate images ... that can mislead
viewers or misrepresent subjects."4
27
The Composograph The Composograph refers to a
retouched photographic collage popularized by
publisher and physical culture advocate Bernarr
Macfadden in his New York Graphic in
1924. "Composographic" images were literally
cut and pasted together using images of current
celebrities and staged images created in
Macfadden's in-house studio, often using
newspaper staffers. They represented events that
were inconvenient to photograph, particularly
with the equipment of the day private bedrooms
and bathtubs, Rudolph Valentino's unsuccessful
surgery, Valentino's funeral, and notably on St.
Patrick's Day 1927, a full-page image of
Valentino meeting Enrico Caruso in heaven. The
very first faked photograph -- that of Alice
Jones Rhinelander baring her breast in court
(part of the Kip Rhinelander divorce trial) -- is
said to have boosted the Graphic's circulation by
100,000.
28
  • So what might the use of a computer add to or
    change about this art form?
  • What are computers good at doing?
  • Sorting
  • Storing
  • Transforming
  • Copying
  • Networking
  • Mass production and dissemination
  • More specifically, certain types of
    interactivity, image processing, generative and
  • autonomous processes
  • Its up to us to make full use of the medium, to
    invent new ways of working with
  • older forms.

29
Programming with images
30
Basic method for randomly placing and rotating an
image, The image(s) will be in a different place
every time you run the program
This isnt random, its a way of getting the
width and height of the image Here its halved.
Its still affected by the rotation though. look
up the scale() function in the Processing
reference pages for another way of changing image
sizes,( including rects and ellipses)
31
The following photomontages were generated by
using exactly the same code over and over again
on lots of different images, Casey Reas also
writes the same transformation methods over and
over again
32
(No Transcript)
33
(No Transcript)
34
  • But you now know there are more efficient ways of
    doing this, such as
  • Creating a method (function) to perform
    transformations
  • Writing the method once but calling it many
    times over
  • We could also load the images on a loop
  • The images could be stored in an array (we will
    look at arrays today)

35
Once you have learnt about arrays you can start
to create your own filters by directly
manipulating the array of pixels that digital
images are made from
But First we will look at some Ready made image
processing functions or filters
36
Image Processing Filters
The call to save() will save an image file that
has been transformed by this filter in your
sketch folder, so there is actually no need to
print screen as we did before, if you want to
capture what is in the processing window, just
use save()and give a file name and type as an
argument to the method.
37
(No Transcript)
38
Start Processing, find an image file and try
these different filters, I am sure most of you
have looked at them before, so now Insert the
right code to save an image file which has been
processed. Practice drawing the Image at
different sizes. Save the file in different
formats with different names and filter Effects.

Uncomment these, you can use combinations to
build up composite effects
39
Easy way to make an image transparent
40
Load the image in draw() if you want it refreshed
41
These filters could be interestingly integrated
into a photo-collage program
42
The next few pages have reproduced Casey Reass
code for his Collage Engine, Hes kept the actual
techniques simple, for good reasons I am sure,
but that simplicity means the code is also in
some ways unwieldy and too longits a perfect
candidate for creating a nice neat method,
preferably one that can be overloaded
43
/ Synthesis 1 Form and Code, Collage
Engine by Casey Reas (www.processing.org) p.
150 Step 2, working with many images.
More advanced code structures such as
functions, arrays, and objects can make this
code shorter. / PImage nyt01
loadImage("nyt_01.jpg") PImage nyt02
loadImage("nyt_02.jpg") PImage nyt03
loadImage("nyt_03.jpg") PImage nyt04
loadImage("nyt_04.jpg") PImage nyt05
loadImage("nyt_05.jpg") PImage nyt06
loadImage("nyt_06.jpg") PImage nyt07
loadImage("nyt_07.jpg") PImage nyt08
loadImage("nyt_08.jpg") PImage nyt09
loadImage("nyt_09.jpg") PImage nyt10
loadImage("nyt_10.jpg") PImage nyt11
loadImage("nyt_11.jpg") PImage nyt12
loadImage("nyt_12.jpg") PImage nyt13
loadImage("nyt_13.jpg") PImage nyt14
loadImage("nyt_14.jpg") PImage nyt15
loadImage("nyt_15.jpg") PImage nyt16
loadImage("nyt_16.jpg") PImage nyt17
loadImage("nyt_17.jpg") PImage nyt18
loadImage("nyt_18.jpg") PImage nyt19
loadImage("nyt_19.jpg") PImage nyt20
loadImage("nyt_20.jpg") PImage nyt21
loadImage("nyt_21.jpg") PImage nyt22
loadImage("nyt_22.jpg") PImage nyt23
loadImage("nyt_23.jpg") PImage nyt24
loadImage("nyt_24.jpg") PImage nyt25
loadImage("nyt_25.jpg") PImage nyt26
loadImage("nyt_26.jpg") PImage nyt27
loadImage("nyt_27.jpg") PImage nyt28
loadImage("nyt_28.jpg") PImage nyt29
loadImage("nyt_29.jpg") float x, y, r
size(600, 600) smooth() background(255) tint(
255, 204) x random(width) y
random(height) r random(0, TWO_PI) pushMatrix(
) translate(x, y) rotate(r) image(nyt01,
-nyt01.width/2, -nyt01.height/2) popMatrix()
Continued gtgtgtgt
44
x random(width) y random(height) r
random(0, TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt02, -nyt02.width/2,
-nyt02.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt03, -nyt03.width/2,
-nyt03.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt04, -nyt04.width/2,
-nyt04.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt05, -nyt05.width/2,
-nyt05.height/2) popMatrix()
Continued gtgtgtgt
45
x random(width) y random(height) r
random(0, TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt06, -nyt06.width/2,
-nyt06.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt07, -nyt07.width/2,
-nyt07.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt08, -nyt08.width/2,
-nyt08.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt09, -nyt09.width/2,
-nyt09.height/2) popMatrix()
Continued gtgtgtgt
46
x random(width) y random(height) r
random(0, TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt10, -nyt10.width/2,
-nyt10.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt11, -nyt11.width/2,
-nyt11.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt12, -nyt12.width/2,
-nyt12.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt13, -nyt13.width/2,
-nyt13.height/2) popMatrix()
Continued gtgtgtgt
47
x random(width) y random(height) r
random(0, TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt14, -nyt14.width/2,
-nyt14.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt15, -nyt15.width/2,
-nyt15.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt16, -nyt16.width/2,
-nyt16.height/2) popMatrix()
Continued gtgtgtgt
48
x random(width) y random(height) r
random(0, TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt17, -nyt17.width/2,
-nyt17.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt18, -nyt18.width/2,
-nyt18.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt19, -nyt19.width/2,
-nyt19.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt20, -nyt20.width/2,
-nyt20.height/2) popMatrix()
Continued gtgtgtgt
49
x random(width) y random(height) r
random(0, TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt21, -nyt21.width/2,
-nyt21.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt22, -nyt22.width/2,
-nyt22.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt23, -nyt23.width/2,
-nyt23.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt24, -nyt24.width/2,
-nyt24.height/2) popMatrix()
Continued gtgtgtgt
50
x random(width) y random(height) r
random(0, TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt25, -nyt25.width/2,
-nyt25.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt26, -nyt26.width/2,
-nyt26.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt27, -nyt27.width/2,
-nyt27.height/2) popMatrix() x
random(width) y random(height) r random(0,
TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt28, -nyt28.width/2,
-nyt28.height/2) popMatrix()
Continued gtgtgtgt
51
x random(width) y random(height) r
random(0, TWO_PI) pushMatrix() translate(x,
y) rotate(r) image(nyt29, -nyt29.width/2,
-nyt29.height/2) popMatrix() saveFrame("Synthe
sis-1--" int(random(0, 1000)) ".tif")
//this saves a frame, could also be
conditionally connected //to a mouse //click for
(see example slide 48)
Continued gtgtgtgt
52
So even though the code looks pretty complicated
we can see that it is just the repetition of one
idea randomly placing and rotating a
photographic Image.
So to repeat save() in Processing will save
an image of the display window by default it
saves in .tif format, but others are available,
such as jpg and tga So writing save(myImage.jp
g) After some lines of code relating to
drawing images will save a shot of the display
window in the current sketches folder. If I had
code like this line(0, 0, width,height) line(wid
th, 0, 0, height) save(myLines.tif) it will
save the display with the two lines on screen If
I wrote this line(0, 0, width,height) save(myLi
nes.tif) line(width, 0, 0, height) It will
only save an image of the first line. if you
call save() in draw() you will generate an image
every time the frame is refreshed which will
overwrite your image file each time, but you can
also save sequential images With saveFrame()
without a parameter it will save every frame
sequentially, generating huge numbers of images,
read up on controlling this online at
Processing.org and see the example (slide
42) putting save() in an event like
mousePressed() will save everything when draw()
has finished See over
53
void mousePressed() print("hello") save("myMo
use.jpg") To get this to work I had to rewrite
Mr Reass code, it wont work in the previous
example which is simplified, you may notice there
is no draw() method and no visible setup() method
in his code. I had to add these and reconfigure
the code to get mousePressed() to work. But his
code does produce Interesting and complex
arrangements of images very simply.
54
I reworked the code even further to create two
methods with overloaded versions for drawing the
images randomly, the code could be further
simplified with arrays and loops. Well look at
arrays today.
55
float x random(width) float y
random(height) float r random(0,
TWO_PI) PImage nyt01 PImage nyt02 PImage
nyt03 PImage nyt04 PImage nyt05 PImage
nyt06 PImage nyt07 PImage nyt08 PImage
nyt09 PImage nyt10 PImage nyt11 PImage
nyt12 PImage nyt13 PImage nyt14 PImage
nyt15 PImage nyt16 PImage nyt17 PImage
nyt18 PImage nyt19 PImage nyt20 PImage
nyt21 PImage nyt22 PImage nyt23 PImage
nyt24 PImage nyt25 PImage nyt26 PImage
nyt27 PImage nyt28 PImage nyt29
more efficient version of previous code using two
variations of a myDraw() method. It can still be
improved, by for example putting the images In
an array and loading them on a loop, methods
can also be invoked on a loop (well cover this
next week)
Continued gtgtgtgt
56
void setup() size(600, 600) smooth()
background(255) tint(255, 204) nyt01
loadImage("nyt_01.jpg") nyt02
loadImage("nyt_02.jpg") nyt03
loadImage("nyt_03.jpg") nyt04
loadImage("nyt_04.jpg") nyt05
loadImage("nyt_05.jpg") nyt06
loadImage("nyt_06.jpg") nyt07
loadImage("nyt_07.jpg") nyt08
loadImage("nyt_08.jpg") nyt09
loadImage("nyt_09.jpg") nyt10
loadImage("nyt_10.jpg") nyt11
loadImage("nyt_11.jpg") nyt12
loadImage("nyt_12.jpg") nyt13
loadImage("nyt_13.jpg") nyt14
loadImage("nyt_14.jpg") nyt15
loadImage("nyt_15.jpg") nyt16
loadImage("nyt_16.jpg") nyt17
loadImage("nyt_17.jpg") nyt18
loadImage("nyt_18.jpg") nyt19
loadImage("nyt_19.jpg") nyt20
loadImage("nyt_20.jpg") nyt21
loadImage("nyt_21.jpg") nyt22
loadImage("nyt_22.jpg") nyt23
loadImage("nyt_23.jpg") nyt24
loadImage("nyt_24.jpg") nyt25
loadImage("nyt_25.jpg") nyt26
loadImage("nyt_26.jpg") nyt27
loadImage("nyt_27.jpg")
Continued gtgtgtgt
57
nyt28 loadImage("nyt_28.jpg") nyt29
loadImage("nyt_29.jpg") void draw() float
x random(width) float y random(height)
float r random(0, TWO_PI) noLoop() //also
nice when it loops //call two versions of
myDraw() myDraw("nyt_01.jpg", x, y, r)
myDraw("nyt_07.jpg", 23.5, 34.5, 123.3)
myDraw("nyt_24.jpg") myDraw("nyt_25.jpg")
myDraw("nyt_26.jpg") myDraw("nyt_27.jpg")
myDraw("nyt_28.jpg") myDraw("nyt_29.jpg")
//first myDraw() method has one parameter,
defining the name of an image void
myDraw(String p) String im p PImage
nyt01 loadImage(im) pushMatrix()
translate(x, y) rotate(r) image(nyt01,
-nyt01.width/2, -nyt01.height/2) popMatrix()

Statements between pushMatrix() and
popMatrix() constitute a transformation
matrix.This example shifts the origin To a new
location then rotates the image around it
58
x random(width) y random(height) r
random(0, TWO_PI) //second myDraw() method
with four parameters the image name and t1 and
t2 which //moves the origin (0, 0) to alternative
points, this is useful to make objects
rotate //around the middle of the widnow for
example, instead of the left hand top
corner void myDraw(String p, float t1, float t2,
float rote) float x t1 float y t2
float r rote String im p PImage nyt01
loadImage(im) pushMatrix() translate(x,
y) rotate(r) image(nyt01, -nyt01.width/2,
-nyt01.height/2) popMatrix() x
random(width) y random(height) r
random(0, TWO_PI) //if mouse is pressed
capture an image of window void mousePressed()
print("hello") save("myMouse.jpg")
Putting save() in a mousePressed() function lets
us Grab and save a screenshot
59
Arrays
60
  • Using an array to call images randomly
  • Using an array to generate random sentences
  • Drawing arrays of text to the screen

61
Arrays
An array is a list of data. It is possible to
have an array of any type of data. Each piece of
data in an array is identified by an index number
representing its position in the array. The first
element in the array is 0, the second element
is 1, and so on. Arrays are similar to objects,
so they must be created with the keyword new.
Every array has a variable length which is an
integer value for the total number of elements in
the array.
62
Simple array
void setup() size(200, 200) String
stringy stringy new String4
stringy0 "hi" stringy1 "goodbye"
stringy2 "whatever" stringy3
"hoooray" print(stringy2) // is
like saying "print the String at place (or more
properly 'index') number 2" //remember arrays
start at 0, so "whatever" is indexed at number 2
in the array
Declare an array
Create an array with the word new
Assign values to the array
We know there are a number different ways of
declaring and assigning values to variables,
this is also true of arrays, (Though the ways are
a bit different)
63
Simple array
Declare, create and assign values to an array in
one go
void setup() size(200, 200) String stringy
"hi", "goodbye", "whatever", "hoooray"
print(stringy3) // is like saying print the
String at place number 3 //remember arrays
start at 0, so hooray" is indexed at number 3 in
the array
64
Simple array
Declare and create an array
void setup() size(200, 200) String stringy
new String4 //4 is like saying the number of
slots we will use stringy0 "hi"
stringy1 "goodbye" stringy2
"whatever" stringy3 "hoooray"
print(stringy0) // is like saying print the
String at place number 0 //remember arrays
start at 0, so hi" is indexed at place 0 in the
array
Then assign values to the array
65
Using a for loop to read through or access array
elements
void setup() size(200, 200) String stringy
"hi", "goodbye", "whatever", "hoooray"
for(int i 0 i lt stringy.length i)
print(" " stringyi) // loop through the
array, 'stringy.length number of times, I.e
0, 1, 2, 3
Stops the loop going beyond the length of our
array
66
//NOW TRY THIS, WHAT HAPPENS? void setup()
size(200, 200) String stringy "hi",
"goodbye", "whatever", "hoooray" for(int i
0 i lt 10 i) //i.e. replace 'stringy.length'
with //10 and see what happens print(" "
stringyi)
we get an ArrayIndexOutofBoundsException
4 Because we have said get me the thing at
index number 4 but there is no index number 4.
This example stops at 3 0, 1, 2, 3
67
Using an array to generate coordinates
68
with images
Try this, use the array for coordinates wih an
image file Note how the filter works with each
iteration re-inverting the image
69
Use an array to randomly choose different images
70
Generating random strings
Full code gtgtgtgt
71
//generating random Strings
  • PFont fontA
  • String myarray2 "where have you been, how
    are you? ", "hello there ", "Wow! ", "You are so
    random ", "that is a crazy bit of code! ","Oops
    you did it again "
  • String myarray Minna ", "Carol ", "Maya ",
    "Kathy ", "Eleanor
  • int r1
  • int r2
  • void setup()
  • size(500, 150)
  • fontA loadFont("SFComicScript-24.vlw")//you
    might need to change the font
  • //create a font automatically by going into
    'tools' then
  • //'create font', processing will see the fonts
    you
  • //have available on your system
  • textFont(fontA, 24)//define which font you are
    using and what size
  • //you might use many fonts in one program
  • r1 (int)random(myarray.length)//I want two
    different random numbers, otherwise it would be
    too predictable
  • r2 (int)random(myarray2.length) //both
    random numbers will be from 0 to the array
    length, this
  • //will stop us getting an 'array index out of
    bounds' error, i.e the mumber will always be in a
    suitable range

72
  • Next class well look
    at
  • directly manipulating images through a pixel
    array
  • well also at loading images more efficiently
    (with an array and a loop)
  • and invoking methods through an array.
  • Alpha masks and a fabulous array of other items!

73
Interactive Digital Photomontage
Research http//grail.cs.washington.edu/projects/
photomontage/
Sean Hillen http//www.irelantis.com/
Historical information about composite
photographs http//www.musee-mccord.qc.ca/en/keys
/virtualexhibits/notmanstudio/themes/composites/
Photomontage artists on the web http//www.collag
eart.org/photomontage/ Interactive photomontage
narratives http//www.gerard-bertrand.net/index.ht
m
74
lab 6, 7 and 8
So your lab 6, 7 and 8 work is to research and
design your own photomontage or image-based
project. It could involve sounds and or data
visualisation, animation and interaction. It's up
to you. It's an opportunity to consolidate some
of the techniques weve looked at and for you to
research the art historical, social and political
context of your work. Your photomontage can be
political, educational, abstract etc. You will
present it on the last class (sept 17th) show
sketches or whatever planning tools you
used, and please reference your contextual
research materials and discoveries.
Write a Comment
User Comments (0)
About PowerShow.com