Results 1568 comments of John Cupitt

Hi again, try: ```python a = pyvips.Image.new_from_file(xxx) b = pyvips.Image.new_from_file(yyy) mse = ((a - b) ** 2).avg() ```

You can stream this computation, so this would be faster: ```python a = pyvips.Image.new_from_file("a.tif", access="sequential") b = pyvips.Image.new_from_file("b.tif", access="sequential") mse = ((a - b) ** 2).avg() print(f"mse = {mse}") ```

Hi again, do you want to do this for each pixel? Or for whole images?

You can use `condition.ifthenelse(then_image, else_image)` to use a condition image to pick pixels between two images. You'll need to remove the `.avg()` from your MSE calculation, since that will find...

You can use the boolean operators to combine conditions, or you can nest `ifthenelse`. ``` out = (a < b & a < c).ifthenelse(a, (b < c).ifthenelse(b, c)) ``` Or...

Something has gone wrong --- you'll get an image back from ifthenelse, not a bound method. Did you forget the `( )`?

You need to post a complete program I can run. Here's what you should see: ``` $ python3 Python 3.9.7 (default, Sep 10 2021, 14:59:43) [GCC 11.2.0] on linux Type...

Hello @bverem, That's right, openslide can only open from files. Many slide formats come as sets of files on disc, so it's not really possible to open from memory. The...

Hello @petoor, I think it's trying to open your NDPI image with libtiff instead of openslide. Try: ```python x = pyvips.Image.openslideload("something.ndpi") ```

It was a bug in 8.9.0, it should be fixed in 8.9.1. I see: ``` $ python3 Python 3.7.5 (default, Nov 20 2019, 09:21:52) [GCC 9.2.1 20191008] on linux Type...