Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: How to view and edit the bits of a jpg image file?

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to view and edit the bits of a jpg image file?

    I want to edit jpg image file in binary form, so that I can can modify the LSB to make least difference with the original image.
    Stenography stuffs...
    Please help


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: How to view and edit the bits of a jpg image file?

    I'm not sure how you can read and modify the contents of a jpeg file. I think the image has to be read into an Image object which allows access to the bytes defining the pixels.
    Also I'm not sure if writing an image to a jpeg file will preserve the pixels. Some writing algorithms compress/change pixels when a jpeg file is written. You'd need to do some research or testing to see if that is the case.

    Is this the same topic: http://www.javaprogrammingforums.com...tml#post103369
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Mar 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to view and edit the bits of a jpg image file?

    access to the bytes defining the pixels.
    Yes how can I do that?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: How to view and edit the bits of a jpg image file?

    Look at the BufferedImage class. It has methods for getting and setting pixels.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Mar 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to view and edit the bits of a jpg image file?

    Alright I succeeded in viewing/printing the jpg file in hex form(actually I converted hex from binary form)
    Anyways now I am looking for a way to retrieve the jpg image file back from hex values....
    Any idea?

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: How to view and edit the bits of a jpg image file?

    I don't know the internal format of a jpeg file and have no idea how the contents of a jpeg file can be changed without passing the file through special code that does know how to read and write the bytes of jpeg files.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 3
    Last Post: March 21st, 2013, 10:12 AM
  2. HOW TO EDIT THE LIBRARY .CLASS FILE IN THE JAVA
    By kranthi24 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 21st, 2013, 06:46 AM
  3. get gray scale value from 16-bits image
    By div111 in forum Java Theory & Questions
    Replies: 1
    Last Post: January 16th, 2013, 08:52 AM
  4. How to View a .jsp file with an internet browser
    By jeanietres in forum Java Networking
    Replies: 1
    Last Post: June 13th, 2012, 11:07 PM
  5. Return the rgb values from a jpg image
    By newparticipant in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 25th, 2011, 03:47 PM