user894554
user894554

Reputation: 268

jpeg decoding when data is given in array

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 .

Upvotes: 2

Views: 2982

Answers (1)

dacwe
dacwe

Reputation: 43504

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));

Upvotes: 8

Related Questions