在数组中给出数据时的jpeg解码 [英] jpeg decoding when data is given in array

查看:106
本文介绍了在数组中给出数据时的jpeg解码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用LibJpeg库将jpeg图像(以字节数组的形式给出)解码为rgb颜色映射。
,但它与我希望通过java程序检查的示例输出不同。
如何通过java程序执行此操作?
在标题中使用APPn是什么?
如何将jpeg图像解码为rgb像素。

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 .

推荐答案

为什么不使用 ImageIO.read 以及 ByteArrayInputStream 将字节数组读入图像,然后不需要额外的库(纯Java解决方案):

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

这篇关于在数组中给出数据时的jpeg解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