Become a fan of Slashdot on Facebook


Forgot your password?
Linux Software

Batch Processing And Digital Watermarks? 7

A not-so-Anonymous Coward asks: "I hope to start a ( is so '90s, yuck) when I finish University (UK), and it will involve stuff to do with graphics. The question is: What's going on with Digital Watermarks, and how could I start using them in free software? Are they patented? Do they involve scary math? My ideal answer would be a C library or Perl module that can work with the standard graphics libs/mods that could do long batches of them, or even a script-fu for The Gimp."
This discussion has been archived. No new comments can be posted.

Batch Processing And Digital Watermarks?

Comments Filter:
  • Has anyone done this with Java's 2D API? I have an app that dishes up media via a servlet, and I really need to sort out some kind of watermarking -on the fly- (i.e. as the image is being delivered to the browser, with timestamp, ip address, remote_user, etc.) - since the servlet is lit up and running, it would be ideal to do it there in Java, without the overhead of forking a separate perl or imagemagick or gimp process. Both hidden and visible watermarks would be ideal. Any ideas or pointers to existing code?

  • Well, it's scary depending on how much experience you have. If you've taken Number Theory, Algebra (the college kind), or a cryptology class or two you can probably figure out the math given time. It involves a lot of coding theory, since the basic idea of a digital watermark it to encode some identifying information into the low bits of the graphic, along with a strong error correcting code which prevents it from being destroyed by the usual image manipulations (shrinking, streching, adjusting contrast, etc). There are also considerations for things like making sure that only a valid watermark is identified as such (that is, you should be able to examine a graphic [obviously not with your eyes, I mean with a program that does this sort of thing] and tell if it is watermarked or not, and if so what the watermark says). Ross Anderson has done some work on that, IIRC. His webpage is

    As far as the whole batch processing thing goes, I really don't know. Presumably, given a program that watermarks a JPEG, it would be fairly easy to automate it with a Perl or shell script to do a whole directory tree.
  • Since the JPEG uses lossy compression, digital watermarking and steganography do not work very well with that format. The preferred formats are GIF and BMP. Also, digital watermarking does not preserve the information across file format conversions. Given this, how useful is the copyright that is normally watermarked when it could be removed through file format conversions (GIF->JPEG->GIF) by anybody, including intelligent monkeys []? Does anybody else remember when this used to be called covert channels []?
  • I disagree. JPEG can efficiently be used as a cover-object (Yep... Used to be called cover channel...) Some algo using a transform domain techniques (FFT or DCT) can "resist" JPEG compression down to 40% quality and even resist image format conversion. The LSB proposition made earlier is known to be the simplest and least efficient digital watermarking techniques. In fact, it is proven that if you use a sorted palette with LSB watermarking, you can easily destroy any watermark by randomly generating the LSB of every pixel without disturbing the quality of the picture (Not noticeable by human eyes). Check out the book : Information Hiding ISBN: 1-58053-035-4 Excellent beginner to intermediate book. Scary Math: YES!! ;-)
  • GD can do visible watermarking. Or do you mean the digital signature kind? I have a feeling the perl or php will cut it. If you want to do visible watermarking, GD has perl and php support, if not, just dump whatever "signature" you want into the image. Kinda like stego.
  • There was a special issue on digital watermarking in Communications of the ACM two years ago: The citation is CACM vol 41, no 7, July 1998.

    I never read the articles on the subject very carefully, but I don't think they presented more than ideas there (CACM is rarely technical nowadays), but maybe it is possible to get some pointers to modern research. The articles discuss many types of watermarking, including what you probably want: cryptograhpically secure which is robust against operations such as compression, filtering, and reduction.

    The field of digital watermarking seems quite undeveloped, so I wouldn't hold my breath for free software for it.

  • Interesting questions. Firstly a disclaimer. I know bugger-all about digital watermarking, but I've got some ideas on how to implement it.

    I've no idea about patents. Hopefully someone else will be able to answer that one.

    Do they involve scary maths? I don't think so, unless you consider error-checking/correction algorithms to be scary.

    My guess is that these algorithms work by using the least significant bit of the RGB values of the image to embed some kind of digital signature (what that signature contains is up to you). This will add a small amount of 'noise' to the image, but my guess is that this will be imperceptible, since the human eye/brain is very forgiving of noise (that is why floyd-steinberg error diffusion dithering works so well).

    For a watermark, you could almost certainly get away with just using the LSB of one byte of the RGB value. I'd recommend using Blue, since it's the darkest of the three primary colours.

    So far, that would be very trivial to implement. Your biggest problem would be preserving the watermark when lossy compression algorithms, such as JPEG, are used. This may (I'm guessing here) be solvable by repeating the watermark thoughout the image and using an error-correction algorithm to reconstruct the watermark. This should be possible, but you may need to experiment and possibly devise your own error-correction algorithm.

    I've no idea if anyone has implemented an open-source digital watermark. I thought that it would make an interesting project, but got no further than thinking about it.

    If you're interested in writing one and want to discuss it further with me, my email address is wyrd(a) (remember to replace (a) with @)


    Yellow tigers crouched in jungles in her dark eyes.

Don't get suckered in by the comments -- they can be terribly misleading. Debug only code. -- Dave Storer