Skip to content

Instantly share code, notes, and snippets.

@karlcow
Last active May 19, 2016 06:57
Show Gist options
  • Save karlcow/3541bcfbc87cc8327da8c693a3e7d1cc to your computer and use it in GitHub Desktop.
Save karlcow/3541bcfbc87cc8327da8c693a3e7d1cc to your computer and use it in GitHub Desktop.
# Testing Images optimization
# for https://github.com/webcompat/webcompat.com/issues/1051
import os
import shutil
import time
from PIL import Image
IMAGE_PATH = '/Users/karl/Documents/2016/05/webc/original.png'
IMAGE_DEST = '/Users/karl/Documents/2016/05/webc/saved'
JPEG_PATH = '/Users/karl/Documents/2016/05/webc/burger.jpg'
# Cleaning the directory
if os.path.exists(IMAGE_DEST):
shutil.rmtree(IMAGE_DEST)
os.makedirs(IMAGE_DEST)
else:
os.makedirs(IMAGE_DEST)
# We will be reading each time the file to be sure to start fresh.
def optim_true(IMAGE_PATH, IMAGE_DEST):
time_beg = time.time()
save_parameters = {}
image_file = '%s/%s' % (IMAGE_DEST, 'opt-true.png')
image_object = Image.open(IMAGE_PATH)
save_parameters['optimize'] = True
image_object.save(image_file, **save_parameters)
print image_object.encoderconfig
print image_object.encoderinfo
del image_object
time_end = time.time()
print 'Optim True: %s' % (time_end - time_beg)
def optim_false(IMAGE_PATH, IMAGE_DEST):
time_beg = time.time()
save_parameters = {}
image_file = '%s/%s' % (IMAGE_DEST, 'opt-false.png')
image_object = Image.open(IMAGE_PATH)
save_parameters['optimize'] = False
image_object.save(image_file, **save_parameters)
print image_object.encoderconfig
print image_object.encoderinfo
del image_object
time_end = time.time()
print 'Optim False: %s' % (time_end - time_beg)
def optim_normal(IMAGE_PATH, IMAGE_DEST):
time_beg = time.time()
image_file = '%s/%s' % (IMAGE_DEST, 'original-save.png')
image_object = Image.open(IMAGE_PATH)
image_object.save(image_file)
print image_object.encoderconfig
print image_object.encoderinfo
del image_object
time_end = time.time()
print 'Original Save: %s' % (time_end - time_beg)
def optim_compress(IMAGE_PATH, IMAGE_DEST, level):
time_beg = time.time()
image_file = '%s/original-compress-l%s.png' % (IMAGE_DEST, str(level))
image_object = Image.open(IMAGE_PATH)
image_object.save(image_file, compress_level=level)
print image_object.encoderconfig
print image_object.encoderinfo
del image_object
time_end = time.time()
print 'Compress Level %s: %s' % (str(level), time_end - time_beg)
def burger_optim_true(IMAGE_PATH, IMAGE_DEST):
time_beg = time.time()
save_parameters = {}
image_file = '%s/%s' % (IMAGE_DEST, 'burger-true.jpg')
image_object = Image.open(IMAGE_PATH)
save_parameters['optimize'] = True
image_object.save(image_file, **save_parameters)
print image_object.encoderconfig
print image_object.encoderinfo
del image_object
time_end = time.time()
print 'Burger Optim True: %s' % (time_end - time_beg)
def burger_optim_normal(IMAGE_PATH, IMAGE_DEST):
time_beg = time.time()
image_file = '%s/%s' % (IMAGE_DEST, 'burger-original.jpg')
image_object = Image.open(IMAGE_PATH)
image_object.save(image_file)
print image_object.encoderconfig
print image_object.encoderinfo
del image_object
time_end = time.time()
print 'Original Save: %s' % (time_end - time_beg)
def pngjpg_optim_true(IMAGE_PATH, IMAGE_DEST):
time_beg = time.time()
save_parameters = {}
image_file = '%s/%s' % (IMAGE_DEST, 'pngjpg-true.jpg')
image_object = Image.open(IMAGE_PATH)
save_parameters['optimize'] = True
image_object.save(image_file, **save_parameters)
print image_object.encoderconfig
print image_object.encoderinfo
del image_object
time_end = time.time()
print 'JPGPNG Optim True: %s' % (time_end - time_beg)
def pngjpg_optim_normal(IMAGE_PATH, IMAGE_DEST):
time_beg = time.time()
image_file = '%s/%s' % (IMAGE_DEST, 'pngjpg-original.jpg')
image_object = Image.open(IMAGE_PATH)
image_object.save(image_file)
print image_object.encoderconfig
print image_object.encoderinfo
del image_object
time_end = time.time()
print 'JPGPNG Save: %s' % (time_end - time_beg)
if __name__ == "__main__":
# optim_true(IMAGE_PATH, IMAGE_DEST)
# optim_false(IMAGE_PATH, IMAGE_DEST)
# optim_normal(IMAGE_PATH, IMAGE_DEST)
# for level in xrange(1, 10):
# optim_compress(IMAGE_PATH, IMAGE_DEST, level)
# burger_optim_normal(JPEG_PATH, IMAGE_DEST)
# burger_optim_true(JPEG_PATH, IMAGE_DEST)
pngjpg_optim_normal(IMAGE_PATH, IMAGE_DEST)
pngjpg_optim_true(IMAGE_PATH, IMAGE_DEST)
@karlcow
Copy link
Author

