Chapter 13: Creating and Modifying Movies. Chapter Objectives.

67
Chapter 13: Creating and Modifying Movies

Transcript of Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Page 1: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Chapter 13: Creating and Modifying Movies

Page 2: Chapter 13: Creating and Modifying Movies. Chapter Objectives.
Page 3: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Movies, animations, and video…oh my!We’re going to refer generically to captured

(recorded) motion as “movies.”This includes motion entirely generated by

graphical drawings, which are normally called animations.

This also includes motion generated by some kind of photographic process, normally called video.

Page 4: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Psychophysics of Movies:Persistence of VisionWhat makes movies work is yet another

limitation of our visual system: Persistence of vision

We do not see every change that happens in the world around us.

Instead, our eye retains an image (i.e., tells the brain “This is the latest! Yup, this is still the latest!”) for a brief period of time.If this were not the case, you would be aware

of every time that your eye blinks because the world would “go away” for a moment.

Page 5: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

16 frames and it’s motionIf you see 16 separate pictures in one second,

and these pictures are logically sequenced,That is, #2 could logically follow from the scene

in #1.16 pictures of completely different things

doesn’t work,You will perceive the pictures as being in

motion.16 frames per second (fps), 16 pictures in a

second, is the lower bound for the sensation of motion.

Page 6: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Beyond 16 fpsEarly silent pictures were 16 fps.Motion picture standards shifted to 24 fps to make

sound smoother.Videocameras (digital video) captures 30 fpsHow high can we go?

Air force experiments suggest that pilots can recognize a blurb of light in 1/200th of a second!

Video game players say that they can discern a difference between 30 fps and 60 fps.

Bottomlines: Generate at least 16 fps and you provide a sense of

motion.If you want to process video, you’re going to have 30

fps to process (unless it’s been modified elsewhere for you.)

Page 7: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Processing moviesOur frames are going to be JPEG pictures.

One JPEG file per frame.So, if we’re going to be processing movies,

we’re going to generating or processing sequences of JPEG files.

Three tools for manipulating movies <-> JPEGsMediaToolsQuickTime Pro (free QuickTime won’t do it)Windows Movie Maker (for converting image

sequences to movies)

Page 8: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Using MediaToolsTo generate a series of

frame pictures in a folder from an MPEG file.

To play a folder of frame pictures and to save it as a JMV file. (JPEG Movie format.)

To play JMV or MPEG movies.

Page 9: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

What the other tools can doQuickTime Pro

