John Cupitt
John Cupitt
I made you a tiny demo program: ```python3 #!/usr/bin/python3 # generate test dataset with # # for x in {1..20}; do # for y in {1..50}; do # cp ~/pics/theo.jpg...
Hi @vansante, vipsthumbnail doesn't attempt to crop animated images, but I agree it's an obvious thing to add. Let's tag this as an enhancement.
Hello @sfcgeorge, As you say (with your nearest vs. integer test), this is down to corner vs. centre convention. libvips is corner (strict round down) by default, but will change...
See: https://github.com/libvips/libvips/issues/2945 To do: - [x] same for jpeg decompress (see openslide for example code) - [ ] possibly deflate as well? lzw? - [x] same for TIFF save
I added JPEG decompress too. Before: ``` $ time vips avg x.tif 117.855086 real 0m0.796s user 0m1.114s sys 0m0.133s ``` After: ``` $ time vips avg x.tif 117.855086 real 0m0.319s...
No need to add this to tiff write -- that already runs in a background thread.
It still seems to be slower than openslide load: ```python #!/usr/bin/python3 import sys import time import pyvips start = time.time() image = pyvips.Image.openslideload(sys.argv[1]) print(f"avg = {image.avg()}") end = time.time() print(f"openslide...
I tried adjusting the libvips threadpool: ```python #!/usr/bin/python3 import sys import time import pyvips start = time.time() image = pyvips.Image.openslideload(sys.argv[1]) a = image.avg() openslide = time.time() - start start =...
Oh heh it's just the demand style. `avg` uses `THINSTRIP`, so it's scanning the TIFF file using one pixel high tiles. Each avg tile will therefore hit every TIFF tile...
OK, all done. Before: ``` $ vips copy wtc.jpg x.tif[tile,compression=jp2k] $ time vips avg x.tif 117.249845 real 0m15.085s user 0m16.155s sys 0m0.109s $ vips copy wtc.jpg x.tif[tile,compression=jpeg] $ time vips...