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 ResourceFunction["PhotoHiddenMessage"], one can hide short messages in a photo (automatically or by choosing) among the three main possible channels of the image. Also with ResourceFunction["PhotoHiddenMessage"], 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 via the arguments {text}, {text1,text2} or {text1,text2,text3}, with automatic choice of image channel made by ResourceFunction["PhotoHiddenMessage"]. 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.
You can choose the positions (desired channels) where the messages will be hidden, the arguments are e.g. {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.
ResourceFunction["PhotoHiddenMessage"] can also be used to reveal the secret messages of a photo that has hidden messages using the target image as the only argument for the function, generating images of the three main channels when evaluate.

Examples

Basic Examples (3) 

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/8409bdcd-7d46-496b-8ab6-b9b35776d019"]
Out[1]=

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

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

Hide two messages on different channels of the photo:

In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/5f19730f-4e3a-4fdb-a547-a6d00707099a"]

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/58532bb3-8fc7-4f10-8646-76fb3e317e34"]

Now show them:

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

Scope (2) 

You 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/e069670f-98a0-4aa8-b24d-bf54fe206db0"]
Out[7]=
In[8]:=
ResourceFunction["PhotoHiddenMessage"][cesium]
Out[8]=

You 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/42c780ee-84b9-45d5-bc0a-1ff46566ea28"]
In[10]:=
ResourceFunction["PhotoHiddenMessage"][fifthstreet]
Out[10]=

Options (4) 

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/3325ed96-27cb-401a-8455-6838a3944fe1"]
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/ef62d782-4361-4437-a6ad-dec7297c95bf"]
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/f035fd4d-d3ee-492a-8a45-c84ab5cbea7c"]
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/b39c0910-408c-499e-b79b-2982c8a40f92"]
Out[17]=
In[18]:=
ResourceFunction["PhotoHiddenMessage"][licenses]
Out[18]=

Possible Issues (1) 

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/cd4c3daf-add2-4f74-9669-fae6612f986d"]
Out[19]=

Neat Examples (3) 

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/8cccc582-d4eb-4703-a080-67b29e4f04f8"]
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/4ae731fd-a399-4e0d-ab21-3ba41b8336dd"]
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/7d014636-1f20-4c99-93fc-a2fcb5344328"]
In[25]:=
ResourceFunction["PhotoHiddenMessage"][findmelater]
Out[25]=

Publisher

Claudio Lobo Chaib Filho

Version History

  • 2.0.0 – 11 October 2019
  • 1.0.0 – 02 October 2019

Related Resources

License Information