Also, is it possible that it's not an image but a graphic created by
some code in javascript or some other language?
Option 1
Use svg tags in html. This still is not at all copy proof, but reduces options for copying to:
- Looking at the source html and copying it
- Screenshots
Most graphic tools, photoshop, etc, have a vector or svg mode that can export the images you created in that mode as html tags that look like:
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow"></circle>
</svg>
The user will not be able to right-click and save this image, but they will be able to inspect and steal the code itself.
Option 2
Use Javascript and HTML canvas to draw the image programmatically.
Ways the user can copy:
- Steal the JS code from the browser (super easy, but only useful if they're planning on displaying
the image on some platform that supports canvas)
- Screenshot
.
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
var centerX = canvas.width / 2;
var centerY = canvas.height / 2;
var radius = 70;
context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = 'green';
context.fill();
context.lineWidth = 5;
context.strokeStyle = '#003300';
context.stroke();
My two cents, either use watermarks or low res versions of the images you're worried about. Anything you put on a website is trivial for anyone who knows what they're doing to copy. The above options are fun and interesting to think about, but ultimately are a lot of work for devs and defeated by a single key stroke.
Last thought
One last idea that might mitigate the ability of the average joe to copy, would be to require ten different keys to be held in order to see the image in particular. Like the other options, this is circumventable by anyone who knows what they're doing, but a normal user would have trouble hitting PrtScn while his other fingers are occupied. Not the best UX... but hey :)