(Jan-24-2023, 01:35 PM)dfkettle Wrote: So is there any reason to use ImagePath if you don't need to call any of its methods (compact(),getbox(), map(), toList(), transform())? In other words, simply creating an Path object doesn't really do anything?Yes,you call methods if need eg more info like
bounding box
of the path.Then call method
getbox()
.from PIL import Image, ImageDraw, ImagePath img = Image.new("RGB",(800,400),(255,255,0)) cnv = ImageDraw.Draw(img) path = ImagePath.Path([(0,0),(250,300),(500,250),(0,0)])
# Use getbbox() method to get bounding box of the path >>> path.getbbox() (0.0, 0.0, 500.0, 300.0)