karlcow commented May 19, 2016

→ time python -m cProfile -s time image-optim.py 
Optim True: 17.3877630234
Optim False: 17.2931690216
Original Save: 1.36256098747
         21377 function calls (21087 primitive calls) in 36.069 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
       83   35.819    0.432   35.819    0.432 {method 'encode' of 'ImagingEncoder' objects}
      648    0.132    0.000    0.132    0.000 {method 'decode' of 'ImagingDecoder' objects}
      184    0.015    0.000    0.015    0.000 {PIL._imaging.crc32}
        3    0.009    0.003    0.009    0.003 {method 'close' of 'file' objects}
      270    0.008    0.000    0.008    0.000 {method 'write' of 'file' objects}
        1    0.006    0.006    0.016    0.016 Image.py:27(<module>)
     1959    0.006    0.000    0.006    0.000 {method 'read' of 'file' objects}
        1    0.005    0.005   36.069   36.069 image-optim.py:3(<module>)
        6    0.004    0.001    0.030    0.005 Image.py:342(preinit)
        1    0.004    0.004    0.005    0.005 __init__.py:24(<module>)
        3    0.004    0.001    0.004    0.001 {PIL._imaging.new}
        1    0.004    0.004    0.017    0.017 JpegImagePlugin.py:35(<module>)
        1    0.003    0.003    1.363    1.363 image-optim.py:46(optim_normal)
        1    0.003    0.003   17.293   17.293 image-optim.py:34(optim_false)
        1    0.003    0.003   17.388   17.388 image-optim.py:22(optim_true)
        1    0.003    0.003    0.010    0.010 fractions.py:4(<module>)
        1    0.002    0.002    0.014    0.014 TiffImagePlugin.py:42(<module>)
        1    0.002    0.002    0.005    0.005 BmpImagePlugin.py:27(<module>)
        1    0.002    0.002    0.002    0.002 ImagePalette.py:19(<module>)
        1    0.002    0.002    0.003    0.003 collections.py:1(<module>)
        1    0.002    0.002    0.005    0.005 shutil.py:5(<module>)
      648    0.002    0.000    0.011    0.000 PngImagePlugin.py:557(load_read)
        6    0.002    0.000    0.149    0.025 ImageFile.py:120(load)
        1    0.001    0.001    0.002    0.002 __init__.py:4(<module>)
        1    0.001    0.001    0.001    0.001 GifImagePlugin.py:27(<module>)
        2    0.001    0.001    0.002    0.001 collections.py:293(namedtuple)
      651    0.001    0.000    0.003    0.000 PngImagePlugin.py:107(read)
     1508    0.001    0.000    0.002    0.000 sre_parse.py:193(__next)
    49/10    0.001    0.000    0.004    0.000 sre_parse.py:395(_parse)
        1    0.001    0.001    0.002    0.002 PngImagePlugin.py:34(<module>)
        1    0.001    0.001    0.003    0.003 FixTk.py:1(<module>)
       89    0.001    0.000    0.024    0.000 PngImagePlugin.py:615(putchunk)
      654    0.001    0.000    0.001    0.000 {method 'match' of '_sre.SRE_Pattern' objects}
        3    0.001    0.000   35.844   11.948 ImageFile.py:438(_save)
        1    0.001    0.001    0.001    0.001 heapq.py:31(<module>)
     1386    0.001    0.000    0.002    0.000 sre_parse.py:212(get)
        1    0.001    0.001    0.001    0.001 io.py:34(<module>)
    90/10    0.001    0.000    0.001    0.000 sre_compile.py:64(_compile)
        2    0.001    0.000    0.003    0.002 {__import__}
      657    0.000    0.000    0.001    0.000 _binary.py:56(i32be)
        1    0.000    0.000    0.005    0.005 decimal.py:116(<module>)
        6    0.000    0.000    0.000    0.000 {open}
      120    0.000    0.000    0.000    0.000 {built-in method __new__ of type object at 0x10c349408}
