how to find the hidden text in an image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
msenger
Posts: 3
Joined: 2012-05-09T07:03:42-07:00
Authentication code: 13

how to find the hidden text in an image

Post by msenger »

Unfortunately, I am very new to any graphics - therefore, my question may be either too trivial or I may not have enough information to formulate the question properly. Sorry for that, I will try and you will judge: I have a picture (http://www.archaebacteria.net/geocaching/sifrovaci4.png) and I know that it has a hidden text (showing some geographical coordinates). The text I am looking for is written in white color (and is also a bit distorted to make its reading less straightforward but it should still be recognizable). Is it possible to use ImageMagic (preferably its command-line interface) to create a new image with the hidden text readable?

Many thanks, indeed.
Martin
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how to find the hidden text in an image

Post by fmw42 »

You would have to know the "key" to extract such information. There are many ways to hide the text. What is the reason you want to do this? We certainly don't want to help someone break into some other system or use some unlicensed data.

IM has one function for doing the hiding in any image? I cannot recall the function and the options page is currently down for me to look to find its name.

This image is a random noise image and you would probably need at least the seed value if not more to be able to create the same noise pattern and diff it.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: how to find the hidden text in an image

Post by Bonzo »

-encipher and -decipher
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how to find the hidden text in an image

Post by fmw42 »

Thanks bonzo. That was it. I could not remember and options page was down at the time.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: how to find the hidden text in an image

Post by glennrp »

It depends how it's encoded. In this case, only displaying the pure white
pixels yields the message.

There are various ways to do that. I used
convert sifrovaci4.png -colorspace gray -negate -threshold 0 gnt0.png
Last edited by glennrp on 2012-05-09T15:18:11-07:00, edited 1 time in total.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: how to find the hidden text in an image

Post by glennrp »

Now I wonder what's at those coordinates besides trees. A geocache perhaps?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how to find the hidden text in an image

Post by fmw42 »

good thinking glenn!
(Occam's razor: It is a principle urging one to select among competing hypotheses that which makes the fewest assumptions and thereby offers the simplest explanation of the effect.)
This works also and shows white on black

convert sifrovaci4.png -fill black +opaque white sifrovaci4_proc.png

and dilating may make it easier to read

convert sifrovaci4.png -fill black +opaque white -morphology dilate disk:5 sifrovaci4_proc2.png
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to find the hidden text in an image

Post by anthony »

glennrp wrote:It depends how it's encoded. In this case, only displaying the pure white
pixels yields the message.

There are various ways to do that. I used
convert sifrovaci4.png -colorspace gray -negate -threshold 0 gnt0.png
To make it easier to read add -morphology Erode Disk after the threshold, before the implicit write filename.


Opps. Looks like Fred beat me to it ;-)

Though adding a .3 to the radius improves the 'disk' shape. EG: use Disk:5.3
Octagons are good for integer radii EG: Octagon:7

So where is this location? Google Maps is not much good with GPS locations any more. Used to be fantastic!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
msenger
Posts: 3
Joined: 2012-05-09T07:03:42-07:00
Authentication code: 13

Re: how to find the hidden text in an image

Post by msenger »

fmw42 wrote:You would have to know the "key" to extract such information. There are many ways to hide the text. What is the reason you want to do this? We certainly don't want to help someone break into some other system or use some unlicensed data.
Thanks for your answer. The reason is not anything evil. It is a puzzle from the geocaching game, precisely this one: http://www.geocaching.com/seek/cache_de ... wp=GC3CYNW. The puzzle description is only in Czech; translated it says: "Inside this picture, there are coordinates written using the white color. I left there only roughly 1.5% of points but the coordinates should still be readable." So, it seems that I do not have any additional key; I do not think that it is encrypted. I just thought that if I change all pixels written in anything else than white color to a single color (e.g. black) I will see what remain and that will be the hidden text. But I am not sure how to do it, being really a dummy in the graphics world.

Martin
msenger
Posts: 3
Joined: 2012-05-09T07:03:42-07:00
Authentication code: 13

Re: how to find the hidden text in an image

Post by msenger »

Many thanks to all of you. The result is, indeed, a place where a geocache (a hidden "treasure") is hidden - and I am going to try to "bag" it next time I will be in Prague (hopefully the next week). ImageMagic (and its community!) is wonderful.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to find the hidden text in an image

Post by anthony »

Well as it was published, better make it quick!

Location is indeed in the northern suburbs of Prague.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
lion369
Posts: 8
Joined: 2014-04-07T09:08:15-07:00
Authentication code: 6789

Re: how to find the hidden text in an image

Post by lion369 »

msenger wrote:Many thanks to all of you. The result is, indeed, a place where a geocache (a hidden "treasure") is hidden - and I am going to try to "bag" it next time I will be in Prague (hopefully the next week). ImageMagic (and its community!) is wonderful.
Hi.
How did u solve the problem? I had almost the same problem, but I can't figure out the hidden message... Can you share the solution with me?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to find the hidden text in an image

Post by anthony »

First all the answers are in the thread already. And yes it still works, I just tested.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply