Wolfram Research

Function Repository Resource:

PhotoHiddenMessage

Source Notebook

Send short messages secretly through photos

Contributed by: Claudio Lobo Chaib Filho

ResourceFunction["PhotoHiddenMessage"][image,{text}]

send a message (text) hidden in an image on a single channel.

ResourceFunction["PhotoHiddenMessage"][image,{text1,text2}]

send two hidden messages (text1,text2) in an image through two channels.

ResourceFunction["PhotoHiddenMessage"][image,{text1,text2,text3}]

send three hidden messages (text1,text2,text3) in an image through three channels.

ResourceFunction["PhotoHiddenMessage"][image,{channel},{text}]

choose channel from the three channels (1, 2 or 3) in which the message text will be hidden.

ResourceFunction["PhotoHiddenMessage"][image,{channels},{texts}]

choose channels in which the texts will be hidden.

ResourceFunction["PhotoHiddenMessage"][image]

reveals a hidden message by exposing the three relevant channels.

Details and Options

With this function, one can hide short messages in a photo (automatically or by choosing) among the three main possible channels (most relevant by this function) of the image. Also with this same function, reveal the secret messages of a photo that hides the messages.
The function works great with the vast majority of image extensions: (*.bmp;*.dib;*.jpg;*.jpeg;*.jpe;*.jfif;*.gif;*.tif;*.tiff;*.png).
It is possible to hide from one to three small messages in a photo (the arguments: (text), (text1, text2) or (text1, text2, text3)), with automatic choice of image channel made by the function. The default for the function is: with only one message, the default channel is 3, with two messages, the default channels are 1 and 3 and with three messages the three channels are occupied (this order was chosen by channel performance for most images, best is 3, then 1, and finally 2, but may vary for each photo).
One can choose the positions (desired channels) where the messages will be hidden, the arguments are eg.: {1}, {2}, {2,3}, {1,3}… referring to channels 1, 2 and 3 of the image.
Optionally, you can change the default opacity with the “Opacity” argument for better function performance. The default opacity is 0.3.
Optionally, you can change the default text size with the “TextSize” argument to, for example, write more hidden secret messages in each photo. The default text size is 30.
Optionally, you can change the text font with the “TextFont” argument to handwritten or exotic fonts that best suit each purpose. The default font for messages is the “Courier” font.
Also use this function to reveal the secret messages of a photo that has hidden messages, just using the target image as the only argument for the function, generating images of the three main channels when evaluate.

Examples

Basic Examples

In this simplest example, a message is hidden in only one channel of the image:

In[1]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/d24337d4-569d-44bf-a040-19d83d68a4f6"]
Out[1]=

To reveal the hidden message through a photo containing a secret message, just use the function with the target image as an argument:

In[2]:=
ResourceFunction["PhotoHiddenMessage"][message1]
Out[2]=

Another simple example, hiding two messages on different channels of the photo:

In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/64f66fd9-3cad-4b49-8e95-0c3af95e619d"]

Reveal the messages:

In[4]:=
ResourceFunction["PhotoHiddenMessage"][message2]
Out[4]=

Hide three secret messages added to the photo on the three possible channels:

In[5]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/219bd10d-f5c8-409b-901e-ea9f2fe2599e"]

Now show them:

In[6]:=
ResourceFunction["PhotoHiddenMessage"][message3]
Out[6]=

Scope

One can choose in which image channel the simple message will be hidden:

In[7]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/b321fe0f-714a-4a9d-a1d9-dc83776f2f8e"]
Out[7]=
In[8]:=
ResourceFunction["PhotoHiddenMessage"][cesium]
Out[8]=

One can choose the two channels from the three image channels in which two messages will be hidden:

In[9]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/b00b1722-09b2-4f18-904e-629342e54e02"]
In[10]:=
ResourceFunction["PhotoHiddenMessage"][fifthstreet]
Out[10]=

Options

The options "Opacity", "TextSize" and "TextFont" can improve how well a message is hidden, or make it easier to read the revealed message.

The reduced text size in this example favors a longer message and helps it hide better in the photo:

In[11]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/e4c152c7-f00c-47dd-a957-73efa49ea71d"]
Out[11]=
In[12]:=
ResourceFunction["PhotoHiddenMessage"][treasuremap]
Out[12]=

Hide a message in an image with high opacity:

In[13]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/8b421186-4a9c-4118-9d75-25a43ad10daf"]
Out[13]=
In[14]:=
ResourceFunction["PhotoHiddenMessage"][ididit]
Out[14]=

Some fonts make it difficult to recover the secret message:

In[15]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/ed3f9c1b-94ed-4c7a-8242-d2fa8fb3a85c"]
In[16]:=
ResourceFunction["PhotoHiddenMessage"][felix]
Out[16]=

Low opacity in all channels can be useful on relatively dark images:

In[17]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/7922e158-bcf5-4400-9a92-18fd222432c9"]
Out[17]=
In[18]:=
ResourceFunction["PhotoHiddenMessage"][licenses]
Out[18]=

Possible Issues

PhotoHiddenMessage with one argument will remain unevaluated if a photo does not have a hidden secret message:

In[19]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/f8d648ef-f45a-4b8b-84b0-e3227ccbb610"]
Out[19]=

Neat Examples

Use a font adapted to the texture in the less bright channels:

In[20]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/ac72778e-1509-4fdb-9093-43271955bff2"]
Out[20]=
In[21]:=
ResourceFunction["PhotoHiddenMessage"][message17]
Out[21]=

Use large letters with more striking fonts:

In[22]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/a8c0b4e1-3c63-4bed-9778-43b2812fcc30"]
In[23]:=
ResourceFunction["PhotoHiddenMessage"][brazil]
Out[23]=

Use a small text size and handmade font :

In[24]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/31cc3178-dda6-447f-b417-9f0fa5d9ff99"]
In[25]:=
ResourceFunction["PhotoHiddenMessage"][findmelater]
Out[25]=

Resource History

Related Resources

License Information