cshum / imagor

Fast, secure image processing server and Go library, using libvips
Apache License 2.0
3.45k stars 138 forks source link

Feature: watermark support text #431

Open zhanghao1949 opened 7 months ago

zhanghao1949 commented 7 months ago

First of all, thank you for maintaining Imagor.

I am currently using the watermark feature of imagor and I have found that it does not support text watermarks. Do you have any plans to implement this feature?

cshum commented 7 months ago

Do you mean the "label" filter?

https://github.com/cshum/imagor/blob/master/README.md#filters

label(text, x, y, size, color[, alpha[, font]]) adds a text label to the image. It can be positioned inside the image with the alignment specified, color and transparency support

zhanghao1949 commented 7 months ago

@cshum Thank you for your reply. I have tried "label(test,center,center,100,red,0)", but it can only draw text once in a fixed position. The effect I want to achieve is to repeatedly fill the entire image with text.

test

What parameters should I use to achieve this effect?

duffn commented 6 months ago

I don't think this is possible with label, but you could make your text as an image and use watermark to achieve your desired results.

http://localhost:8000/unsafe/filters:watermark(https://blog.fmctraining.com/hubfs/putting%20an%20image%20in%20text%20photoshop.png,repeat,repeat,40,40,0)/https://raw.githubusercontent.com/cshum/imagor/master/testdata/gopher.png

gopher