Results 1 to 2 of 2
  1. #1
    stegano is offline Member
    Join Date
    Feb 2011
    Rep Power

    Default hiding bits in image

    XML Code:
    I hv an array of boolean and i want to store it in some position of an image.
    Anybody can help me???
    Any code example????

  2. #2
    Skiller is offline Member
    Join Date
    Jan 2011
    Rep Power


    There are many ways to do it but almost all are highly dependent on the image format.

    The easiest and most compatible way is to store the data in the last bit of each value of each color channel as well as an integer specifying how much data there is. All this needs is a lossless image format like BMP or PNG.

    Some file formats will allow you to just stuff whatever data you want at the end of the file, though it works best with lossy image formats as the difference in file size is less noticeable. However you can't always guarantee that programs reading the image as an image will ignore the additional data safely.

    A few file formats actually support custom data chunks where you can store whatever you want if you follow a sort of template for storing your data (usually some identifier and the size of the data followed by the actual data).

    It's all pretty basic stuff but you really need to research the image format to find out what will work with what and how.

    Edit: Be aware that some of these methods have been used to hide viruses and virus scanners could detect the data as being a potential virus even if it isn't.
    Last edited by Skiller; 04-07-2011 at 03:51 PM.
    Currently developing Cave Dwellers, a Dwarf Fortress/Minecraft style game for Android.

Similar Threads

  1. Bitshifting doesn't shift bits?
    By Skiller in forum New To Java
    Replies: 19
    Last Post: 03-02-2011, 10:30 AM
  2. Help with random bits array
    By AnimeKitty in forum New To Java
    Replies: 11
    Last Post: 07-30-2010, 04:37 AM
  3. 48 bits JPEG 2000
    By user_java in forum Java 2D
    Replies: 0
    Last Post: 03-02-2010, 06:19 AM
  4. Image to Binary bits
    By Deva in forum New To Java
    Replies: 4
    Last Post: 12-24-2009, 05:49 PM
  5. extracting bits from big numbers
    By ankitmcgill in forum New To Java
    Replies: 6
    Last Post: 05-05-2009, 04:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts