1. 程式人生 > 實用技巧 >為什麼Chrome和Internet Explorer完全不同地顯示此影象?

為什麼Chrome和Internet Explorer完全不同地顯示此影象?

In a rather curious case of confused identify, a photo of a piece of fruit changes itself based on what browser it is displayed it. What’s the secret behind the optical illusion? Is it a pear, an apple, or both?

在一個令人困惑的標識混淆的情況下,一塊水果的照片會根據顯示它的瀏覽器而改變。 錯覺背後的祕密是什麼? 它是梨,蘋果還是兩者?

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“問答”環節由SuperUser提供,它是Stack Exchange的一個分支,該社群是由社群驅動的Q&A網站分組。

問題 (The Question)

SuperUser reader Ethree writes:

超級使用者讀者Ethree寫道:

Check this image out:

檢出此影象:

On Chrome and Firefox it will show as a pear. Now, try to save it and look at it saved on your desktop. Also, try viewing in safari or IE. It will display as an apple!

在Chrome和Firefox上,它將顯示為梨。 現在,嘗試將其儲存並檢視儲存在桌面上的內容。 另外,請嘗試在Safari或IE中檢視。 它將顯示為蘋果!

Try clicking the image and moving it around, you will notice the apple appears.

嘗試單擊影象並四處移動,您會發現蘋果出現了。

I guess my question will be, “why does this happen?”

我想我的問題是,“為什麼會這樣?”

Why indeed? We saw it as a pear in Chrome and, sure enough, when we saved it to our downloads folder it displayed as an apple.

為什麼會這樣呢? 我們在Chrome瀏覽器中將其視為梨子,可以肯定的是,將其儲存到下載資料夾後,它顯示為蘋果。

答案 (The Answer)

SuperUser contributor Matthew offers insight into the optical illusion:

超級使用者貢獻者Matthew提供了對錯覺的見解:

The “white” pixels in the apple picture contain the picture of a pear, stored at a much higher intensity, i.e. very bright.

蘋果圖片中的“白色”畫素包含梨的圖片,以更高的強度儲存,即非常明亮。

The “black” pixels in the pear picture contain the picture of an apple, stored at a fairly normal intensity, but scaled down to near black with the gamma correction.

梨圖片中的“黑色”畫素包含蘋果的圖片,以相當正常的強度儲存,但通過伽瑪校正將其縮小到接近黑色。

The image contains a gAMA chunk specifying a file gamma value of 0.02. When displayed without gamma correction, the viewer sees an apple with “white” pixels interspersed, which are actually the pear at its original (high) intensity.

該影象包含一個gAMA塊,該塊指定檔案的伽馬值為0.02。 在未進行伽瑪校正的情況下顯示時,觀看者會看到一個散佈著“白色”畫素的蘋果,實際上是原始(高)強度的梨。

When displayed with gamma correction, the viewer sees a colour-corrected pear with “black” pixels which are actually the apple rendered at a much lower gamma value.

當使用伽瑪校正顯示時,觀看者會看到帶有“黑色”畫素的經過顏色校正的梨,實際上是蘋果以較低的伽瑪值渲染的梨。

Browsers which display the pear are showing the image using the gamma information provided in it, while browsers which display the apple are not using this gamma information.

顯示梨的瀏覽器使用其中提供的伽瑪資訊顯示影象,而顯示蘋果的瀏覽器不使用該伽瑪資訊。

In other words, Chrome is respecting the gamma correction value and Internet Explorer is not.

換句話說,Chrome會遵守伽瑪校正值,而Internet Explorer則不會。



Have something to add to the explanation? Sound off in the the comments. Want to read more answers from other tech-savvy Stack Exchange users?Check out the full discussion thread here.

有什麼補充說明嗎? 在評論中聽起來不對。 是否想從其他精通Stack Exchange的使用者那裡獲得更多答案? 在此處檢視完整的討論執行緒

翻譯自: https://www.howtogeek.com/149223/why-do-chrome-and-internet-explorer-display-this-image-completely-differently/