govips icon indicating copy to clipboard operation
govips copied to clipboard

API to create a vips image from go image ?

Open MostAncientCapibara opened this issue 8 months ago • 1 comments

Does one exist? The other way around is simple enough via ToImage(), but how does one wrap a vips image over an existing go one or import it? Surely there's a faster way than encoding the go image as jpg/png to memory and then loading it with vips.

MostAncientCapibara avatar May 07 '25 09:05 MostAncientCapibara

For vipsgen you may use vips.NewImageFromMemory

see example https://github.com/cshum/vipsgen/blob/main/examples/from_go_image/main.go

cshum avatar Jul 14 '25 06:07 cshum