开发者

How can I process an image to remove a watermark within my iPhone application?

开发者 https://www.devze.com 2023-02-01 12:19 出处:网络
I want to remove watermark from a picture within my iPhone / iPad application.I开发者_JAVA百科s there any kind of image processing I can perform within this application to do this?Can\'t be done, sorr

I want to remove watermark from a picture within my iPhone / iPad application. I开发者_JAVA百科s there any kind of image processing I can perform within this application to do this?


Can't be done, sorry.

The watermarked image were originally two images (the base and the watermark), which were merged together to form the result. The problem here is that the most common image formats (such as JPG, PNG, or GIF) have no concept of layers - so that the base would be one layer, and the watermark another: the result is just one layer, onto which both were redrawn. This is somewhat similar to a physical painting: if you paint one image on a paper using watercolors, and then another over the same spot, their colors will mix and you won't be able to tell which parts belong to one or the other, as they'd become a single image.

This is similar with the computer image formats: there is only one "layer", which for every pixel encodes exactly one color that is there - only the current color exists, and the image doesn't keep track what was on that pixel before.

Now, the information is irreversibly lost from the result - in other words, it is not possible to recover the base knowing just the result (or the result and watermark) - BTW, that's exactly the point of watermarking.

I have borrowed the image sprites of StackOverflow for a demonstration; the actual images used are not unique, the technique would work just as well with any images. This was the watermark I used:

How can I process an image to remove a watermark within my iPhone application?

And this is the result image, after merging with the base:

How can I process an image to remove a watermark within my iPhone application?

Now, even though we have the exact watermark image used, there's no way to recover what was underneath that star in the original image. Through image processing operations, we could almost remove the star from the result, but there's not enough data to tell us what used to be underneath:

How can I process an image to remove a watermark within my iPhone application?

- that information got erased in the merge at the beginning.

We could guess what used to be there, but then we're not doing recovery any more, we're interpreting the image and guessing what possibly could have been there - and that's pretty hard, even for a human; computers are really bad at that. This is the original image, before I watermarked it - I bet you were expecting something slightly different, no?


The watermark is almost certainly part of the image. (The only case in which it wouldn't be is something like PDF or SVG, where it could be a separate vector element.)

Watermarks are typically present on images for purposes of managing intellectual property; if one has licensed an image for a particular use, typically one will receive access to a version of the image without a watermark. Thus wanting to "remove watermarks" is also likely to be treated as highly suspicious.


Watermarks are part of the image, there isn't going to be a magic way to remove them and recover the missing pixels in any tool.


Take a look at the source! Most or the current watermarking is done in php as an automated script. In most cases you will see the base picture in source

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号