Watermark on hotlinked images?

Someone asked on Stack Overflow:

I wonder if its possible to have a watermark on hotlinked images on an external site, but not on the original site? I’m using jQuery, can I do something about this?

Thanks heaps!

I posted the following answer, which was chosen as the accepted answer and received 2 upvotes:

This is not possible through a client-side technology. You will need to go server based.

If you have access to a server side technology, such as ASP.NET; you could expose all of your images through an ashx handler. This would let you display a water mark on some images, or not display images at all depending on the source.

Here’s a great article on writing ashx handlers for images — http://dotnetperls.com/ashx-handler/ https://web.archive.org/web/20160311222240/http://www.dotnetperls.com/ashx-handler

If you are using a *nix based server, @Jojo has some links for using php to similar effect.

After writing such a handler in ASP.NET or php, you’ll need to check the HTTP Referer to see if it is a page on your site, or a third party site and then do the necessary image processing to produce your watermakr effect.


Originally posted on Stack Overflow — 2 upvotes (accepted answer). Licensed under CC BY-SA.

signed letter b

Dad. Geek. Gamer. Software developer. Cloud user. Old Car enthusiast.  Blogger.


Top Posts


profile for Nate on Stack Exchange, a network of free, community-driven Q&A sites
a proud member of the blue team of 512KB club
Thoughts, opinions, and ideas shared here are my own. © 2026 Nate Bross.