fogleman / gg

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

Custom image size #117

Open metehus opened 3 years ago

metehus commented 3 years ago

I'm using the DrawImage method, but i can't specify the size i want for the image, since there's no parameter for that. Is it possible to do? otherwise, would be cool to add that feature.

fogleman commented 3 years ago

You can use something like https://github.com/disintegration/imaging to resize the image before drawing it.

HeCorr commented 3 years ago

Or you can use Scale/ScaleAbout. Pre-processing the image as mentioned above is simpler although maybe not as efficient.