libvips / pyvips

python binding for libvips using cffi
MIT License
649 stars 50 forks source link

draw_rect fill error #465

Closed itfarsh closed 7 months ago

itfarsh commented 7 months ago

image

In the manual there is fill, without fill it works fine, but with it it gives an error: pyvips.error.Error: draw_rect needs 6 arguments, but 1 given

jcupitt commented 7 months ago

Hi @itfarsh, the syntax is eg.:

$ python
Python 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvips
>>> im = pyvips.Image.black(100, 100)
>>> im = im.draw_rect(255, 10, 10, 50, 50, fill=True)
>>> im.write_to_file("x.png")
>>> 

... but the draw operations are very slow. I'd find another solution, if possible. What are you trying to achieve?

itfarsh commented 7 months ago

Okay, I realize positional arguments are supposed to be, sorry.