File:Barn-yuv.png

頁面內容不支援其他語言。
這個檔案來自維基共享資源
維基百科,自由的百科全書

原始檔案(400 × 1,196 像素,檔案大小:425 KB,MIME 類型:image/png


摘要

描述 YUV colorspace
日期
來源 Concept from en:Image:YUV_components.jpg, original public domain image at en:Image:Barns_grand_tetons.jpg
作者 User:Brianski
授權許可
(重用此檔案)
Public Domain

The picture is of the John Moulton Barn at the base of the Teton Range.

Raison d'être

This is a cleaner/more acurate version of en:Image:YUV_components.jpg. The improvements are:

  • Use a lossless compression algorithm, PNG removing jpeg artifacts
  • Don't scale U, V to extreme values - use the raw value, which more closely approximates the chroma component
  • Fix the inverted polarity of U, V components

Generation

To generate this map Brian Szymanski used this perl script, and then ran optipng with a full search to shrink the filesize. If you want to understand the below code, you should probably use perltidy - the code is mostly here for my reference, but it is wrong. The first channel of the blue/yellow map has to be set to U as well and the third channel of the red/green map has to be set to 0.5. I will fix it soon and update the image.

perl -e 'use strict; use warnings; use GD; GD::Image->trueColor(1);
my %color_cache;
sub cached_allocate { my $img = shift; my @rgb = @_;
   my $rgb = join(",", @rgb);
   $color_cache{$rgb} = $img->colorAllocate(@rgb) unless($color_cache{$rgb});
   return $color_cache{$rgb};
}

my $img = GD::Image->new("barn.png");
my ($height, $width) = ($img->height, $img->width);
my $yuv_img = GD::Image->new($width, $height*4);
foreach my $y (0..$height-1) {
   foreach my $x (0..$width-1) {
      my ($r, $g, $b) = map { $_ / 256 } my @rgb = $img->rgb($img->getPixel($x, $y));
      my $Y = 0.299*$r+0.587*$g+0.114*$b;
      my $U = 0.436*($b-$Y)/(1-0.114);
      my $V = 0.615*($r-$Y)/(1-0.299);
      $Y *= 256;
      $U += .436; $U *= (256/.872);
      $V += .615; $V *= (256/1.23);
      ($Y, $U, $V) = map { int(0.5+$_) } ($Y, $U, $V);
      die "YUV: $Y,$U,$V" if (($Y > 255) or ($U > 255) or ($V > 255));
      $yuv_img->setPixel($x, $y, cached_allocate($yuv_img, @rgb));
      $yuv_img->setPixel($x, $height+$y, cached_allocate($yuv_img, $Y, $Y, $Y));
      $yuv_img->setPixel($x, 2*$height+$y, cached_allocate($yuv_img, 0, 255-$U, $U));
      $yuv_img->setPixel($x, 3*$height+$y, cached_allocate($yuv_img, $V, 255-$V, 0));
   }
};
print $yuv_img->png' >barn-yuv.png

授權條款

Public domain 我,此作品的版權所有人,釋出此作品至公共領域。此授權條款在全世界均適用。
這可能在某些國家不合法,如果是的話:
我授予任何人有權利使用此作品於任何用途,除受法律約束外,不受任何限制。

說明

添加單行說明來描述出檔案所代表的內容

在此檔案描寫的項目

描繪內容

著作權狀態 繁體中文 (已轉換拼寫)

多媒體型式 繁體中文 (已轉換拼寫)

image/png

校驗和 繁體中文 (已轉換拼寫)

d3127a1d2ae6d38c684681282a72fe7b47e4f8a8

斷定方法:​SHA-1 中文 (已轉換拼寫)

435,380 位元組

1,196 像素

400 像素

檔案歷史

點選日期/時間以檢視該時間的檔案版本。

日期/時間縮⁠圖尺寸用戶備⁠註
目前2007年9月22日 (六) 05:11於 2007年9月22日 (六) 05:11 版本的縮圖400 × 1,196(425 KB)Brianski== Summary == {{Information |Description=YUV colorspace |Source=Adapted from en:Image:YUV_components.jpg |Date=2007/09/22 |Author=en:User:(3ucky(3all, updated by User:Brianski |Permission=Creative Commons Attribution or GFDL |see_also=[[barn

下列頁面有用到此檔案:

全域檔案使用狀況

以下其他 wiki 使用了這個檔案:

  • az.wikipedia.org 的使用狀況
  • be.wikipedia.org 的使用狀況
  • cs.wikipedia.org 的使用狀況
  • da.wikipedia.org 的使用狀況
  • de.wikipedia.org 的使用狀況
  • en.wikipedia.org 的使用狀況
  • es.wikipedia.org 的使用狀況
  • fr.wikipedia.org 的使用狀況
  • it.wikipedia.org 的使用狀況
  • ja.wikipedia.org 的使用狀況
  • ko.wikipedia.org 的使用狀況
  • nl.wikipedia.org 的使用狀況
  • pl.wikipedia.org 的使用狀況
  • ru.wikipedia.org 的使用狀況
  • tr.wikipedia.org 的使用狀況
  • uk.wikipedia.org 的使用狀況