John Cupitt
John Cupitt
Here's a slightly better Autotrace.def: ``` // autotrace as a menu item // make sure you have the "autotrace" command-line program installed Autotrace_item = class Menuaction "_Trace" "convert a bitmap...
I've added this menu item to nip2, I should say, it'll be at the bottom of the Filter menu.
Hello @MAJAQA, 1. libvips uses 0 and 255 for mono images, so you just need to average each 16 x 16 block. In Python, it's `small = big.shrink(16, 16)`. 2....
Hi again, it should work. For two ordinary RGB jpeg images I see: ``` $ python3 Python 3.9.5 (default, May 11 2021, 08:20:37) [GCC 10.3.0] on linux Type "help", "copyright",...
It should work with python2 as well. I had a go: ``` $ sudo apt install python2-dev $ curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py $ python2 get-pip.py $ pip2 install pyvips $...
How large are your 1-bit TIFFs? `labelregions` needs a uint32 for each pixel, so it will use a lot of memory for large images.
Sorry, `labelregions` on an image that size will need at least 40GB of RAM for the id array. How about running `labelregions` on the 16 x 16 shrunk image? That...
Sorry, that's just the way the `labelregions` algorithm works. It's like a flood-fill from every pixel, searching for different pixels. You can imagine it needs to be able to have...
Sorry, libvips only supports writing multipage TIFFs where all pages are the same size. You'll need to write two separate TIFFs, then combine them with `tiffcp`.
Hello @thomascong121, Yes, use `level=` to specfy the level you want. Docs here: https://libvips.github.io/libvips/API/current/VipsForeignSave.html#vips-openslideload You can convert to a numpy array in the usual way: https://libvips.github.io/pyvips/intro.html#numpy-and-pil