webimg 0.0.1 released: working watermarking

Initial version of webimg – library written in Go lang to manipulate images. Currently it is able to watermark JPG image with PNG logo at defined opacity.

To use this library in your Go application initialize sources:

go get -d -u code.gyt.is/webimg

Include it in your application:

import (
	"code.gyt.is/webimg"
)

And then call function:

// Input image, watermark image, result image, bottom-right offset X, bottom-right offset Y, watermark alpha
doWatermark := webimg.Watermark("smplayer_preferences.jpg", "watermark_inretio-logo.png", "result_img.jpg", 30, 30, 70)
if doWatermark != nil {
  fmt.Println("There was an error watermarking image...")
}

Currently the library is able to watermark JPEG image with PNG watermark (which should have transparent background). You can set offset in pixels from bottom-right corner (in example 30, 30) and transparency of watermark image (in example 70, scale is 0-255 where 0 is solid and 255 is transparent).

Sources are published on my privately hosted instance of Gitea: source.gyt.is/gytisrepecka/webimg/.

Follow this blog for news and changelog from fediverse: @webimg@fedi.dev.

If you have any feedback or ideas, drop me an email at gytis@repecka.com or on Mastodon at @gytis@mastodon.lt.