Extract JPEG from TIFF file

℡╲_俬逩灬. 提交于 2019-12-04 06:43:29

The difficulty with TIFF files produced by Photoshop is that they support writing the RGB colorspace into JPEG compressed data. If you extract a single tile from your TIFF file and write it as an independent JPEG image, it will not display correctly because decoders assume that the colorspace is YCbCr. There is a solution as long as the viewing application respects the Adobe APP14 marker. Included in this marker is a byte which defines the transform (colorspace). If you insert this sequence of bytes before the SOI, your image will display correctly on many viewers.

FF EE 00 0E 41 64 6F 62 65 00 64 80 00 00 00 00

The last byte defines the transform; in this case 0 indicates the RGB colorspace. You can read more about it here:

Oracle JPEG metadata doc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!