imaginary icon indicating copy to clipboard operation
imaginary copied to clipboard

Proportional watermarkimage

Open foobargeez opened this issue 7 years ago • 5 comments

Can we make it possible to dynamically resize watermark image to a specified width (and height) before overlaying on the source image? The issue is that I deal with thousands of images of various resolutions and generating a proportional watermark image for every resolution, save to disk and pass the URL to the imaginary isn't very flexible/efficient. I am migrating from imagemagick and IM does support specifying desired width and height and the gravity for the watermark image and does in memory resizing. Can we get similar functionality to imaginary as well? This is the last thing that is pending for me (hopefully) to completely move to imaginary.

Thanks!

foobargeez avatar Jan 06 '19 05:01 foobargeez

Can you solve it using pipelining?

Dynom avatar Jan 07 '19 08:01 Dynom

Thanks. I indeed use pipeline but I am not quite sure how to resize a watermark image and pass it to /watermarkimage without saving the resized watermark image to the disk (as /watermarkimage expects a URL/rel path for the watermark image).

foobargeez avatar Jan 07 '19 10:01 foobargeez

I thought it would be useful to provide an example:

magick source.jpg watermark-color.png -resize "%[fx:t?u.w*0.25:u.w]x" -gravity southeast -composite result.jpg

I use the above command to watermark a source image by specifying that the watermark image width should be 25% of the source image width (and height per the aspect ratio).

foobargeez avatar Jan 07 '19 11:01 foobargeez

I'm also facing the same issue @foobargeez have you figured out how to solve it?

istudko avatar Jun 13 '22 10:06 istudko

@istudko no :-/. I am watermarking using imagemagick after the image changes/transformations/optimizations by imaginary -- I really wish I can do this as part of the pipeline. Checkout https://imgproxy.net/ -- on my list to see if it solves this issue.

foobargeez avatar Jun 17 '22 11:06 foobargeez