Yet another way protect pictures against copying

It's not possible to protect an image against any person, but it can be protected enough for most of the users. There are a couple of ways to do this, most popular are CSS tricks, but today I will present another way.

Can you save below image? I bet you can't! ;-)

Lest imagine an image 100px x 100px, instead of displaying it to the user, we can show him/her a table 100x100, where each cell is 1px x 1px size and has the same color as the image same with the same coordinates. mentioned image size is just for make it easier to understand, in fact it can be any size, but the bigger it is, the bigger the table is and it can dramatically slow down the web browser.

I made a simple script to translate images into tables, you can download it from my GitHub (note that you need all files in the directory, not only the script). You need Python3 and Pillow library to run it.

Usage is simple, there is only one (mandatory) command line - the path to the input file:

C:\Users\rgawron\snippets\Image2HTMLTable>python image2HTMLTable.py sampleImage.png

Generated table-image is stored as output.html

5 comments:

  1. That's insane! ;-)

    ReplyDelete
  2. http://i.imgur.com/HvI69bV.png

    ReplyDelete
    Replies
    1. You're doing it wrong, that has extra pixels. https://i.imgur.com/GjqnPNL.png

      Delete
  3. I can save the image, do I win a prize?

    In Firefox, right click -> Inspect element -> right click on "table" in the breadcrumb bar at the top -> Screenshot Node.

    ReplyDelete
    Replies
    1. Hi,

      that's smart :)

      The code was made around 2007 and later slightly updated - first version was made in Perl.

      Back in time I didn't think it's possible this way, even now it was a bit of surprise for me that modern browser can do that :)

      -Robert

      Delete