3709/3667    0.000    0.000    0.000    0.000 {len}
      273    0.000    0.000    0.000    0.000 {_struct.pack}
      337    0.000    0.000    0.000    0.000 sre_parse.py:141(__getitem__)
      819    0.000    0.000    0.000    0.000 {min}
        2    0.000    0.000    0.000    0.000 {posix.remove}
        1    0.000    0.000    0.001    0.001 threading.py:1(<module>)
   118/46    0.000    0.000    0.000    0.000 sre_parse.py:151(getwidth)
      663    0.000    0.000    0.000    0.000 {_struct.unpack}
      490    0.000    0.000    0.000    0.000 {getattr}
       13    0.000    0.000    0.001    0.000 abc.py:86(__new__)
      651    0.000    0.000    0.000    0.000 {method 'tell' of 'file' objects}
       83    0.000    0.000    0.024    0.000 PngImagePlugin.py:633(write)
      975    0.000    0.000    0.000    0.000 {method 'append' of 'list' objects}
    43/10    0.000    0.000    0.004    0.000 sre_parse.py:317(_parse_sub)
        1    0.000    0.000    0.000    0.000 ImageFile.py:30(<module>)
      431    0.000    0.000    0.000    0.000 {isinstance}
      100    0.000    0.000    0.000    0.000 TiffTags.py:26(__new__)
       95    0.000    0.000    0.000    0.000 _binary.py:73(o32be)
        1    0.000    0.000    0.000    0.000 TiffTags.py:303(_populate)
       10    0.000    0.000    0.006    0.001 re.py:230(_compile)
        3    0.000    0.000   36.003   12.001 Image.py:1601(save)
    17/13    0.000    0.000    0.000    0.000 abc.py:148(__subclasscheck__)
        1    0.000    0.000    0.000    0.000 {posix.mkdir}
       28    0.000    0.000    0.000    0.000 sre_compile.py:256(_optimize_charset)
        1    0.000    0.000    0.001    0.001 TiffTags.py:20(<module>)
       52    0.000    0.000    0.000    0.000 _weakrefset.py:36(__init__)
        3    0.000    0.000   35.844   11.948 PngImagePlugin.py:637(_save)
        1    0.000    0.000    0.001    0.001 PpmImagePlugin.py:18(<module>)
      276    0.000    0.000    0.000    0.000 sre_parse.py:206(match)
       96    0.000    0.000    0.000    0.000 {method 'join' of 'str' objects}
        1    0.000    0.000    0.000    0.000 threading.py:552(_Event)
        1    0.000    0.000    0.000    0.000 ascii.py:8(<module>)
      178    0.000    0.000    0.000    0.000 _binary.py:69(o16be)
        3    0.000    0.000    0.000    0.000 __init__.py:78(CFUNCTYPE)
        1    0.000    0.000    0.000    0.000 _util.py:1(<module>)
       28    0.000    0.000    0.000    0.000 sre_compile.py:228(_compile_charset)
        1    0.000    0.000    0.000    0.000 _endian.py:4(<module>)
        3    0.000    0.000    0.000    0.000 Image.py:2269(_open_core)
       10    0.000    0.000    0.004    0.000 sre_parse.py:706(parse)
       10    0.000    0.000    0.000    0.000 sre_compile.py:433(_compile_info)
       10    0.000    0.000    0.006    0.001 sre_compile.py:567(compile)
       18    0.000    0.000    0.000    0.000 {method 'format' of 'str' objects}
       19    0.000    0.000    0.000    0.000 sre_parse.py:227(isname)
      160    0.000    0.000    0.000    0.000 sre_parse.py:137(__len__)
        1    0.000    0.000    0.000    0.000 ImageColor.py:20(<module>)
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:489(_open)
       26    0.000    0.000    0.000    0.000 {hasattr}
       54    0.000    0.000    0.000    0.000 abc.py:89(<genexpr>)
      100    0.000    0.000    0.000    0.000 <string>:8(__new__)
      131    0.000    0.000    0.000    0.000 sre_parse.py:149(append)
       36    0.000    0.000    0.000    0.000 sre_compile.py:428(_simple)
       90    0.000    0.000    0.000    0.000 sre_parse.py:92(__init__)
       33    0.000    0.000    0.000    0.000 _weakrefset.py:58(__iter__)
        1    0.000    0.000    0.000    0.000 ImageSequence.py:19(<module>)
        3    0.000    0.000    0.000    0.000 __init__.py:493(PYFUNCTYPE)
       71    0.000    0.000    0.000    0.000 collections.py:337(<genexpr>)
        6    0.000    0.000    0.000    0.000 PngImagePlugin.py:132(call)
        2    0.000    0.000    0.000    0.000 {_ctypes.POINTER}
        1    0.000    0.000    0.000    0.000 _binary.py:14(<module>)
        3    0.000    0.000    0.000    0.000 decimal.py:3783(__init__)
       14    0.000    0.000    0.000    0.000 __init__.py:147(_check_size)
        1    0.000    0.000    0.001    0.001 numbers.py:6(<module>)
        6    0.000    0.000    0.000    0.000 decimal.py:514(__new__)
        1    0.000    0.000    0.000    0.000 <string>:1(<module>)
        3    0.000    0.000    0.000    0.000 ImageFile.py:78(__init__)
        1    0.000    0.000    0.000    0.000 TiffImagePlugin.py:354(ImageFileDirectory_v2)
        1    0.000    0.000    0.000    0.000 fractions.py:44(Fraction)
       10    0.000    0.000    0.006    0.001 re.py:192(compile)
        1    0.000    0.000    0.000    0.000 {posix.listdir}
        3    0.000    0.000    0.031    0.010 Image.py:2227(open)
       31    0.000    0.000    0.000    0.000 {method 'items' of 'dict' objects}
        1    0.000    0.000    0.000    0.000 ImageMode.py:17(<module>)
        1    0.000    0.000    0.000    0.000 <string>:1(_TagInfo)
       30    0.000    0.000    0.000    0.000 sre_parse.py:268(_escape)
       23    0.000    0.000    0.000    0.000 sre_parse.py:74(opengroup)
        1    0.000    0.000    0.000    0.000 __init__.py:265(_reset_cache)
        1    0.000    0.000    0.000    0.000 __init__.py:349(__init__)
        3    0.000    0.000    0.000    0.000 {PIL._imaging.zip_encoder}
        3    0.000    0.000    0.000    0.000 {method 'flush' of 'file' objects}
       25    0.000    0.000    0.000    0.000 {_struct.calcsize}
        1    0.000    0.000    0.000    0.000 decimal.py:505(Decimal)
       17    0.000    0.000    0.000    0.000 _weakrefset.py:26(__exit__)
        1    0.000    0.000    0.000    0.000 ImageChops.py:18(<module>)
    47/27    0.000    0.000    0.000    0.000 {issubclass}
        1    0.000    0.000    0.000    0.000 __future__.py:48(<module>)
       10    0.000    0.000    0.000    0.000 {_sre.compile}
        7    0.000    0.000    0.000    0.000 TiffImagePlugin.py:567(_register_basic)
        4    0.000    0.000    0.000    0.000 {posix.stat}
       56    0.000    0.000    0.000    0.000 {method 'find' of 'bytearray' objects}
        6    0.000    0.000    0.000    0.000 Image.py:2401(register_open)
        7    0.000    0.000    0.000    0.000 {method 'decode' of 'str' objects}
       13    0.000    0.000    0.000    0.000 abc.py:105(register)
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:311(chunk_IHDR)
        1    0.000    0.000    0.000    0.000 Image.py:478(Image)
        9    0.000    0.000    0.000    0.000 {method 'seek' of 'file' objects}
       30    0.000    0.000    0.000    0.000 _weakrefset.py:83(add)
       10    0.000    0.000    0.000    0.000 {all}
       39    0.000    0.000    0.000    0.000 {_sre.getlower}
        9    0.000    0.000    0.000    0.000 Image.py:618(__getattr__)
        1    0.000    0.000    0.000    0.000 {posix.rmdir}
        1    0.000    0.000    0.000    0.000 TiffImagePlugin.py:230(IFDRational)
       10    0.000    0.000    0.001    0.000 sre_compile.py:552(_code)
      104    0.000    0.000    0.000    0.000 sre_parse.py:221(isident)
        2    0.000    0.000    0.000    0.000 sre_compile.py:411(_mk_bitmap)
        3    0.000    0.000    0.000    0.000 {PIL._imaging.zip_decoder}
        1    0.000    0.000    0.000    0.000 {posix.uname}
        1    0.000    0.000    0.000    0.000 JpegPresets.py:67(<module>)
        6    0.000    0.000    0.000    0.000 {method 'sort' of 'list' objects}
       17    0.000    0.000    0.000    0.000 _weakrefset.py:20(__enter__)
      111    0.000    0.000    0.000    0.000 {method 'add' of 'set' objects}
       89    0.000    0.000    0.000    0.000 {method 'get' of 'dict' objects}
        9    0.000    0.000    0.000    0.000 Image.py:748(load)
       20    0.000    0.000    0.000    0.000 sre_compile.py:546(isstring)
       24    0.000    0.000    0.000    0.000 {method 'replace' of 'str' objects}
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:583(load_end)
        1    0.000    0.000    0.000    0.000 shutil.py:210(rmtree)
        2    0.000    0.000    0.000    0.000 __init__.py:1023(getLogger)
        2    0.000    0.000    0.000    0.000 locale.py:363(normalize)
        3    0.000    0.000    0.000    0.000 Image.py:402(_getdecoder)
       12    0.000    0.000    0.000    0.000 Image.py:2450(register_extension)
        1    0.000    0.000    0.000    0.000 {method 'encode' of 'unicode' objects}
        1    0.000    0.000    0.000    0.000 locale.py:493(getdefaultlocale)
        4    0.000    0.000    0.000    0.000 posixpath.py:61(join)
        2    0.000    0.000    0.000    0.000 __init__.py:1069(_fixupParents)
       21    0.000    0.000    0.000    0.000 _weakrefset.py:70(__contains__)
       24    0.000    0.000    0.000    0.000 {setattr}
       27    0.000    0.000    0.000    0.000 decimal.py:3810(<genexpr>)
        1    0.000    0.000    0.000    0.000 __init__.py:71(search_function)
        1    0.000    0.000    0.000    0.000 collections.py:26(OrderedDict)
        5    0.000    0.000    0.000    0.000 TiffImagePlugin.py:553(decorator)
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:268(__init__)
        2    0.000    0.000    0.000    0.000 threading.py:260(__init__)
       10    0.000    0.000    0.000    0.000 sre_parse.py:189(__init__)
        1    0.000    0.000    0.000    0.000 threading.py:640(Thread)
        1    0.000    0.000    0.000    0.000 traceback.py:1(<module>)
        3    0.000    0.000    0.000    0.000 __init__.py:1125(__init__)
        3    0.000    0.000    0.000    0.000 {posix.lstat}
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:138(crc)
        2    0.000    0.000    0.000    0.000 {repr}
        1    0.000    0.000    0.000    0.000 numbers.py:34(Complex)
        3    0.000    0.000    0.000    0.000 {map}
        3    0.000    0.000    0.000    0.000 Image.py:492(__init__)
        1    0.000    0.000    0.000    0.000 locale.py:347(_replace_encoding)
        4    0.000    0.000    0.000    0.000 genericpath.py:23(exists)
        3    0.000    0.000    0.004    0.001 ImageFile.py:247(load_prepare)
        2    0.000    0.000    0.000    0.000 threading.py:147(acquire)
       37    0.000    0.000    0.000    0.000 abc.py:15(abstractmethod)
       11    0.000    0.000    0.000    0.000 {method 'rfind' of 'str' objects}
        3    0.000    0.000    0.004    0.001 PngImagePlugin.py:549(load_prepare)
        5    0.000    0.000    0.000    0.000 fractions.py:280(_operator_fallbacks)
        6    0.000    0.000    0.000    0.000 __init__.py:1143(debug)
        1    0.000    0.000    0.000    0.000 warnings.py:49(filterwarnings)
       23    0.000    0.000    0.000    0.000 {method 'remove' of 'list' objects}
        1    0.000    0.000    0.000    0.000 posixpath.py:329(normpath)
        3    0.000    0.000    0.000    0.000 Image.py:419(_getencoder)
       22    0.000    0.000    0.000    0.000 {method 'startswith' of 'str' objects}
        1    0.000    0.000    0.000    0.000 threading.py:656(__init__)
       88    0.000    0.000    0.000    0.000 {ord}
        3    0.000    0.000    0.000    0.000 posixpath.py:97(splitext)
        6    0.000    0.000    0.000    0.000 __init__.py:1358(isEnabledFor)
        1    0.000    0.000    0.000    0.000 <string>:1(DecimalTuple)
       36    0.000    0.000    0.000    0.000 {method 'upper' of 'str' objects}
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:326(chunk_IDAT)
        1    0.000    0.000    0.000    0.000 {_codecs.utf_8_decode}
       28    0.000    0.000    0.000    0.000 TiffImagePlugin.py:310(_delegate)
       23    0.000    0.000    0.000    0.000 sre_parse.py:85(closegroup)
       36    0.000    0.000    0.000    0.000 sre_parse.py:145(__setitem__)
        2    0.000    0.000    0.000    0.000 __init__.py:49(normalize_encoding)
        1    0.000    0.000    0.000    0.000 TiffImagePlugin.py:868(TiffImageFile)
        1    0.000    0.000    0.000    0.000 keyword.py:11(<module>)
        1    0.000    0.000    0.000    0.000 decimal.py:3764(Context)
        6    0.000    0.000    0.000    0.000 __init__.py:1344(getEffectiveLevel)
        2    0.000    0.000    0.000    0.000 threading.py:187(release)
        8    0.000    0.000    0.000    0.000 {method 'split' of 'str' objects}
        1    0.000    0.000    0.000    0.000 GifImagePlugin.py:53(GifImageFile)
        2    0.000    0.000    0.000    0.000 __init__.py:1565(getLogger)
       16    0.000    0.000    0.000    0.000 {method 'lower' of 'str' objects}
        3    0.000    0.000    0.000    0.000 genericpath.py:93(_splitext)
        1    0.000    0.000    0.000    0.000 ImageFile.py:75(ImageFile)
       10    0.000    0.000    0.000    0.000 collections.py:361(<genexpr>)
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:99(__init__)
        6    0.000    0.000    0.000    0.000 Image.py:2427(register_save)
       61    0.000    0.000    0.000    0.000 {method 'isalnum' of 'str' objects}
        9    0.000    0.000    0.000    0.000 _util.py:7(isPath)
       10    0.000    0.000    0.000    0.000 collections.py:363(<genexpr>)
       17    0.000    0.000    0.000    0.000 _weakrefset.py:52(_commit_removals)
        1    0.000    0.000    0.000    0.000 TiffImagePlugin.py:775(ImageFileDirectory_v1)
        1    0.000    0.000    0.000    0.000 fnmatch.py:11(<module>)
        1    0.000    0.000    0.000    0.000 ascii.py:41(getregentry)
        1    0.000    0.000    0.000    0.000 locale.py:546(getlocale)
        3    0.000    0.000    0.000    0.000 {method 'setimage' of 'ImagingEncoder' objects}
        1    0.000    0.000    0.000    0.000 os.py:136(makedirs)
        7    0.000    0.000    0.000    0.000 __future__.py:75(__init__)
        1    0.000    0.000    0.000    0.000 threading.py:1090(__init__)
        1    0.000    0.000    0.000    0.000 __init__.py:654(Handler)
        1    0.000    0.000    0.000    0.000 collections.py:395(Counter)
        8    0.000    0.000    0.000    0.000 sre_compile.py:101(fixup)
        1    0.000    0.000    0.000    0.000 threading.py:561(__init__)
        1    0.000    0.000    0.000    0.000 ImageFile.py:299(Parser)
        1    0.000    0.000    0.000    0.000 numbers.py:169(Real)
        1    0.000    0.000    0.000    0.000 weakref.py:47(__init__)
       10    0.000    0.000    0.000    0.000 sre_parse.py:67(__init__)
       10    0.000    0.000    0.000    0.000 {max}
        1    0.000    0.000    0.000    0.000 __init__.py:1110(Logger)
       12    0.000    0.000    0.000    0.000 _binary.py:17(i8)
        1    0.000    0.000    0.000    0.000 ImagePalette.py:23(ImagePalette)
        6    0.000    0.000    0.000    0.000 {method 'pixel_access' of 'ImagingCore' objects}
        1    0.000    0.000    0.000    0.000 atexit.py:6(<module>)
        2    0.000    0.000    0.000    0.000 locale.py:447(_parse_localename)
        5    0.000    0.000    0.000    0.000 Image.py:2416(register_mime)
        2    0.000    0.000    0.000    0.000 __init__.py:211(_acquireLock)
        3    0.000    0.000    0.000    0.000 TiffImagePlugin.py:215(_accept)
        1    0.000    0.000    0.000    0.000 numbers.py:295(Integral)
        3    0.000    0.000    0.000    0.000 __init__.py:183(_checkLevel)
       17    0.000    0.000    0.000    0.000 _weakrefset.py:16(__init__)
        1    0.000    0.000    0.000    0.000 BmpImagePlugin.py:61(BmpImageFile)
        1    0.000    0.000    0.000    0.000 numbers.py:270(Rational)
        2    0.000    0.000    0.000    0.000 __init__.py:220(_releaseLock)
        6    0.000    0.000    0.000    0.000 _binary.py:52(i16be)
        1    0.000    0.000    0.000    0.000 posixpath.py:82(split)
        1    0.000    0.000    0.000    0.000 posixpath.py:132(islink)
       17    0.000    0.000    0.000    0.000 {method '__subclasses__' of 'type' objects}
       10    0.000    0.000    0.000    0.000 {method 'group' of '_sre.SRE_Match' objects}
        1    0.000    0.000    0.000    0.000 threading.py:576(set)
       24    0.000    0.000    0.000    0.000 {method 'remove' of 'set' objects}
        2    0.000    0.000    0.000    0.000 threading.py:242(Condition)
        3    0.000    0.000    0.000    0.000 {method 'setimage' of 'ImagingDecoder' objects}
        1    0.000    0.000    0.000    0.000 codecs.py:83(__new__)
        1    0.000    0.000    0.000    0.000 threading.py:255(_Condition)
       27    0.000    0.000    0.000    0.000 decimal.py:3817(<genexpr>)
        3    0.000    0.000    0.000    0.000 BmpImagePlugin.py:54(_accept)
       10    0.000    0.000    0.000    0.000 {method '__contains__' of 'frozenset' objects}
        1    0.000    0.000    0.000    0.000 UserDict.py:58(get)
        1    0.000    0.000    0.000    0.000 {sorted}
        6    0.000    0.000    0.000    0.000 ImageFile.py:66(_tilesort)
        4    0.000    0.000    0.000    0.000 {method 'acquire' of 'thread.lock' objects}
        1    0.000    0.000    0.000    0.000 __init__.py:428(LibraryLoader)
        1    0.000    0.000    0.000    0.000 PngImagePlugin.py:97(ChunkStream)
        3    0.000    0.000    0.000    0.000 __init__.py:494(CFunctionType)
        3    0.000    0.000    0.000    0.000 Image.py:2213(_decompression_bomb_check)
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:477(_accept)
       38    0.000    0.000    0.000    0.000 {_ctypes.sizeof}
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:125(close)
        2    0.000    0.000    0.000    0.000 {sys._getframe}
        2    0.000    0.000    0.000    0.000 stat.py:40(S_ISDIR)
        1    0.000    0.000    0.000    0.000 __init__.py:1008(Manager)
        5    0.000    0.000    0.000    0.000 threading.py:59(__init__)
        7    0.000    0.000    0.000    0.000 {time.time}
        3    0.000    0.000    0.000    0.000 PngImagePlugin.py:629(__init__)
        3    0.000    0.000    0.000    0.000 __init__.py:585(__init__)
        1    0.000    0.000    0.000    0.000 threading.py:400(notifyAll)
        3    0.000    0.000    0.000    0.000 ImageFile.py:492(_safe_read)
        3    0.000    0.000    0.000    0.000 GifImagePlugin.py:45(_accept)
        3    0.000    0.000    0.000    0.000 JpegImagePlugin.py:275(_accept)
        1    0.000    0.000    0.000    0.000 io.py:69(IOBase)
        5    0.000    0.000    0.000    0.000 threading.py:64(_note)
        1    0.000    0.000    0.000    0.000 ascii.py:13(Codec)
        1    0.000    0.000    0.000    0.000 ImageSequence.py:19(Iterator)
        1    0.000    0.000    0.000    0.000 __init__.py:14(<module>)
        1    0.000    0.000    0.000    0.000 threading.py:300(_is_owned)
        1    0.000    0.000    0.000    0.000 {_locale.setlocale}
        1    0.000    0.000    0.000    0.000 Image.py:2438(register_save_all)
        3    0.000    0.000    0.000    0.000 {method 'setter' of 'property' objects}
        1    0.000    0.000    0.000    0.000 threading.py:542(Event)
        1    0.000    0.000    0.000    0.000 {_ctypes.set_conversion_mode}
        1    0.000    0.000    0.000    0.000 threading.py:125(_RLock)
        1    0.000    0.000    0.000    0.000 PngImagePlugin.py:266(PngStream)
        1    0.000    0.000    0.000    0.000 __future__.py:74(_Feature)
        6    0.000    0.000    0.000    0.000 {method 'translate' of 'str' objects}
        1    0.000    0.000    0.000    0.000 __init__.py:1391(__init__)
        1    0.000    0.000    0.000    0.000 __init__.py:1399(LoggerAdapter)
        1    0.000    0.000    0.000    0.000 PngImagePlugin.py:189(PngInfo)
        3    0.000    0.000    0.000    0.000 PpmImagePlugin.py:52(_accept)
        5    0.000    0.000    0.000    0.000 TiffImagePlugin.py:552(_register_loader)
        1    0.000    0.000    0.000    0.000 ascii.py:20(IncrementalEncoder)
        1    0.000    0.000    0.000    0.000 JpegImagePlugin.py:282(JpegImageFile)
        3    0.000    0.000    0.000    0.000 {method 'release' of 'thread.lock' objects}
        2    0.000    0.000    0.000    0.000 {range}
        1    0.000    0.000    0.000    0.000 threading.py:132(__init__)
        6    0.000    0.000    0.000    0.000 {method 'extend' of 'list' objects}
        1    0.000    0.000    0.000    0.000 utf_8.py:15(decode)
        1    0.000    0.000    0.000    0.000 numbers.py:13(Number)
        1    0.000    0.000    0.000    0.000 __init__.py:243(c_char_p)
        1    0.000    0.000    0.000    0.000 UserDict.py:18(__getitem__)
        3    0.000    0.000    0.000    0.000 stat.py:24(S_IFMT)
        1    0.000    0.000    0.000    0.000 Image.py:41(_imaging_not_installed)
        1    0.000    0.000    0.000    0.000 threading.py:1088(_MainThread)
        1    0.000    0.000    0.000    0.000 ImageMode.py:23(ModeDescriptor)
        1    0.000    0.000    0.000    0.000 PngImagePlugin.py:626(_idat)
        1    0.000    0.000    0.000    0.000 __init__.py:397(__init__)
        1    0.000    0.000    0.000    0.000 UserDict.py:4(__init__)
        1    0.000    0.000    0.000    0.000 threading.py:789(_set_ident)
        1    0.000    0.000    0.000    0.000 __init__.py:818(StreamHandler)
        1    0.000    0.000    0.000    0.000 shutil.py:34(SpecialFileError)
        1    0.000    0.000    0.000    0.000 decimal.py:160(DecimalException)
        1    0.000    0.000    0.000    0.000 __init__.py:501(BufferingFormatter)
        1    0.000    0.000    0.000    0.000 ascii.py:24(IncrementalDecoder)
        1    0.000    0.000    0.000    0.000 Image.py:443(_E)
        2    0.000    0.000    0.000    0.000 {method 'clear' of 'dict' objects}
        3    0.000    0.000    0.000    0.000 {method 'strip' of 'str' objects}
        1    0.000    0.000    0.000    0.000 {method 'keys' of 'dict' objects}
        1    0.000    0.000    0.000    0.000 threading.py:57(_Verbose)
        1    0.000    0.000    0.000    0.000 __init__.py:233(c_byte)
        1    0.000    0.000    0.000    0.000 __init__.py:231(LogRecord)
       10    0.000    0.000    0.000    0.000 {method 'isdigit' of 'str' objects}
        1    0.000    0.000    0.000    0.000 posixpath.py:358(abspath)
        1    0.000    0.000    0.000    0.000 TiffTags.py:23(TagInfo)
        1    0.000    0.000    0.000    0.000 stat.py:55(S_ISLNK)
        1    0.000    0.000    0.000    0.000 UserDict.py:70(__contains__)
        1    0.000    0.000    0.000    0.000 {method 'rstrip' of 'str' objects}
        6    0.000    0.000    0.000    0.000 {method 'endswith' of 'str' objects}
        1    0.000    0.000    0.000    0.000 BmpImagePlugin.py:205(DibImageFile)
        5    0.000    0.000    0.000    0.000 TiffImagePlugin.py:561(_register_writer)
        6    0.000    0.000    0.000    0.000 {method 'pop' of 'dict' objects}
        1    0.000    0.000    0.000    0.000 __init__.py:889(FileHandler)
        3    0.000    0.000    0.000    0.000 {method 'cleanup' of 'ImagingEncoder' objects}
        1    0.000    0.000    0.000    0.000 decimal.py:284(InvalidContext)
        1    0.000    0.000    0.000    0.000 threading.py:1058(_Timer)
        1    0.000    0.000    0.000    0.000 io.py:79(TextIOBase)
        1    0.000    0.000    0.000    0.000 {method 'lstrip' of 'str' objects}
        1    0.000    0.000    0.000    0.000 _util.py:22(deferred_error)
        6    0.000    0.000    0.000    0.000 {thread.get_ident}
        1    0.000    0.000    0.000    0.000 threading.py:373(notify)
        1    0.000    0.000    0.000    0.000 threading.py:515(_BoundedSemaphore)
        1    0.000    0.000    0.000    0.000 __init__.py:974(append)
        1    0.000    0.000    0.000    0.000 PpmImagePlugin.py:59(PpmImageFile)
        1    0.000    0.000    0.000    0.000 ascii.py:34(StreamConverter)
        1    0.000    0.000    0.000    0.000 __init__.py:1013(__init__)
        1    0.000    0.000    0.000    0.000 threading.py:423(_Semaphore)
        1    0.000    0.000    0.000    0.000 decimal.py:5419(_WorkRep)
        3    0.000    0.000    0.000    0.000 __init__.py:104(CFunctionType)
        1    0.000    0.000    0.000    0.000 PngImagePlugin.py:169(iTXt)
        1    0.000    0.000    0.000    0.000 PngImagePlugin.py:484(PngImageFile)
        1    0.000    0.000    0.000    0.000 __init__.py:388(PyDLL)
        1    0.000    0.000    0.000    0.000 __init__.py:255(c_void_p)
        1    0.000    0.000    0.000    0.000 decimal.py:3749(_ContextManager)
        1    0.000    0.000    0.000    0.000 __init__.py:359(_FuncPtr)
        1    0.000    0.000    0.000    0.000 __init__.py:1687(NullHandler)
        1    0.000    0.000    0.000    0.000 __init__.py:238(c_char)
        1    0.000    0.000    0.000    0.000 {_ctypes.dlopen}
        1    0.000    0.000    0.000    0.000 threading.py:114(RLock)
        1    0.000    0.000    0.000    0.000 _endian.py:26(_swapped_meta)
        1    0.000    0.000    0.000    0.000 _endian.py:49(BigEndianStructure)
        1    0.000    0.000    0.000    0.000 Image.py:1979(ImageTransformHandler)
        1    0.000    0.000    0.000    0.000 ImageFile.py:269(StubImageFile)
        1    0.000    0.000    0.000    0.000 {method 'index' of 'str' objects}
        3    0.000    0.000    0.000    0.000 {method 'cleanup' of 'ImagingDecoder' objects}
        1    0.000    0.000    0.000    0.000 __init__.py:580(Filterer)
        1    0.000    0.000    0.000    0.000 __init__.py:967(__init__)
        1    0.000    0.000    0.000    0.000 __init__.py:197(c_float)
        1    0.000    0.000    0.000    0.000 {method 'insert' of 'list' objects}
        1    0.000    0.000    0.000    0.000 __init__.py:332(CDLL)
        1    0.000    0.000    0.000    0.000 shutil.py:31(Error)
        2    0.000    0.000    0.000    0.000 __init__.py:429(__init__)
        1    0.000    0.000    0.000    0.000 __init__.py:353(Formatter)
        1    0.000    0.000    0.000    0.000 __init__.py:543(Filter)
        1    0.000    0.000    0.000    0.000 io.py:76(BufferedIOBase)
        1    0.000    0.000    0.000    0.000 shutil.py:38(ExecError)
        1    0.000    0.000    0.000    0.000 decimal.py:5677(__init__)
        1    0.000    0.000    0.000    0.000 __init__.py:291(c_wchar_p)
        1    0.000    0.000    0.000    0.000 decimal.py:272(Inexact)
        1    0.000    0.000    0.000    0.000 atexit.py:37(register)
        1    0.000    0.000    0.000    0.000 __init__.py:294(c_wchar)
        1    0.000    0.000    0.000    0.000 decimal.py:298(Rounded)
        1    0.000    0.000    0.000    0.000 __init__.py:1385(RootLogger)
        1    0.000    0.000    0.000    0.000 __init__.py:226(c_ubyte)
        1    0.000    0.000    0.000    0.000 decimal.py:250(DivisionImpossible)
        1    0.000    0.000    0.000    0.000 ascii.py:28(StreamWriter)
        1    0.000    0.000    0.000    0.000 decimal.py:195(InvalidOperation)
        1    0.000    0.000    0.000    0.000 decimal.py:310(Subnormal)
        1    0.000    0.000    0.000    0.000 decimal.py:234(DivisionByZero)
        1    0.000    0.000    0.000    0.000 decimal.py:5673(_Log10Memoize)
        1    0.000    0.000    0.000    0.000 __init__.py:172(c_ushort)
        1    0.000    0.000    0.000    0.000 decimal.py:261(DivisionUndefined)
       17    0.000    0.000    0.000    0.000 {method '__subclasshook__' of 'object' objects}
        1    0.000    0.000    0.000    0.000 decimal.py:183(Clamped)
        1    0.000    0.000    0.000    0.000 __init__.py:961(PlaceHolder)
        4    0.000    0.000    0.000    0.000 {thread.allocate_lock}
        1    0.000    0.000    0.000    0.000 Image.py:37(DecompressionBombWarning)
        1    0.000    0.000    0.000    0.000 posixpath.py:52(isabs)
        1    0.000    0.000    0.000    0.000 __init__.py:159(py_object)
        1    0.000    0.000    0.000    0.000 threading.py:1128(_DummyThread)
        1    0.000    0.000    0.000    0.000 Image.py:1974(ImagePointHandler)
        1    0.000    0.000    0.000    0.000 decimal.py:321(Overflow)
        1    0.000    0.000    0.000    0.000 __init__.py:168(c_short)
        1    0.000    0.000    0.000    0.000 ascii.py:31(StreamReader)
        1    0.000    0.000    0.000    0.000 __init__.py:260(c_bool)
        1    0.000    0.000    0.000    0.000 __init__.py:193(c_uint)
        1    0.000    0.000    0.000    0.000 __init__.py:201(c_double)
        1    0.000    0.000    0.000    0.000 decimal.py:359(Underflow)
        3    0.000    0.000    0.000    0.000 {abs}
        1    0.000    0.000    0.000    0.000 __init__.py:189(c_int)
        1    0.000    0.000    0.000    0.000 decimal.py:224(ConversionSyntax)
        1    0.000    0.000    0.000    0.000 posixpath.py:44(normcase)
        1    0.000    0.000    0.000    0.000 __init__.py:205(c_longdouble)
        1    0.000    0.000    0.000    0.000 __init__.py:180(c_ulong)
        1    0.000    0.000    0.000    0.000 __init__.py:176(c_long)
        1    0.000    0.000    0.000    0.000 threading.py:1097(_set_daemon)
        1    0.000    0.000    0.000    0.000 io.py:73(RawIOBase)
        5    0.000    0.000    0.000    0.000 TiffImagePlugin.py:562(decorator)
        1    0.000    0.000    0.000    0.000 Image.py:1938(_ImageCrop)
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}



real    0m36.156s
user    0m35.902s
sys 0m0.140s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment