John Cupitt
John Cupitt
Hi @json20, I'm not sure I follow, could you post some sample code? Replace alpha: yes, extract RGB and reattach the new alpha, eg.: ```python new_rgba = rgba[0:3].bandjoin(new_a) ``` is...
Sorry, it's still not clear what's going on. Where's this alpha coming from? Could you make a complete, runnable program that shows the problem? Otherwise I'll need to spend 20...
Ah, I see, thanks. Yes, `draw_mask` is using the alpha image to scale the constant `[255, 0, 0, 255]` when it draws into the image, so it's scaling both the...
Huh strange, it seems reliable for me. I tried: ``` for i in {1..100}; do echo loop $i ...; pytest > /dev/null || break; done ``` And it gets to...
Huh that's a bit surprising, I hadn't expected a test failure to be just a warning. I tried again without the `> /dev/null` and it ran cleanly. Maybe it's the...
I checked the logs and 8.13 has some changes to hide setup loops from progress reporting. Could that be it?
Hello @vncsms, You need `new_from_buffer` and `write_to_buffer`: ```python #!/usr/bin/python3 import sys import pyvips buf = open(sys.argv[1], "rb").read() im = pyvips.Image.new_from_buffer(buf, "", access="sequential") buf_out = im.write_to_buffer(".webp") open(sys.argv[2], "wb").write(buf_out) ``` You can...
Sorry, no idea, I guess there must be something funny about your install. I'll make you a tiny Dockerfile.
Try this: https://github.com/jcupitt/docker-builds/tree/master/pyvips-python3 I see: ``` $ docker pull python:3 3: Pulling from library/python ... Status: Downloaded newer image for python:3 $ docker build -t pyvips-python3 . Sending build context...
Hello @2h4dl, use `thumbnail`, it has extra logic for resizing animated images. ```python thumb = pyvips.Image.thumbnail("brush.gif", 128, n=-1) thumb.write_to_file("x.gif") ``` To make: 