fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.34k stars 352 forks source link

Is this library faster than setting pixels in image.Image? #180

Closed kwinso closed 1 year ago

kwinso commented 1 year ago

I'm trying to build a QR exporting interface with gg, and I have issues with floating point numbers (there's little gaps between QR code modules because I have to find size of module by dividing actual image size by amount of modules in the code)

I'm thinking about switching to image.Image and set bits individually by deciding to which module current pixel is closer.

Is there a difference in performance? Does the library have some optimizations in terms of setting multiple pixels (i.e. in DrawRectangle) at the same time?