import IPython.display
IPython.display.Image('images/earth.png', embed=True, width=600)
© National Geographic Image Source
IPython.display.Image(url="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8a/Earth-cutaway-schematic-english.svg/1280px-Earth-cutaway-schematic-english.svg.png",
embed=True, width=600)
© USGS Image Source
import requests
from PIL import Image
import io
url = 'http://pubs.usgs.gov/gip/dynamic/graphics/Fig2-5globes.gif'
response = requests.get(url)
#Load image from url
img = Image.open(io.BytesIO(response.content))
#Crop original image
width, height = img.size
cropped = img.crop((0, 0, int(width-310), int(height-560)))
#resize image while maintaining aspect ratio
basewidth = 400
wpercent = (basewidth/float(1.5*width))
hsize = int((float(height)*float(wpercent)))
resized = cropped.resize((basewidth,hsize), Image.ANTIALIAS)
resized.save('images/permian.png')
IPython.display.Image('images/permian.png', embed=True)
© USGS Image Source
Permian -- 250 Million Years Ago
cropped = img.crop((310, 0, int(width), int(height-560)))
#resize image while maintaining aspect ratio
basewidth = 400
wpercent = (basewidth/float(1.5*width))
hsize = int((float(height)*float(wpercent)))
resized = cropped.resize((basewidth,hsize), Image.ANTIALIAS)
resized.save('images/triassic.png')
IPython.display.Image('images/triassic.png', embed=True)
© USGS Image Source
Triassic -- 200 Million Years Ago
cropped = img.crop((0, 260, int(width-310), int(height-290)))
#resize image while maintaining aspect ratio
basewidth = 400
wpercent = (basewidth/float(1.5*width))
hsize = int((float(height)*float(wpercent)))
resized = cropped.resize((basewidth,hsize), Image.ANTIALIAS)
resized.save('images/jurassic.png')
IPython.display.Image('images/jurassic.png', embed=True)
© USGS Image Source
Jurassic -- 145 Million Years Ago
cropped = img.crop((310, 260, int(width), int(height-290)))
#resize image while maintaining aspect ratio
basewidth = 400
wpercent = (basewidth/float(1.5*width))
hsize = int((float(height)*float(wpercent)))
resized = cropped.resize((basewidth,hsize), Image.ANTIALIAS)
resized.save('images/cretaceous.png')
IPython.display.Image('images/cretaceous.png', embed=True)
© USGS Image Source
Cretaceous -- 65 Million Years Ago
cropped = img.crop((160, 530, int(width-150), int(height-20)))
#resize image while maintaining aspect ratio
basewidth = 400
wpercent = (basewidth/float(1.5*width))
hsize = int((float(height)*float(wpercent)))
resized = cropped.resize((basewidth,hsize), Image.ANTIALIAS)
resized.save('images/present.png')
IPython.display.Image('images/present.png', embed=True)
© USGS Image Source
Present Day
url = 'http://pubs.usgs.gov/gip/dynamic/graphics/Fig1.jpg'
response = requests.get(url)
#Load image from url
img = Image.open(io.BytesIO(response.content))
#Crop original image
width, height = img.size
cropped = img.crop((50, 50, int(width-50), int(height-50)))
#resize image while maintaining aspect ratio
basewidth = 500
wpercent = (basewidth/float(width))
hsize = int((float(height)*float(wpercent)))
resized = cropped.resize((basewidth,hsize), Image.ANTIALIAS)
resized.save('images/plates.png')
IPython.display.Image('images/plates.png', embed=True)
© USGS Image Source
url = 'http://pubs.usgs.gov/gip/dynamic/graphics/Fig13.gif'
response = requests.get(url)
#Load image from url
img = Image.open(io.BytesIO(response.content))
img.save('images/plate_bound.png')
IPython.display.Image('images/plate_bound.png', embed=True)
© USGS Image Source
#url = 'http://geomaps.wr.usgs.gov/parks/deform/normfaultLABEL.gif'
#response = requests.get(url)
#Load image from url
#img = Image.open(io.BytesIO(response.content))
#img.save('images/normal_fault.png')
IPython.display.Image('images/normal_fault.png', embed=True, width=500)
© USGS Image Source
#url = 'http://geomaps.wr.usgs.gov/parks/deform/reversefaultLABEL.gif'
#response = requests.get(url)
#Load image from url
#img = Image.open(io.BytesIO(response.content))
#img.save('images/reverse_fault.png')
IPython.display.Image('images/reverse_fault.png', embed=True, width=500)
© USGS Image Source
#url = 'http://geomaps.wr.usgs.gov/parks/deform/strikeslip.gif'
#response = requests.get(url)
#Load image from url
#img = Image.open(io.BytesIO(response.content))
#img.save('images/strike-slip_fault.png')
IPython.display.Image('images/strike-slip_fault.png', embed=True, width=500)
© USGS Image Source