Results 1 to 4 of 4
  1. #1
    alucardris is offline Member
    Join Date
    Nov 2013
    Posts
    2
    Rep Power
    0

    Default Converting JPEG to binary (1 and 0) format

    Hi,

    I want to convert a JPEG file into its binary equivalent and then convert it back to its JPEG form. i.e Convert a JPEG file into 1's and 0's and output this into a text file and then take this text file and convert it back to the original image (Just to check if there are no errors in conversion)

    I have tried doing this with binascii module in python, but there seems to be a problem of encoding that i cannot comprehend.

    It would be really great if someone could help me out with this!

    P.S: A solution in Java would be appreciated

  2. #2
    alucardris is offline Member
    Join Date
    Nov 2013
    Posts
    2
    Rep Power
    0

    Default Converting JPEG to binary (1 and 0) format

    Hi,

    I want to convert a JPEG file into its binary equivalent and then convert it back to its JPEG form. i.e Convert a JPEG file into 1's and 0's and output this into a text file and then take this text file and convert it back to the original image (Just to check if there are no errors in conversion)

    I have tried doing this with binascii module in python, but there seems to be a problem of encoding that i cannot comprehend.

    It would be really great if someone could help me out with this!

    P.S: A solution in Java would be appreciated

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,422
    Rep Power
    25

    Default Re: Converting JPEG to binary (1 and 0) format

    To get the techniques worked out try writing a small test program that takes an array of bytes, converts it to a String and then converts that String back to bytes. For example: convert 0x46 to "01000110" and back. When that code works for many byte values then expand the code to a jpeg file.
    If you don't understand my response, don't ignore it, ask a question.

  4. #4
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

Similar Threads

  1. Converting Binary
    By Wizard0860 in forum New To Java
    Replies: 2
    Last Post: 03-20-2013, 11:04 PM
  2. Converting JSP Page to PDF Format
    By chandrakishore5 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-16-2012, 02:19 PM
  3. Converting date to SQL format
    By UnfairBear in forum JavaServer Pages (JSP) and JSTL
    Replies: 11
    Last Post: 08-05-2011, 07:00 PM
  4. converting to binary
    By telltera in forum New To Java
    Replies: 5
    Last Post: 09-02-2010, 02:35 PM
  5. Converting ASCII format
    By right2001 in forum New To Java
    Replies: 7
    Last Post: 02-17-2009, 03:55 PM

Tags for this Thread

Posting Permissions

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