Downloading a section of an Image from a website in python? -


i able download entire image url using

from pil import image, imagetk import cstringio import urllib  url = http://prestigemgmt.us/wp-content/uploads/2013/03/dog.jpg self.image = image.open(cstringio.stringio(urllib.urlopen(url).read())) 

it works fine , gets whole image website. question there way get, lets right half of image.

i understand edit image after downloaded, speed important aspect, ideally download need.

it not possible this.

the common image file formats png , jpeg encoded in manner cannot download arbitrary part of picture without downloading full picture.

you need download whole picture, decode , edit after download.

for advanced knowledge can study png , jpeg file formats.

if in control of server providing images can write server-side script edits image on server , sends edit on wire.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -