canvas
bella
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
canvas
-
Canvas vector graphics update: rich text and path boolean operation support
I wanted to share a recent large update to https://github.com/tdewolff/canvas, which is a vector graphics library written in Go to create images, PDFs, SVGs, OpenGL, etc. using vector drawing operations. Especially I wanted to show two new exciting features:
-
Client-side scripting for in-browser graphics.
It appears that there's a port of Cairo to Go which also targets webassembly. https://github.com/tdewolff/canvas
- Pixie – A full-featured 2D graphics library for Nim
-
Processing equivalent in GoLang
https://github.com/tdewolff/canvas/blob/master/examples/opengl/main.go can draw primitves but i think it would be a bit hard to do event based animation
-
tdewolff/canvas: vector graphics in Go (mayor update)
Yes! See https://github.com/tdewolff/canvas/tree/master/examples/gonum-plot for an example using gonum-plot. You should be able to plug-and-play to use the canvas library!
- Cairo in Go: Vector to SVG, PDF, EPS, Raster, HTML Canvas, etc.
bella
-
tdewolff/canvas: vector graphics in Go (mayor update)
E.g. for text rendering, I find the largest font size that still renders inside that constraint. https://github.com/tv42/bella/blob/42d81584a247a38647c3ccc63e58b50e1c00e444/internal/render/render.go#L118 and https://github.com/tv42/bella/blob/42d81584a247a38647c3ccc63e58b50e1c00e444/internal/render/binsearch.go -- note I'm doing the scaling with the font renderer, not by resizing the output of whatever it renders, because different sizes get different hinting.
-
Generate text to image in Go
Hi! Thank for reading my post. For my use case this is more than enough and anyone can modify the code which is available on github. I will definitely consider https://github.com/tv42/bella/ on my other project. By the way I put some provision on specifying the font size via the web interface and facebook uses at least an og:image of 1200x630 hence fixed image. Cheers!
What are some alternatives?
svgo - Go Language Library for SVG generation
gofpdf
gg - Go Graphics - 2D rendering in Go with a simple API.
unipdf - Golang PDF library for creating and processing PDF files (pure go)
tiny-skia - A tiny Skia subset ported to Rust
generative-art-in-go - A companion source code repository to the book "Generative Art in Go"
go-cairo - Go binding for the cairo graphics library
bgracontrols - 🆗 BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications.
resize - Pure golang image resizing
imagick - Go binding to ImageMagick's MagickWand C API
imaginary - Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
go-opencv - Go bindings for OpenCV / 2.x API in gocv / 1.x API in opencv