Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add watermark #158

Open
holazt opened this issue Mar 6, 2018 · 7 comments
Open

[Feature request] Add watermark #158

holazt opened this issue Mar 6, 2018 · 7 comments
Labels
Enhancement Feature requests and code enhancements Plugin Issues related to plugins and API system

Comments

@holazt
Copy link
Member

holazt commented Mar 6, 2018

As a blogger, basically I use screenshots, but some people like to steal pictures. So I hope the watermark function can be on flameshot plan. Although primitive watermark is easy to implement, I wanted to make it customizable, not just text, even my own logo or any other images, and can resize and reshape these watermarks.

Off-topic, flameshot's arrows, draw lines, draw rectangles/ellipses, blur, etc., must be drawn once, and if you do not do well, you can not make any adjustments on the original basis.

@javierin
Copy link

javierin commented May 9, 2018

I would also vote for this one. Very nice to be able to configure a watermark (either text, transparent png) to be put on top of the captured screenshot

@lupoDharkael lupoDharkael added the Enhancement Feature requests and code enhancements label May 9, 2018
@technodrome
Copy link

+1. This would be very useful indeed.

@holazt holazt changed the title [ Feature ] Add watermark [Feature] Add watermark Jul 22, 2021
@holazt holazt changed the title [Feature] Add watermark [Feature request] Add watermark Jul 22, 2021
@fmiqbal
Copy link

fmiqbal commented Oct 29, 2021

Maybe mine a bit different, but it still has watermark concept, but what I need is timestamp, like Android timestamp watermark

@veracioux
Copy link
Contributor

@fmiqbal I think adding a specialized timestamp feature would be bloat. If you are on linux, perhaps you could make a script to generate an image with a timestamp, save it to a file, then make flameshot use it as a watermark.
Not sure if this strategy will be available on Windows, due to some technical considerations.

Or, if we implement a plugin API, someone can create a plugin that will do this.

All of this applies only after we implement the watermark feature of course.

@borgmanJeremy
Copy link
Contributor

@fmiqbal A simple script like this should get you started:

#!/usr/bin/env bash
timestamp=$(date +%T)

flameshot gui --raw | convert - -background transparent -fill grey -font Calibri -size 140x80 -pointsize 24 -gravity southeast -annotate +0+0 $timestamp output.png

@mmahmoudian
Copy link
Member

mmahmoudian commented Oct 29, 2021

@fmiqbal If you are on linux and have ImageMagic installed you can do the following for an already saved file:

montage -geometry +0+0 -background white -label "$(stat inputfile.png --printf=%y)" inputfile.png outputfile.png

basically it gets the file (inputfile.png) modification time (%y) and add it to the bottom of your picture with a white background and writes it into the outputfile.png.

if applied on this image you will get:

image

If you want it to be a real watermark you can use this:

#!/usr/bin/env bash

# a script based on https://amytabb.com/til/photography/2021/01/23/image-magick-watermark/

INPUT_FILE="aa.png"
OUTPUT_FILE="aa2.png"
WM_FONT="NewCenturySchlbk-Italic"
WM_FONT_SIZE="50"


# get the modification time
INPUT_FILE_MODIFICATION_TIME=$(stat "${INPUT_FILE}" --printf=%y)

# create the watermark

convert -size 320x100 xc:transparent \
        -font "${WM_FONT}" \
        -pointsize ${WM_FONT_SIZE} \
        -fill black        -annotate +24+64 "${INPUT_FILE_MODIFICATION_TIME}" \
        -fill white        -annotate +26+66 "${INPUT_FILE_MODIFICATION_TIME}" \
        -fill transparent  -annotate +25+65 "${INPUT_FILE_MODIFICATION_TIME}" \
        "/tmp/wm_front.png"

convert -size 320x100 xc:black \
        -font "${WM_FONT}" \
        -pointsize ${WM_FONT_SIZE} \
        -fill white   -annotate +24+64 "${INPUT_FILE_MODIFICATION_TIME}" \
        -fill white   -annotate +26+66 "${INPUT_FILE_MODIFICATION_TIME}" \
        -fill black   -annotate +25+65 "${INPUT_FILE_MODIFICATION_TIME}" \
        "/tmp/wm_mask.jpg"

composite -compose CopyOpacity "/tmp/wm_mask.jpg" "/tmp/wm_front.png" "/tmp/wm_final.png"


composite  "/tmp/wm_final.png" "${INPUT_FILE}" -gravity southeast -geometry +10+10  "${OUTPUT_FILE}"

if applied on this image you will get:

image

@fmiqbal
Copy link

fmiqbal commented Oct 29, 2021

@fmiqbal A simple script like this should get you started:

#!/usr/bin/env bash
timestamp=$(date +%T)

flameshot gui --raw | convert - -background transparent -fill grey -font Calibri -size 140x80 -pointsize 24 -gravity southeast -annotate +0+0 $timestamp output.png

Love this, results is good, I'll grab some file watcher to automate the process

my command goes like
convert 2021-10-29_20-41.jpg -background white -fill grey -size 140x80 -pointsize 18 -gravity southeast -annotate +0+0 "$(date +%Y-%m-%d\ %H:%M)" output2.png

nice on black, good enough on white
output2

Thanks, much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and code enhancements Plugin Issues related to plugins and API system
Projects
None yet
Development

No branches or pull requests

8 participants