LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to embed information in an 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 to no avail.
any help will be much appreciated. thanks.
0 Kudos
Message 1 of 8
(5,514 Views)
Hello dedbeat,
      I recommend that you do a search for "encrypt text into .jpeg" in google and see what free software is available.  There also might be some academic research done on this topic.

Cheers,

NathanT
0 Kudos
Message 2 of 8
(5,488 Views)
Are you talking about embedding text into the LSB's of the actual image pixels?  Or does the .jpg format allow for some type of header or meta-data?
 
If you're manipulating pixel LSB's, then the choice of .jpg itself is probably the problem.  JPG is a lossy compression scheme which won't reliably preserve the LSB's that you worked so hard to manipulate.  I'd think you need to work with a lossless format that will preserve the LSB's of every image pixel.
 
For those interested in such things, search the web for the term steganography.
 
-Kevin P.

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 3 of 8
(5,482 Views)
Hi,

If you have IMAQ functions then you do have the possibility to add text or drawings to an image as an overlay and then merge the image with the overlay.
Also, if you want to code informations in the last line of the image, there is an IMAQ function to "set pix value".

I assume it's also possible without IMAQ functions but it might be much more tricky... Smiley Surprised



We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 8
(5,481 Views)
thanks for your responses guys...its actually not that bad. i converted from string to byte array, decimated the rgb channel and replaced a bit in one of the color channel by replace array subset. interleaved to multiplex back to an RGB channel then extracted using reverse process and and index array. if you replace values at index 0 the multiplexed color image doesnt show any discoloration whatsoever!
0 Kudos
Message 5 of 8
(5,468 Views)

Really?  You've got me curious now.  Maybe I'm assuming something wrong -- here's the procedure I thought you were aiming for:

1. Load a jpg-format image file into LabVIEW somehow.  Now you've got an image or a 2D array of pixel values or something.

2. Manipulate some LSB's of some of the pixels to embed text information in a way that isn't visually obvious in the image itself when viewed as an image.

3. Save the manipulated image to a jpg-format file.

4. Someone else opens that new manipulated image file.

5. They go through the reverse manipulations and recover the text you embedded.

My understanding was that the lossy nature of jpg encoding in step #3 above would prevent the scheme from working because the bits you had in step #2 won't be the same as the bits someone gets in step #4.  What did I figure wrong here?

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 8
(5,457 Views)

heres how it went kevin

i loaded an image. the image data is a cluster. by using unbundle by name i can separate it to components. the rgb info on the data is located in "image" in the unbundle. send this to a decimate...extracting 3 values. these three values are the rg and b components of the image. the rest is as i mentioned above. take either r,g or b value (doesnt matter which color you encode the data to) do a string to byte array. send through an empty for loop with the string length wired to the count...making the loop run as many times as the number of characters ur embedding. the result is sent to replace array subset (with index 0) and then interleaved with the remaining 2 channels to form back the composite rgb...send back to a bundle by name with the characteristics coming from the original image data. draw flattened pixmap and output (this displayed pic with encoded data...no difference!!). extraction is a reverse process but inside the forloop place index array with index zero. loop count once again wired to original string length. output from the for loop goes to a byte to string and string indicator! let me know if it works for you

dee.

0 Kudos
Message 7 of 8
(5,445 Views)

ahh i see what ur sayin. i misread ur question. this all happens inside 1 vi. so im not really writing the encoded image to a jpeg file and sending it and letting it extracted on another machine...this is all inside 1 vi. so what you say might hold. interesting. i never thought about that before.

dee.

0 Kudos
Message 8 of 8
(5,443 Views)