pic = cStringIO.StringIO()
image_string = cStringIO.StringIO(base64.b64decode(request.POST['file']))
image = Image.open(image_string)
image.save(pic, image.format, quality=100)
pic.seek(0)
return HttpResponse(pic, content_type='image/jpeg')
Loading Base64 String into Python Image Library