DISQUS

tlrobinson.net / blog: tlrobinson.net / blog » Blog Archive » Recovering Censored Text Using Photoshop and JavaScript

  • jib · 1 year ago

    @Gabulit:


    This algorithm takes a certain type of censored text as input, and enables the user to find out what the original text was. How can you possibly claim that it doesn't recover censored text, when that is exactly what it does?

  • Gabulit · 11 months ago
    It is like multiplying a number with 2. You tell me your number and i will divide it with 2 to get the result. This is not recovery. Recovery should be getting a number without knowing the exact algorithm that the number is made of.
  • Stuart · 1 year ago

    You could probably speed it up/increase accuracy by using Markov chains to try more likely next letters before less likely ones.

  • Daniel · 1 year ago

    Ballpark — The easy way to send estimates.

  • Brian · 1 year ago

    Blacking out text isn't really an answer on a variable width font, either:


    See Here

  • Vivin · 1 year ago

    @Stuart


    I think you would need a sufficiently large body of pre-existing text to figure out which letters are likelier than others. Also, a Markov chain wouldn't help that much on such small set of letters.

  • Anonymous · 1 year ago

    @Vivin


    more likely as opposed to likelier...

  • Tommy · 1 year ago

    Pff... There's no wrong way to eat a rhesus.

  • Tom · 1 year ago

    It's possible to reverse the black ink process ?????????? use to ?????????? their ??????? too. There are some gentlemen at the door in black suits with mirror shades in a Party Van. I'll just go and tell them they have the wrong address and I'll explain.

  • Michel Rouzic · 1 year ago

    I don't know if JavaScript allows you to do that, but you should try cross-correlating each blurred character with the blurred image instead. For each character you could find the position of all its occurrences in the image in one pass.


    And to save you the googling, cross-correlation is just space-space domain convolution with a reverted (flipped both horizontally and vertically) kernel, the kernel being the letter, and basically in the resulting image a bright peak denotes the detection of a match (although the peak isn't even ideally a sharp peak because its frequency response is mostly the square of the kernel's frequency response, but in your case it shouldn't be much of a problem anyways).

  • Fri13 · 1 year ago

    This works only for known fonts and known simple blur text.


    Blur twice with different blur types scaling text between them or even better, use smudge tool after the blur (or before) and not anykind software is capable to find out what text there has be written.


    If I would rate this demostration scale easy:0 and impossible:100, this trick would be just a 1 or 2 when talking about censoring text.

  • Stuart · 1 year ago

    @Vivin


    You don't need any more known text to use Markov chains. Let's say we know it's English based on the known text, and we've discovered that a letter is 'q' instead of running through all the letters a-u before discovering that the next letter is 'u', we should try 'u' first based on probability.

  • PrettyCool · 1 year ago

    So.... Now you just need a rainbow table of every popular font filtered with all popular filtering techniques.


    Then set it loose on google images and see what you can find :)

  • Liam · 1 year ago

    Making use of ascender/descender information might let you "resync" proportionally-spaced text after an error; spaces may also be visible.


    A dictionary-based approach, matching ascender/descender patterns and word length, would probably be a lot more effective, but before long you'll be replicating OCR software :)

  • Justin · 1 year ago

    Any one else try to run it? I tried my own image then tried the one that comes with it. I keep getting an error on line 149:" app.activeDocument.artLayers[textDocTextLayer].textItem.contents = string;"

  • Tom · 1 year ago

    @Justin: I think I left out this step:


    "Double-click the Smart Object layer to open it's source document, and adjust the variables listed at the top of the JavaScript to match the names and layers."

  • axlenoco · 1 year ago

    very amazing?

  • Juancho · 1 year ago

    Jejejeje....


    Ojala en algun dia que los gobiernos de: Venezuela, Cuba, Bolivia, etc... Para despellejarlas esos textos censurados/as por la CIA, USAID, etc., por meter problemas a Venezuela y Bolivia....


    Ademas Sin embargo que, sin ningun comentarios como estas...


    Ojala que los Gobiernos de Venezuela y Bolivia descubran los papeles secretos informatizados (como emails, fotos, etc.) para desemascarar las garras del imperialismo gringo que lo hizo el 11/04/2002 y el Caso de Bolivia ....

  • Craiig · 1 year ago

    Have you looked into using a hill climbing algorithm? Sorry, I didn't look that closely at your code so you may have already done this.


    http://en.wikipedia.org/wiki/Hill_climbing


    It may help you speed things up a bit and get better accuracy. The idea is to essentially make a quick (random) approximation, and then iteratively 'make it better'.

  • Tom · 1 year ago

    @Craiig: Thanks for the suggestion. That might be a good idea, though it's not immediately obvious how I would apply a hill climbing algorithm.


    The main problem is that with proportional width fonts the accuracy of all subsequent guesses depends a lot on the accuracy of the characters guessed so far. Perhaps it could backtrack if it notices the accuracy of even the best guess drops below a certain threshold.


    It would definitely help if I could speed up the time for each individual test, but I think I'm pretty much at the mercy of Photoshop and my machine.


    I don't remember the specifics of hill climbing algorithms from my AI courses well enough to see how to apply it to this. Any ideas?

  • Unomi · 1 year ago
    I'm sorry, but I can't figure out how the JavaScript is executed. Do you tell PhotoShop to execute the script or is there an JavaScript environment that can load and execute the script?

    The video is way to quick to see what happens with the jsx file and it what kind of editor this is placed.

    Thanks.

    - Unomi -
  • tlrobinson · 1 year ago
    Oops. Forgot to mention that.

    Photoshop comes with an editor called "ExtendScript Toolkit 2", which is what I used. I believe you can also just open the script from the File -> Scripts menu.
  • Unomi · 1 year ago
    Thanks. And does that only work in Mac OS X or is this a default for PhotoShop CS3?

    On a side note, are there any JavaScript shell environments (like Bash, or the DOS batch commandprompt) you are aware of?

    - Unomi -
  • tlrobinson · 1 year ago
    I haven't tried on Windows, but I don't any reason it wouldn't work.

    I'm not aware of any JS *shells*, but there are lots of JavaScript engines that have command line interpreters, like Rhino, JavaScriptCore (WebKit's), SpiderMonkey, and V8.
  • erwinsusetya · 3 months ago
    yes, thks very much for the information,
  • Get Paid To Do Surveys · 3 days ago
    Hey I'v been reading your blog from quite some time now and I just wanted to say keep up the good work.
  • Gabulit · 1 year ago

    This method is useless if you don't know the precise algorithm used to blur the text. Since you are using the same filter to blur the text this is not recovering cencored text. This is more likely "Javascript to compare and rank based on similarity".