2

i am using LibJpeg library for decoding jpeg image ( given in form of byte array ) into rgb color map . but it come different from my sample output i want to check by java programme . how to do this in by java programme ? what is use of APPn in header ? how to decode jpeg image into rgb pixel .

3
  • 1
    Can you post some code of what you have tried till now and what is not working as per your expectations? thanks. Commented Sep 14, 2011 at 10:47
  • 1
    i have libjpeg library and getting image in bmp format from raw data of jpeg but sample output is taken from blackberry that is in rgb pixel . when i read pixel of my libjpeg output(output.bmp) value by rgb() in java it give me different pixel value from that of sample output taken from blackberry . is there any reason for this? Commented Sep 16, 2011 at 11:48
  • 1
    Please provide som code. Commented Sep 17, 2011 at 19:25

1 Answer 1

8

Why not use ImageIO.read together with ByteArrayInputStream to read the byte array into an image then no extra library is needed (pure java solution):

BufferedImage image = ImageIO.read(new ByteArrayInputStream(bytes));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.