简体   繁体   中英

What would be the best way to layer images for a gallery?

I'm working on an image gallery for a website. There will be a bunch of images to include and none of them have watermarks right now. Is there a way to image a watermark over them without having to photoshop them? I ask this because new images will be added over time and it will be time consuming to photoshop each of them. An alternative solution would be to make the images not copyable, but I'm not sure what that would take. Any ideas are appreciated.

Unfortunately the question is a little vague, so I'll try to point you in various directions and you can decide which is most appropriate for you.

If you want to actually edit the image on the fly, why not look at using either PHP's GD or ImageMagick libraries. Both would be great for your situation, and you could cache your results. You could also check for a change in the watermark image, and if it's changed, reset all your cached images.

A simpler approach would be to just set the image you want to try to protect in some way as a background-image for some div , in which you add also include the watermark as an overlay (inside the div ). You could also use z-index es to achieve a very similar result. If you're going down this route, then you could also add some JavaScript to disable clicks on the image, or even include a popup saying that the image is copyrighted. However it's worth noting that this is a much less secure way of protecting your images, and some (like me) will only be more encouraged to get hold of the original.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM