可能发生的情况是 JPEG 没有嵌入的色彩空间,并且 Photoshop 的默认色彩空间与 Java 的默认不同,导致像素值略有不同。例如,Java 可能使用 sRGB,而 Photoshop 可能使用 AdobeRGB。您应该确认您在 Photoshop 和 Java 中使用相同的色彩空间。
编辑:
我用 Photoshop 检查了您在帖子中包含的图像,发现了以下有趣的信息:
- 颜色空间“未校准”
<exif:ColorSpace>65535</exif:ColorSpace>
- 图像是 CMYK TIFF 文件,每个像素有 4 个样本,而不是 3
左上角 (0,0,0) 和右下角 (255,255,255) 的任何内容都是对原始数据应用一些转换函数,在这个文件中绝对不是纯黑色和纯白色。
这是整个 XMP 原始数据集:
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-c060 61.134777, 2010/02/12-17:32:00 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
<xmpMM:DocumentID>45A47BED0B7E76061DB20B529F19C17E</xmpMM:DocumentID>
<xmpMM:InstanceID>45A47BED0B7E76061DB20B529F19C17E</xmpMM:InstanceID>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>image/jpeg</dc:format>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<photoshop:ColorMode>1</photoshop:ColorMode>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:tiff="http://ns.adobe.com/tiff/1.0/">
<tiff:ImageWidth>16</tiff:ImageWidth>
<tiff:ImageLength>16</tiff:ImageLength>
<tiff:BitsPerSample>
<rdf:Seq>
<rdf:li>8</rdf:li>
<rdf:li>8</rdf:li>
<rdf:li>8</rdf:li>
<rdf:li>8</rdf:li>
</rdf:Seq>
</tiff:BitsPerSample>
<tiff:PhotometricInterpretation>1</tiff:PhotometricInterpretation>
<tiff:SamplesPerPixel>4</tiff:SamplesPerPixel>
<tiff:XResolution>72/1</tiff:XResolution>
<tiff:YResolution>72/1</tiff:YResolution>
<tiff:ResolutionUnit>2</tiff:ResolutionUnit>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:exif="http://ns.adobe.com/exif/1.0/">
<exif:ExifVersion>0221</exif:ExifVersion>
<exif:ColorSpace>65535</exif:ColorSpace>
<exif:PixelXDimension>16</exif:PixelXDimension>
<exif:PixelYDimension>16</exif:PixelYDimension>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreateDate>2012-04-11T12:26:47-07:00</xmp:CreateDate>
<xmp:ModifyDate>2012-04-11T12:26:48-07:00</xmp:ModifyDate>
<xmp:MetadataDate>2012-04-11T12:26:48-07:00</xmp:MetadataDate>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>