##Image watermark.Add text watermark to pictures
#Quick Start
go get github.com/fengweiqiang/image_watermark
w := &image_watermark.Watermark{
Text: "Hello, 世界",
X: 20,
Y: 30,
FontSize: 10,
DPI: 75,
FontColor: color.Black,
Quality: 50,
}
or
w := image_watermark.NewWatermark("Hello, 世界")
w.X= 25
w.Y= 30
###load font library Available from C:\Windows\Fonts
fontBytes, _ := ioutil.ReadFile(inFilePath)
w.LoadFontBytes(fontBytes)
###write to file
w.TextWatermarkToFile("Hello.png","世界.png")
#comparison
Original image | Dst image |
---|---|