imageproc icon indicating copy to clipboard operation
imageproc copied to clipboard

Draw non horizontal thick lines

Open remidebette opened this issue 5 years ago • 4 comments

Hi, Thanks for the nice library.

Following the issue https://github.com/image-rs/imageproc/issues/97, I understand the only way to draw a thick line is by using code similar to this: draw_filled_rect(&img, Rect::at(128, 10).of_size(118, thickness), Rgb([240, 240, 255]));

But such rectangles are necessarily horizontal from what I understand. Would it be possible to have a functionality such as this? https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html#PIL.ImageDraw.ImageDraw.line (two points and a thickness)

Otherwise what could be a workaround?

Thank you

remidebette avatar Oct 08 '20 17:10 remidebette

https://docs.rs/imageproc/0.21.0/imageproc/drawing/fn.draw_convex_polygon.html Lets you draw filled polygons. However, this makes no attempt to anti-alias the boundary of the polygon.

(If you plan on using this function, note that the next release of this library is likely to include https://github.com/image-rs/imageproc/pull/428 which renames the function to draw_polygon and makes it more general.)

theotherphil avatar Oct 10 '20 10:10 theotherphil

Hi, thank you for your response. I would rather wait for the next version of the lib then.

Do you know when it is scheduled?

remidebette avatar Oct 18 '20 15:10 remidebette

There's no fixed schedule for releases. I'll release a new version this weekend to pick up this change.

theotherphil avatar Oct 24 '20 16:10 theotherphil

So much for "this weekend". I've published a new version just now.

theotherphil avatar Nov 16 '20 19:11 theotherphil