's Avatar

@jcupitt.bsky.social

25 Followers  |  10 Following  |  40 Posts  |  Joined: 08.10.2024  |  2.284

Latest posts by jcupitt.bsky.social on Bluesky

Do you mean under the new pact? That has a maximum of 30,000 a year I think (not an expert).

15.05.2025 10:27 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Client Challenge

v3.0 of pyvips, the libvips binding for python, is out!

pypi.org/project/pyvi...

This release is much easier to install -- it's just `pip install pyvips[binary]` and it'll automatically download the right libvips for your platform. Linux / macOS / Win, x64 and arm64.

28.04.2025 10:22 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Have a look at eg:

github.com/jcupitt/buil...

Though I expect you know all this.

26.03.2025 15:09 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I made a nip2.app a long time ago:

github.com/jcupitt/buil...

and it includes the libvips dylib. It would need updating, but maybe there's something useful in there?

26.03.2025 15:01 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

And the oldest bits of libvips are from 1989 o.O Though it's been mostly rewritten a couple of times in those 35 years, to be fair.

I sometimes start talks with "was anyone here born before 1989?" and there have been a few times where no one has raised a hand haha.

20.03.2025 10:32 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Release v9.0.1-3 Β· jcupitt/nip4 First public release A windows binary is in the assets tag below. For linux, there's a PR to add nip4 to flathub here: flathub/flathub#6166 You can install one of the test releases from that PR wit...

nip4 has a first test release!

github.com/jcupitt/nip4...

This is a rewrite of nip2 for the gtk4 UI toolkit. The backend is all the same, so it should run all old workspaces, but the UI is new and quite a bit slicker.

Any feedback would be very welcome!

25.02.2025 15:22 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

- the underlying image processing library is pure, functional, and lazy, hence the low memory use
- the scripting language (dynamic Haskell with classes) is also pure, functional and lazy
- the GUI is built with gtk4, so it all renders on your GPU for smooth 60fps animations

01.02.2025 12:34 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
nip4 January progress A fast image processing library with low memory needs.

nip4, the libvips image processing spreadsheet, is almost done!

www.libvips.org/2025/01/31/n...

It's correctly loading all the test workspaces I have, including a monster with 8.500 rows and 15,000 images.

I'm aiming for late Feb for a first alpha release.

01.02.2025 12:31 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I'll see if I can make a quick pyvips benchmark from that.

You shouldn't get libvips crashes, it's used on huge image proxies generating many millions of images an hour. I'd think a bug in the go binding (which we were not involved in) is more likely.

01.02.2025 10:44 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

We should switch to github and make a tiny benchmark program with defined image sizes, formats, crop areas, resize ratios etc etc

31.01.2025 19:18 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Ah wait, do you just want to load complete JPEG images into GPU memory? Then you need a fast jpeg library (eg. libjpeg-turbo), and to run a decode on each core you have available. An image processing library probably probably won't help much.

31.01.2025 16:45 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Most efficient region reading from tiled multi-resolution tiff images Β· Issue #100 Β· libvips/pyvips Hi! This is not really an issue, but more of advice seeking. The context is that I am working with histopathological images (known as whole slide images) that have a typical size of 100k x 100k pix...

It depends on the patch size. For small 32x32 pixel patches I got 25,000 / sec last time I tried:

github.com/libvips/pyvi...

But benchmarking is difficult. Before doing anything, you need a small program that accurately represents your expected use case.

31.01.2025 16:41 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
GitHub - kleisauke/libvips-packaging: Packaging scripts to prebuild libvips and its dependencies. Packaging scripts to prebuild libvips and its dependencies. - kleisauke/libvips-packaging

It just picks one of these for you:

github.com/kleisauke/li...

so current stable libvips compiled to (almost) every combination of glibc / musl, x64 / arm32 / arm64, and linux / windows / macos.

31.01.2025 16:36 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

The upcoming pyvips tries to fix this by automatically downloading a suitable libvips binary for you (just like sharp does on node). Though that's no help for you, of course :(

31.01.2025 10:54 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

The core is here:

github.com/libvips/libv...

The rest of the C++ binding is mostly just convenience functions, overloads, stuff like that.

25.01.2025 16:37 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
libvips A fast image processing library with low memory needs.

There's a chapter in the docs on binding:

www.libvips.org/API/current/...

tldr: Don't bind the main C API, bind the GObject API instead. The C++ binding might be a useful starting point -- it's only about 500 lines of code.

25.01.2025 16:34 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

You could use pyvips, perhaps. It exposes the whole libvips API, and speed should be good.

22.01.2025 10:12 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Is that `DISC_THRESHOLD`? I don't think it's a security risk, is it? Filling server memory and causing a DoS might be worse.

21.01.2025 17:45 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I was sure I pressed reply :( I'm not good at bsky

bsky.app/profile/jcup...

16.12.2024 16:29 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

We have a paper at IS&T in feb with some technical background and more detail, if you're interested:

www.southampton.ac.uk/~km2/papers/...

16.12.2024 16:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

So for this image on this PC, libvips is about 5x faster and needs 10x less memory. You'll see similar results for PNG and TIFF, much worse for HEIC and AVIF heh.

They use the same lanczos3 resizing kernel, so quality should be identical.

16.12.2024 16:20 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

You can compare speed and memory use like this:

$ /usr/bin/time -f %M:%e vipsthumbnail big.jpg --size 256x256 -o x.jpg
58180:0.20
$ /usr/bin/time -f %M:%e convert big.jpg -resize 256x256 x.jpg
717356:1.39

The output is peak memory use in kb, elapsed time in seconds. This is a 10k x 10k pixel JPG.

16.12.2024 16:17 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 1    πŸ“Œ 1

Sample C code here: github.com/libvips/libv...

Sorry, I've not used Go, you'll have to investigate.

11.12.2024 14:40 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
libvips A fast image processing library with low memory needs.

You need to listen for the "eval" signal on the output image. It'll trigger for each work unit completed, with an ETA and percent-done.

www.libvips.org/API/current/...

There's also preeval and posteval for setup and teardown. You can call "kill" in the handler to cancel computation.

11.12.2024 14:14 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

... to save you a click, on that test libvips is about 7x faster and needs 1/10th of the memory.

But it's a bit misleading -- libvips is threaded and opencv is largely unthreaded, plus that test is using TIFF images, which opencv does not handle quickly (in my experience).

26.11.2024 14:17 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Speed and memory use A fast image processing library with low memory needs. - libvips/libvips

There's a benchmark here comparing libvips to a range of other libraries, including opencv:

github.com/libvips/libv...

libvips does well on that test at least. It'd be much slower than opencv for more vision-like tasks, or on small images, but it can work well for basic image processing.

26.11.2024 14:13 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Issues Β· libvips/libvips A fast image processing library with low memory needs. - Issues Β· libvips/libvips

libvips author here. It uses the same resampling algorithm as imagemagick (lanczos3), so quality should be the same.

If you find a case where quality is different, please open a bug report with some sample images and the command that you ran:

github.com/libvips/libv...

20.11.2024 14:16 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

darthsim is a good bloke, he did the improved JXL support in libvips 8.16, so he's certainly interested

15.11.2024 07:26 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Ooo, nice!

libvips 8.16.1 will have a policy for multipage JXL: if all frames have a duration of 0xffffffff, it's a many page still image; otherwise, it's animated.

Downstream libraries can handle the mixed case, if they dare.

01.11.2024 11:47 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

OK, libvips 8.16 is out now, woo! It's finally someone else's responsibility if it doesn't work hehe

28.10.2024 12:15 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@jcupitt is following 10 prominent accounts