(http://www.apple.com/quicktime) can read a sequence of JPEG images and produce MPEG, AVI, or QuickTime movies.

Windows Movie Maker can create WMV (Windows Media Player movies) from image sequences.

ImageMagick (open source toolkit) can also read a sequence of JPEG images and produce MPEG movies.

Page 10: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

• Open an image sequence• Choose the first image in the sequence.• Specify a frame rate

• POOF! You get a movie!

Page 11: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

QuickTime Pro: Make images from movieChoose “Export”

from File menu.Choose as Image

Sequence.Click “Options” to

choose image format (PNG, JPEG) and frames per second.

This will save a numbered sequence of images.

Page 12: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Windows Movie Maker: Making a movie from imagesFree with most Windows installations.Choose “Import Pictures” and select all the

images in your sequence.

Page 13: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Windows Movie Maker: Creating the MovieSet the “Options” (Tools menu) so that there

is a small duration between pictures.Drag all the pictures into the timeline.Play and export your movie!

Page 14: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

MPEG? QuickTime? AVI? JMV?MPEG, QuickTime, and AVI are compressed movie

formats.They don’t record every frame.Rather, they record some key frames, and then store

data about what parts of the screen change on intervening frames.

MPEG is an international standard, from the same people who invented JPEG.

AVI is a Microsoft standard.QuickTime is an Apple standard.

JMV is a file consisting of JPEG frames in an array. All frames represented

Page 15: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Why do we compress movies?Do the math:

One second of 640x480 pixels at 30 fps30 (frames) * 640 * 480 (pixels) = 9,216,000 pixelsWith 3 bytes of color per pixel, that’s 27,648,000

bytes or 27 megabytes of information per second.For a 90 minute feature movie (short), that’s 90 *

60 * 27,648,000 = 149,299,200,000 bytes (149 gigabytes)

A DVD stores 6.47 gigabytes of data.So even on a DVD, the movie is compressed.

Page 16: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

MPEG movie = MPEG frames plus MP3 soundtrackAn MPEG movie is actually a series of MPEG

frames composed with an MP3 soundtrack.It’s literally two files stuck together in one.

We’re not going to deal with sound movies for now.The real challenge in doing movie processing is

generating and manipulating frames.

Page 17: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Get the frames in orderMany tools (including os.listdir()) can process

frames in order if the order is specified.We specify the order by encoding the number

of the frame into the name.If you put in leading zeroes so that everything

is the same length, the order is alphabetical as well as numerical.

Page 18: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Movies in JESmakeMovieFromInitialFile(firstFile) will

create a movie object from the image sequence starting from that file.

playMovie(movie) opens a movie player on the movie object. You can write out QuickTime or AVI movies from there.

Page 19: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Simple Motiondef makeRectMovie(directory ):

for num in range (1 ,30): #29 frames (1 to 29)canvas = makeEmptyPicture (300 ,200)addRectFilled(canvas ,num * 10, num * 5, 50,50, red)# convert the number to a stringnumStr=str(num)if num < 10:

writePictureTo(canvas ,directory+"\\ frame0"+numStr+".jpg")

if num >= 10:writePictureTo(canvas ,directory+"\\

frame"+numStr+".jpg")movie = makeMovieFromInitialFile(directory+"\\ frame00.jpg");return movie

Page 20: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

A Few Frames

frame00.jpg frame02.jpg frame50.jpg

Page 21: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Making and Playing the Movie>>> rectM = makeRectMovie("c:\\ Temp \\

rect")>>> playMovie(rectM)

Page 22: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Important cool thing: You can draw past the end of the picture!addText, addRect, and the rest of the

drawing tools will work even if you go beyond the edge of the drawing.Drawings will clip what can’t be seen in them,

so you don’t get an array out of bounds error.This is a big deal, because it means that you

don’t have to do complicated math to see when you’re past the end of the drawing. But only for the drawing functions. If you set pixels, you’re still on your own to stay in

range.

Page 23: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Making a tickertapedef tickertape(directory,string):

for num in range(1,100): #99 framescanvas = makeEmptyPicture(300,100)#Start at right, and move leftaddText(canvas,300-(num*10),50,string)# Now, write out the frame# Have to deal with single digit vs. double digit frame numbers differentlynumStr=str(num)if num < 10:

writePictureTo(canvas,directory+"//frame0"+numStr+".jpg")if num >= 10:

writePictureTo(canvas,directory+"//frame"+numStr+".jpg")

Page 24: Chapter 13: Creating and Modifying Movies. Chapter Objectives.
Page 25: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Can we move more than one thing at once? Sure!def movingRectangle2(directory ): for num in range (1 ,30): #29 frames

canvas = makeEmptyPicture (300 ,250)# add a filled rect moving linearlyaddRectFilled(canvas ,num*10,num*5, 50,50,red)# Let’s have one just moving aroundblueX = 100+ int (10 * sin(num))blueY = 4*num+int (10* cos(num))addRectFilled(canvas ,blueX ,blueY ,50,50, blue)# Now , write out the frame# Have to deal with single digit vs. double digitnumStr=str(num)if num < 10:

writePictureTo(canvas ,directory +"// frame0 "+ numStr +". jpg")if num >= 10:

writePictureTo(canvas ,directory +"// frame "+ numStr +". jpg")

Page 26: Chapter 13: Creating and Modifying Movies. Chapter Objectives.
Page 27: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Moving a clip from a picturedef moveHead(directory ):

markF=getMediaPath("blue -mark.jpg")mark = makePicture(markF)head = clip(mark ,275 ,160 ,385 ,306)for num in range (1 ,30): #29 frames printNow("Frame number: "+str(num)) canvas = makeEmptyPicture (640 ,480) # Now , do the actual copying copy(head ,canvas ,num*10,num *5) # Now , write out the frame # Have to deal with frame # digits numStr=str(num) if num < 10: writePictureTo(canvas ,directory+"// frame0"+numStr+".jpg") if num >= 10: writePictureTo(canvas ,directory+"// frame"+numStr+".jpg")

def clip(picture ,startX ,startY ,endX ,endY ):width = endX - startX + 1height = endY - startY + 1resPict = makeEmptyPicture(width ,height)resX = 0for x in range(startX ,endX ): resY =0 # reset result y index for y in range(startY ,endY ): origPixel = getPixel(picture ,x,y) resPixel = getPixel(resPict ,resX ,resY) setColor(resPixel ,( getColor(origPixel ))) resY=resY + 1 resX=resX + 1return resPict

Clip90 function returns part of another picture.Using general copy() function we defined earlier.

Page 28: Chapter 13: Creating and Modifying Movies. Chapter Objectives.
Page 29: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

What if we have over 100 frames?def writeFrame(num,directory,framepict): # Have to deal with single digit vs. double digit frame numbers

differently framenum=str(num) if num < 10: writePictureTo(framepict,directory+"//frame00"+framenum+".jpg") if num >= 10 and num<100: writePictureTo(framepict,directory+"//frame0"+framenum+".jpg") if num >= 100: writePictureTo(framepict,directory+"//frame0"+framenum+".jpg")

This will make all our movie-making easier — it’s generally useful

Page 30: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Rewriting moving Mark’s headdef moveHead2(directory ):

markF=getMediaPath("blue -mark.jpg")mark = makePicture(markF)face = clip(mark ,275 ,160 ,385 ,306)for num in range (1 ,30): #29 frames

printNow("Frame number: "+str(num))

canvas = makeEmptyPicture (640 ,480)

# Now , do the actual copyingcopy(face ,canvas ,num*10,num *5)# Now , write out the framewriteFrame(num ,directory ,canvas)

This code is much easier to read and understand with the subfunctions.

Page 31: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Using real photographsOf course, we can use any real photographs

we want.We can use any of the techniques we’ve

learned previously for manipulating the photographs.

Even more, we can use the techniques in new ways to explore a range of effects.

Page 32: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Slowly making it (very) sunsetRemember this code?What if we applied this to create frames of a

movie, but slowly increased the sunset effect?

def makeSunset(picture): for p in getPixels(picture): value=getBlue(p) setBlue(p,value*0.7) value=getGreen(p) setGreen(p,value*0.7)

Page 33: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

SlowSunsetdef slowsunset(directory): canvas = makePicture(getMediaPath("beach-smaller.jpg")) #outside

the loop! for frame in range(0,100): #99 frames printNow("Frame number: "+str(frame)) makeSunset(canvas) # Now, write out the frame writeFrame(frame,directory,canvas)

def makeSunset(picture): for p in getPixels(picture): value=getBlue(p) setBlue(p,value*0.99) #Just 1% decrease! value=getGreen(p) setGreen(p,value*0.99)

Not showing you writeFrame() because you know how that works.

Just one canvas repeatedly being manipulated

Page 34: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

SlowSunset frames

Page 35: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Fading by background subtractiondef swapbg(person, bg, newbg,threshold): for x in range(1,getWidth(person)): for y in range(1,getHeight(person)): personPixel = getPixel(person,x,y) bgpx = getPixel(bg,x,y) personColor= getColor(personPixel) bgColor = getColor(bgpx) if distance(personColor,bgColor) <

threshold: bgcolor = getColor(getPixel(newbg,x,y)) setColor(personPixel, bgcolor)

Remember background subtraction?

One change here is that the threshold is now an input.

Page 36: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Use the frame number as the thresholddef slowfadeout(directory): bg = makePicture(getMediaPath("wall.jpg")) jungle = makePicture(getMediaPath("jungle2.jpg")) for frame in range(0,100): #99 frames canvas = makePicture(getMediaPath("wall-two-

people.jpg")) printNow("Frame number: "+str(frame)) swapbg(canvas,bg,jungle,frame) # Now, write out the frame writeFrame(frame,directory,canvas)

Page 37: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

SlowFadeout

Page 38: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Different images, with subfunctions

def swapBack(pic1 , back , newBg , threshold ):for x in range(0, getWidth(pic1 )): for y in range(0, getHeight(pic1 )):p1Pixel = getPixel(pic1 ,x,y) backPixel = getPixel(back ,x,y) if (distance(getColor(p1Pixel),getColor(backPixel )) < threshold ): setColor(p1Pixel ,getColor(getPixel(newBg ,x,y)))return pic1

def slowFadeout(directory ): origBack =

makePicture(getMediaPath("bgframe.jpg"))

newBack = makePicture(getMediaPath("beach.jpg"))

for num in range (1 ,60): #59 frames# do this in the loopkid = makePicture(getMediaPath("kid -in -frame.jpg"))

swapBack(kid ,origBack ,newBack ,num)# Now , write out the framewriteFrame(num ,directory ,kid)

Page 39: Chapter 13: Creating and Modifying Movies. Chapter Objectives.
Page 40: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Dealing with real videoWe really can’t deal with live video.

Dealing with each frame takes a lot of processing.

If you were going to process each frame as fast as it was coming in (or going out), you’d have 1/30th of a second to process each frame!

We cheat bySaving each frame as a JPEG imageProcessing the JPEG imagesConvert the frames back to a movie

Page 41: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

The original kid-in-bg-seq movie

Page 42: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Let’s have Mommy “watching”We’ll paste Barb’s head into each frame.We’ll use os.listdir to process all the frames

of the kid sequence.

Page 43: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

MommyWatchingimport osdef mommyWatching(directory): kidDir="C:/ip-book/mediasources/kid-in-bg-

seq" barbF=getMediaPath("barbaraS.jpg") barb = makePicture(barbF) face = clip(barb ,22 ,9 ,93 ,97) num = 0 for file in os.listdir(kidDir ):

if file.endswith(".jpg"): num = num + 1 printNow("Frame number: "+str(num)) framePic = makePicture(kidDir+“/"+file) # Now , do the actual copying copy(face ,framePic ,num*3,num *3) # Now , write out the frame writeFrame(num ,directory ,framePic)

We process each frame, and copy Mommy’s head to the frame, just like we animated in a line before onto a blank canvas.

Page 44: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

MommyWatching

Page 45: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Lightening a pictureI took some video of a puppet show in black

light.Very hard to see the puppets.

Your eye can pick them up, but the camera can’t.

Recall earlier discussion: Your eye can detect luminance changes that no media can replicate.

Page 46: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Dark-fish2 sequence

Page 47: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

How I did the processingFirst try, lighten every pixel.

Didn’t work.Made all the black whiter as well as the colorsNo improvement in contrast

Second try, explore under MediaTools firstBlack parts are really blackLighter parts have really low number valuesSo:

Look for any pixel less black than black (threshold=8)

Lighten it a couple values

Page 48: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Lightenfishimport osdef lightenFish(directory): framenum = 0 for framefile in os.listdir(getMediaPath("dark-fish2")): framenum = framenum + 1 printNow("Frame: "+str(framenum)) if framefile.endswith(".jpg"): frame=makePicture(getMediaPath("dark-fish2")

+"//"+framefile) for p in getPixels(frame): color = getColor(p) if distance(color,black)>8: color=makeLighter(color) color=makeLighter(color) setColor(p,color) writeFrame(framenum,directory,frame)

Page 49: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Original sequence again

Page 50: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Same frames after lightening

Page 51: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Putting kids on the moonTook a video of our

kids crawling past a blue sheet.

Unfortunately, did it in front of electric light, not daylight.Not really blue.

If you chromakey against black, pants and eyeballs go away.

Page 52: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Code for putting kids on moonimport osdef kidsOnMoon(directory ):

kids="C://ip-book//mediasources//kids-blue"moon=getMediaPath("moon-surface.jpg")back=makePicture(moon)num = 0for frameFile in os.listdir(kids):

num = num + 1printNow("Frame: "+str(num))if frameFile.endswith(".jpg"):

frame=makePicture(kids+"//"+frameFile)for p in getPixels(frame ): if distance(getColor(p),black) <= 100:

setColor(p,getColor(getPixel(back ,getX(p),getY(p))))writeFrame(num ,directory ,frame)

Page 53: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Making underwater movies look betterWater filters out

red and yellow light.

We can color-correct underwater footage by increasing red and green.

Before:

After:

Page 54: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Code for fixing underwater footageimport osdef changeRedAndGreen(pict ,redFactor ,greenFactor ): for p in getPixels(pict ): setRed(p,int(getRed(p) * redFactor )) setGreen(p,int(getGreen(p) * greenFactor ))def fixUnderwater(directory ): num = 0 dir="C://ip -book//mediasources //fish" for frameFile in os.listdir(dir): num = num + 1 printNow("Frame: "+str(num)) if frameFile.endswith(".jpg"): frame=makePicture(dir+"//"+frameFile) changeRedAndGreen(frame ,2.0 ,1.5) writeFrame(num ,directory ,frame)

Creating a useful function to make the task easier.

Page 55: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Building an effect from the bottom upNotice that the underwater footage code was

made cleaner and clearer through use of an extra, “helper” function.Made the main function easier to read and

shorter to write.We can build visual effects “bottom-up” by

building helper functions first, then assembling them all.

Page 56: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Drawing with lightMany commercials

feature actors “drawing” with light.Light beams that

seem to hang in the air.

How could we do that?

Page 57: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Our AlgorithmThe light should create high luminance

pixels.1.From frame 1, for each pixel of high

luminance, copy the color to frame 2. Now frame 2 contains the high luminance

from frame 1 and from frame 2

2.Go on to frame 2 and 3, and back to step 1.Each frame now contains the “trace” of light

from all the previous frames.

Page 58: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

InputHaving my kids draw in darkness (to make

sure luminance difference is large) with flashlights and light sticks.

Page 59: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

What do we need?First step: Compute luminancedef luminance(apixel ):

return (getRed(apixel )+ getGreen(apixel )+ getBlue(apixel ))/3.0

Page 60: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Test the piecesAs we build each piece, we test it.You don’t want to build more on top of it until

you know this works!>>> pict = makeEmptyPicture (1,1)>>> pixel=getPixelAt(pict ,0 ,0)>>> whiteColor (255 , 255, 255)>>> setColor(pixel ,white)>>> luminance(pixel)255.0>>> blackColor(0, 0, 0)>>> setColor(pixel ,black)>>> luminance(pixel)0.0

We make a small picture so that we can a pixel to known colors and check its luminance.

Page 61: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Is that bright enough?def brightPixel(apixel ,

threshold=100):if luminance(apixel) > threshold:

return truereturn false

Using a Python feature that allows you to specify an optional parameter with a default value. We can specify a threshold, but if we don’t, it will be 100.

This could also be written:

def brightPixel(apixel , threshold=100): return luminance(apixel) > threshold

Page 62: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Testing our brightness function>>> redColor (255 , 0, 0)>>> setColor(pixel ,red)>>> luminance(pixel)85.0>>> brightPixel(pixel)0>>> brightPixel(pixel ,80)1>>> brightPixel(pixel ,threshold

=80)1

>>> setColor(pixel ,white)>>> brightPixel(pixel ,threshold

=80)1>>> brightPixel(pixel)1>>> setColor(pixel ,black)>>> brightPixel(pixel ,threshold

=80)0>>> brightPixel(pixel)0

Page 63: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Walking through the list of filesimport osdef allFiles(fromDir ):

listFiles = os.listdir(fromDir)listFiles.sort ()return listFiles

def firstFile(filelist ):return filelist [0]

def restFiles(filelist ): return filelist [1:] #returns

after [1]

Page 64: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Testing the file list functions>>> files = allFiles("/")>>> files[’Recycled ’, ’_314109_ ’, ’bin’, ’boot ’, ’cdrom

’,’dev’, ’etc’, ’home ’, ’initrd ’, ’initrd.img’,’initrd.img.old’, ’lib’, ’lost+found ’, ’media ’,’mnt’, ’opt’, ’proc ’, ’root ’, ’sbin ’, ’srv’, ’sys’,’tmp’, ’usr’, ’var’, ’vmlinuz ’, ’vmlinuz.old’]>>> firstFile(files)’Recycled ’>>> restFiles(files)[’_314109_ ’, ’bin’, ’boot ’, ’cdrom ’, ’dev’,

’etc’,’home ’, ’initrd ’, ’initrd.img’, ’initrd.img.old’,’lib’, ’lost+found ’, ’media ’, ’mnt’, ’opt’, ’proc

’,’root ’, ’sbin ’, ’srv’, ’sys’, ’tmp’, ’usr’, ’var’,’vmlinuz ’, ’vmlinuz.old’]

Page 65: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Now, putting it all together!def brightCombine(fromDir ,target ):

fileList = allFiles(fromDir)fromPictFile = firstFile(fileList)fromPict = makePicture(fromDir+fromPictFile)for toPictFile in restFiles(fileList ):

printNow(toPictFile)# Copy all the high luminance colors from fromPict to

toPicttoPict = makePicture(fromDir+toPictFile)

for p in getPixels(fromPict ):if brightPixel(p): c = getColor(p)

setColor(getPixel(toPict ,getX(p),getY(p)),c)writePictureTo(toPict ,target+toPictFile)fromPict = toPict

Page 66: Chapter 13: Creating and Modifying Movies. Chapter Objectives.
Page 67: Chapter 13: Creating and Modifying Movies. Chapter Objectives.

Why?Why does movie processing take so long?Why does sound processing seem to go so

fast?

Why can Photoshop do these things faster than we can in Python?

What makes software fast, or slow?Coming soon…