Slashdot Mirror


Recovering Blurred Text Using Photoshop and JavaScript

An anonymous reader writes "There's been a lot of talk about recovering blurred or pixelated text, but here's an actual implementation using nothing but Photoshop and a little JavaScript. Includes a Hollywood-esque video showing the uncovered letters slowly appearing."

47 of 157 comments (clear)

  1. Interesting by Captain+Splendid · · Score: 4, Funny

    From TFA:

    The most important feature is the JavaScript scripting environment built into Photoshop, which is far more powerful than the AppleScript environment (and a much nicer language, in my opinion).

    Hey Timothy, are you trying to get the mac fans riled up?

    I'd try this myself, but I stopped pirating PS at version 6. Be interesting to see what other Slashdotters make of this.

    --
    Linux, you magnificent bastard, I read the fucking manual!
    1. Re:Interesting by gardyloo · · Score: 2, Informative

      Note that the study was done on a Mac, by a Mac-user, so your point is partially moot.

    2. Re:Interesting by caffeinemessiah · · Score: 5, Funny

      There's another easy way to recover blurred text in Photoshop: Ctrl+Z.

      --
      An old-timer with old-timey ideas.
    3. Re:Interesting by DreadPiratePizz · · Score: 4, Funny

      I'm on a mac you insensitive clod! It's command-z for us!

    4. Re:Interesting by SanityInAnarchy · · Score: 2, Informative

      I don't think so:

      known as the open-Apple key (as well as just "Apple") in documentation prior to the Apple Macintosh family of computers

      However, you get pedantry points for trying.

      --
      Don't thank God, thank a doctor!
    5. Re:Interesting by commodoresloat · · Score: 2, Funny

      Is there any way to change that? I use a mac at school, but I'm not dropping $1000 on a laptop with 1 gig of ram.

      Nope there's no way to change it but you cheapskates can just use Ctrl-Z instead.

  2. Oblig by Anonymous Coward · · Score: 5, Funny

    Now for all of the other pixellated stuff...

    Bwahahahaha.

    1. Re:Oblig by Anonymous Coward · · Score: 5, Funny

      I'm off to ebay to try it on all those XP serial numbers.

  3. Computer... magnify and enhace by Anonymous Coward · · Score: 2, Funny

    20x zoom. Mr. Data, what does that look like to you?

    1. Re:Computer... magnify and enhace by gardyloo · · Score: 5, Funny

      BIG squares.

  4. Just ovveride? by Dreen · · Score: 5, Insightful

    I never understood why people use pixel mis-mashing when they want to obfuscate something in an image.

    drawing a big black rectangle is 10x faster and there is no way you can de-obfuscate that

    1. Re:Just ovveride? by fbjon · · Score: 4, Interesting

      It may stand out too much in the layout. What would be interesting (maybe even useful) is developing a formula that determines the minimum mosaic size for a given font style/complexity and size that makes reversing it produce ambiguous results, one extreme being a black rectangle, the other no mosaic at all.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    2. Re:Just ovveride? by Zadaz · · Score: 4, Interesting

      Why not make a "secure" mosaic filter that does one or more of the following:

      - Randomizes the pixel data before applying the mosaic (Keeping the original colors so the mosaic looks natural.)

      - Applies noise to the area before applying the mosaic (Could use intensity noise rather than hue to retain the color scheme that is being obfuscated.)

      - Requires the user to drag the smudge tool across the area by a pre-determined amount to randomize the data before the mosaic.

      - Apply noise to the mosaic pixels, (1:1 with the mosaic size) after it has been applied.

      These would all retain the look of the mosaic but would defeat the reverse engineering tactics displayed here.

      Heck, forget the plugin, these would be pretty simple to automate these within Photoshop.

    3. Re:Just ovveride? by Jabbrwokk · · Score: 4, Insightful

      Absolutely agree.

      Plus TFA says the original image was blurred using the Photoshop "mosaic" filter. So this approach, while interesting for text blurred using that exact filter, is probably useless in most real-world approaches, such as trying to recover text obliterated with the rubber-stamp tool, or like you suggest, a black box.

    4. Re:Just ovveride? by Tumbleweed · · Score: 4, Informative

      drawing a big black rectangle is 10x faster and there is no way you can de-obfuscate that

      Just make sure you're not saving in a file format that has a preview, where the preview doesn't have the obfuscation updated. :)

    5. Re:Just ovveride? by larry+bagina · · Score: 5, Funny

      Heck, forget the plugin, these would be pretty simple to automate these within Photoshop.

      This is gimp country. On a quiet night, you can hear adobe squeal like a pig.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    6. Re:Just ovveride? by More_Cowbell · · Score: 4, Insightful

      Not quite sure if that is funny or disturbing... :)

      --
      Experience teaches only the teachable. -AH
    7. Re:Just ovveride? by lostmongoose · · Score: 5, Funny

      I'm gonna go with 'funsturbing'

    8. Re:Just ovveride? by mrdarreng · · Score: 2, Informative

      I think you have confused squealing with laughing.

    9. Re:Just ovveride? by thepotoo · · Score: 2, Funny

      Yeah, I'm really crying over not having to track down a keygen every time I reinstall my photo editor.

      --
      Obligatory Soundbite Catchphrase
  5. General case != this by Empiric · · Score: 4, Insightful

    Is it not the case that the reason this works is because you're running the -same blur algorithm- with the -same input- (the unblurred letters/pixels) and simply iterating through the letters and looking for equivalent output?

    Presumably, the blur algorithm output could resolve such that multiple unblurred letters resolve to the same blurred pixels, but even if it is not this trivial to map the input state to output state, it still wouldn't seem to me to approach solving the general case of letters "blurred" by any arbitrary means, which is the real-world capability implied by the article.

    What am I missing here?

    --
    ~ Whence do you come, slayer of men, or where are you going, conqueror of space?
    1. Re:General case != this by sexconker · · Score: 4, Informative

      You're not missing anything.
      This guy tried to read some blurred text on his friend's site, so he decided to mess around in photoshop.

      He got over zealous and did some javascript stuff in photoshop, based on blurring known text and attempting to reblur and match that text 1 letter at a time.

      He was then disappointed that he couldn't use the thing to unblur assumed text of unknown font, font settings, color, language, character set, and blurring algorithm after unknown layers of image alteration after the text was rendered, and after unknown compression.

    2. Re:General case != this by MadKeithV · · Score: 2, Funny
      The ????? is finally revealed!
      1. - Get frustrated at blurred text
      2. - Fail to write unblur filter
      3. - Post to slashdot
      4. - PROFIT!!!!
  6. Ideal conditions by Itninja · · Score: 5, Interesting

    The article mentions the authors 'cheating a little' by de-blurring the image under 'ideal conditions'. From what I can gather, he is using a source Photoshop file (PSD) as the sample. If he already had access to the source PSD file, wouldn't it be easier to just click undo a few dozen times? Can this be reproduced to a raster image at all?

    --
    I judt got a nre Kinesis keybiartf so please excusr ant egregiou typos.
    1. Re:Ideal conditions by X0563511 · · Score: 2, Insightful

      I imagine the "cheating" aspect of using a PSD file is that you are working with a lossless image. There's no JPEG/MPEG compression going on etc. Working with another lossless format like BMP, or PNG, would probably work just as well.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
    2. Re:Ideal conditions by nobodymk2 · · Score: 2, Informative

      Once I hit "save" in photoshop and exit I can't undo. Although in a layered image the rasterized text (must be rasterized before we can liquify/blur it) would probably be on a separate layer, but it's generally much more incriminating to replace text and not unblur text and it's probably not layered like that.

    3. Re:Ideal conditions by petermgreen · · Score: 2, Interesting

      What is more significant is knowing exactly which font and which blur filter was used. Also having the filter applied evenly is going to make things far easier than if someone grabs the blur tool and scribbles over the area with it.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  7. OR Japanese pr0n? by DrPeper · · Score: 2, Funny

    Wouldn't it be cool if you could use this technique to clear up the fuzzies on censored Japanese pr0n?!

    1. Re:OR Japanese pr0n? by moderatorrater · · Score: 4, Funny

      You're on the wrong forum for that line of reasoning. You'll want to find a site that's either anti-censorship or pro-porn. Good luck finding something like that on the internet.

  8. Re:OSX-style dock on website. by sexconker · · Score: 3, Interesting

    Neat.
    *takes picture*

    I hate the dock, and I hate transparency.
    I think it's even worse on a website.
    But I'm half-tempted to look at the code.

  9. Old tech by Glith · · Score: 5, Funny

    Jeez. Hasn't anyone seen CSI?

    1. Re:Old tech by mpaulsen · · Score: 5, Funny

      I was going to watch it online, but they created a GUI interface in Visual Basic to track my IP. http://www.youtube.com/watch?v=Ni_rAamVP2s

    2. Re:Old tech by cheesy9999 · · Score: 2, Funny

      If you want to learn how to be leet like that CSI chick, just head on over to StackOverflow: http://stackoverflow.com/questions/177541/how-do-i-create-a-gui-interface-using-visual-basic-i-need-to-track-an-ip-addres

      --
      -tom
    3. Re:Old tech by guyminuslife · · Score: 4, Funny

      Writer: Hey, how would you find someone over the Internet?
      IT Guy: You mean, like, track their IP address?
      Writer: IP address. That sounds good. Okay, how would you do it?
      IT Guy: Well, working here, my dumbass manager would insist that I write a stupid GUI interface in Visual Basic, but---
      Writer: Awesome! We'll put that down. *click*

      --
      I don't believe in time. It's a grand conspiracy designed to sell watches.
  10. Failure by sexconker · · Score: 5, Insightful

    "While my original goal of recovering the censored text on my friendâ(TM)s page was never achieved, the project was a success."

    I wouldn't call that a success...

    Good execution of a basic concept, but the fact remains that this shit is infeasible in practice. You have all the font issues (the typeface, the spacing, the color, the size, etc.), and you've got all the source issues - Are you sure that's text? Is it English? Was it obfuscated in other ways? Has the image been altered after the text was rendered? How has compression affected it?

    The biggest fucking issue, of course, is that you're assuming the text was obfuscated using photoshop, or at least very similar blurring/pixelating algorithms.

    It's a great project in terms of using javascript and photoshop to do something neat but basic in concept (essentially brute forcing, as the author says).

    But unless you have inside info about how the text was rendered and obfuscated, you're better off taking a step back and squinting.

    I think I see a duck.

    1. Re:Failure by finiteSet · · Score: 3, Funny

      But unless you have inside info about how the text was rendered and obfuscated, you're better off taking a step back and squinting.

      Little Girl: "Wow! It's a schooner!"
      Willam: "You dumb bastard! That's not a schooner, it's a sailboat!"
      Little Boy: "A schooner is a sailboat, stupidhead!"
      Willam: "Well you know what? THERE IS NO EASTER BUNNY! OVER THERE, THAT'S JUST A GUY IN A SUIT!!"

      --
      If we start buying CDs then the terrorists have already won.
  11. Coral Link by mrbene · · Score: 3, Informative

    I'm getting a 500 status connecting to the original, but it seems that Coral CDN has a decent cache.

  12. Re:OSX-style dock on website. by pushing-robot · · Score: 2, Informative

    Here's the source. Interestingly enough, it was referred to earlier today.

    --
    How can I believe you when you tell me what I don't want to hear?
  13. Short version by rabtech · · Score: 4, Interesting

    If you know the blur algorithm, you can run each character through it to produce the blurred output, then compare that result to the image you are trying to unscramble and pick the closest match.

    This assumes the blurring doesn't cause pixels to overlap their neighbors too much, that the algorithm produces deterministic output (isn't random), and that there are few possible inputs resulting in the same blurred output.

    If the letters overlap because the blur blends with its neighbors then it just becomes a computational complexity problem where you have to try words instead of letters. A lot harder, but not totally impossible.

    A blurring algorithm that used some large mosaic effect prior to bluring or used randomized input would produce a similar looking blur effect, but without disclosing much about the input.

    Personally, I'd prefer examining the blur area for the predominant background color and create a gradient/mosaic around that color to fill the area. Then there is absolutely no chance of recovering information, but the effect on video wouldn't be too horribly jarring (as a black box might be).

    --
    Natural != (nontoxic || beneficial)
  14. Re:So... by sexconker · · Score: 2, Funny

    You can do the exact same thing in GIMP rather easily.

    Get some image with blurred text.
    Try blurring some letters to match up with the blurred text.
    Fail.

    See? You've already done what this guy did with javascript, photoshop, and who know how much wasted time.

  15. Re:slashdotted after 9 posts by Spy+der+Mann · · Score: 2, Funny

    He's ****, Jim

    There. Fixed that for you.

  16. Re:OSX-style dock on website. by cheesy9999 · · Score: 4, Interesting

    Actually the one on my site was written myself, and is located at http://tlrobinson.net/projects/js/jsdock.php It was written back in my early days of JavaScript, so it's probably not the prettiest code...

    --
    -tom
  17. Yes, you can de-obfuscate black rectangles. by IdahoEv · · Score: 5, Interesting

    drawing a big black rectangle is 10x faster and there is no way you can de-obfuscate that

    That's not entirely true. There was an article a couple years back about a technique for recovering redacted text with pretty high reliability.

    It used the fact that most standard fonts have variable spacing, and that once you've determined the font you can model that only certain combinations of letters will actually fit in the space of the redacted word or words. Combined with a dictionary and bayesian matching based on nearby words, you can often figure out what words would have fit into a redacted rectangle. Or at least limit it to a fairly small pool of possibilities.

    They demonstrated it on a redacted government document, and pulled out some places where the redacted words had to be "Iran" and "Ahmedinejad" etc., because nothing else both fit and made sense. If it's a monospaced font, you know the exact number of letters of the redacted text.

    I can't find the original link, but here's a paper that describes some of the techniques available for "cracking" blackout redaction. (some apply only to magic-marker-type redaction, but others apply even to electronic black-rectangle redaction).

    --
    I stole this sig from someone cleverer than me.
    1. Re:Yes, you can de-obfuscate black rectangles. by Dreen · · Score: 2, Interesting

      Thats pretty interesting. The document lists some good countermeasures but still, the more you obfuscate, the harder it becomes to "brute-force" it back. For whole long-ish sentences it would probably be impossible.

      Plus, if you are obfuscating an important, scanned document, and its cruicial you hide stuff in it, the best option is to OCR it, and simply delete the snippets you dont want.

  18. What about nipples? by vodevil · · Score: 5, Insightful

    I think people would be more interested if this removed the blur from nipples.

  19. randomize after by pikine · · Score: 2, Insightful

    If you randomize pixel in any way before applying mosaic, adding noise or just randomly permute the pixels around, then what you get in the mosaic is going to be the same colored blocks that look like a solid colored strip. That's because mosaic computes the average of the pixel values that fall under the block, which would be the same for all blocks if randomness is evenly distributed. However, if you apply mosaic first and then randomize the blocks after, then the result looks much more like mosaic and yet is irreversible.

    --
    I once had a signature.
  20. javascript dock? by Eil · · Score: 2, Interesting

    Holy cow, I thought I had seen all possible ways to crapify a web page via Javascript, but today I have learned of another: Adding a partially transparent Mac OS dock to it. So that when you scroll down (as you normally do with web pages), the thing jumps around like a monkey on amphetamines. And you presume that it doesn't get any worse than that, wouldn't you? You would, but then you'd be wrong because it also does the magnification thing and it does it about as well as you'd expect Javascript to do it.

    Now if you'll excuse me, I'm heading out to abuse my 2nd Amendment rights.