LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to embed information in a jpeg image

im trying to add text to an image without it displaying on the image. basically i need to know how to embed text in a jpeg. currently im trying to send information by adding data to the least significant bit but i am completely lost!

 

Trav

0 Kudos
Message 1 of 8
(6,095 Views)

Trav,

 

could you elaborate on your task? I am pretty sure that i don't understand what you are up to....

However, i assume that you are talking about adding a text overlay to an jpeg image without doing it manually. If my assumption is correct, you are looking for the "Draw Text at Point.vi" found in Programming >> Graphics&Sound >> Picture Functions.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 8
(6,051 Views)

@Norbert_B wrote:

Trav,

 

could you elaborate on your task? I am pretty sure that i don't understand what you are up to....

However, i assume that you are talking about adding a text overlay to an jpeg image without doing it manually. If my assumption is correct, you are looking for the "Draw Text at Point.vi" found in Programming >> Graphics&Sound >> Picture Functions.

 

Norbert


 

I suppose @travstrachan is talking about Steganography : "Steganography is the practice of concealing a file, message, image, or video within another file, message, image, or video."

 

0 Kudos
Message 3 of 8
(6,039 Views)

How far have you got? Have you got some code to show us?

 

It's relatively straightforward to read in an image file using the IMAQ VIs and convert it into a 2D array of 'pixels'. You could also manipulate the file directly using the file I/O palette - but this would require knowledge of the image file format that you're using.

 

Importantly, when you save the file, you need to make sure it doesn't get compressed and you lose the changes you've made!

 

(As a point of interest, creating a VI Snippet actually embeds LabVIEW code into a PNG image which you can then drag into LabVIEW)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 8
(6,032 Views)

Hi travstrachan,

 

when you want to "embed text in a JPEG" you should look how any cheap digital consumer camera does this type of operation: they use EXIF tags to embed additional information to JPEGs!

 

There are a lot of (free) command line tools to read/change/add EXIF tags from/to JPEG files. Use any that fits your needs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(6,027 Views)

@Sam_Sharp wrote:
 

(As a point of interest, creating a VI Snippet actually embeds LabVIEW code into a PNG image which you can then drag into LabVIEW)


But that is different to staganography. PNG is a tag oriented file format similar to TIFF in a way. Besides the well defined tags, everyone is allowed to add his or her own tags into the file container. NI did that by defining a VI Code tag which stores the binary code structure of the diagram in question as it would be saved inside a VI too.

 

If it is about adding simple text comments to the file itself there is very little possibility for that in the JPEG standard unlike TIFF or PNG It only knows a COMment marker that allows to add some text of up to 2^16 - 3 bytes. Anything else would require custom markers that have a potential to conflict with existing custom formats and or future developments. Using EXIF has its own kind of trouble depending on where the file comes from, as strictly speaking EXIF and JFIF are excluding each other.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 8
(6,022 Views)

there was a piece of program which I used many years ago, it was something similar to this: http://camouflage.unfiction.com/ or this http://dottech.org/138539/windows-review-file-camouflage-program/

It is called Camouflage and it does encrypt any files into jpeg images with a password. The image can be treated like a normal image, and image vewers won't tell it's a special image, only that it is larger that it should be.

It is said somewhere that it uses AES, so you can do some experiments with it, by encrpting something known (like a txt file) into a jpeg file with a password and using AES vi's and the original jpeg you try to decrypt it

__________________
Engage! using LV2015
0 Kudos
Message 7 of 8
(6,006 Views)

@rolfk wrote:

@Sam_Sharp wrote:
 

(As a point of interest, creating a VI Snippet actually embeds LabVIEW code into a PNG image which you can then drag into LabVIEW)


But that is different to staganography.


Yes, but it is a way of embedding information in an image file without changing the appearance of the image, which achieves the same purpose. The difference between that and steganography is that the fact that it's possible to see the information is there (i.e. the presense of the information isn't concealed, but the information is). To anyone that doesn't understand that it's a VI snippet, it's just a regular PNG image so the VI code is 'concealed'.

 

The OP didn't actually say that the presence of the information had to be concealed, only that he wanted to embed some information in an image file. That's the same as a VI snippet. I figured it was a point of interest that the tool the OP is using actually using (LabVIEW) does that and it's a way of sharing code! 🙂


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 8
(5,997 Views)