Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Size of Image Changes after loading into C# and then saving it

Options
  • 13-01-2005 7:28pm
    #1
    Closed Accounts Posts: 11


    I have created a steganography program where i have opened up a bitmap file of say a size of 568kb and then inputeded a bit of writing into it saying H and then it jumps to the size of 4.8MB. Can anyone help with this problem. Am i reading the picture in wrong or is visual studios adding extra bits to the bitmap


Comments

  • Registered Users Posts: 7,276 ✭✭✭kenmc


    i know nothing of c#. that said, is it possible that you're writing back out longs or doubles instead of bytes?? (is this even possible in c#?? as I said I dunno the lang - but thats my first guess...)


  • Registered Users Posts: 6,762 ✭✭✭WizZard


    StonesBG wrote:
    I have created a steganography program where i have opened up a bitmap file of say a size of 568kb and then inputeded a bit of writing into it saying H and then it jumps to the size of 4.8MB. Can anyone help with this problem. Am i reading the picture in wrong or is visual studios adding extra bits to the bitmap
    Depends on
    1. your algorithm
    2. how you are writing data to the bitmap
    Any chance of more info?


  • Closed Accounts Posts: 11 StonesBG


    The way that my project works is that i am changing the least significant bit in the red, green, and blue of the pixel. But i even tried just puting in just one character and it still came back with over 2MB of a picture.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Can you post your code? We can't really help you unless you do.


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    At a quick guess I'd say that if you're using an inbuilt api or 3rd party component to handle the image file I'd say that the colour depth is being changed automatically somewhere along the line from 4 bit to 32 bit or something like that.


  • Advertisement
  • Closed Accounts Posts: 11 StonesBG


    I have been able to cut the file size down from 4.5 MB to 1.57MB this was because i left out the format i wanted to save bitmap. Don't know why this is but was just messin with the code to see if could figure something out. If anyone want to see if the can help any further just give me your email address and i will email the code to you.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Can you send it my pm?


Advertisement