IENT / YUView

The Free and Open Source Cross Platform YUV Viewer with an advanced analytics toolset
http://ient.github.io/YUView
Other
1.78k stars 353 forks source link

When using full range option open full range yuv, pixel 255 is displayed as 235 #550

Closed 21pages closed 6 months ago

21pages commented 7 months ago

To Reproduce original.png original

  1. ffmpeg -i "original.png" -pix_fmt yuv420p -sws_flags spline+accurate_rnd+full_chroma_int -color_range 2 -colorspace 5 -color_primaries 5 -color_trc 6 "fullrange_601_420.yuv"
  2. Open fullrange_601_420.yuv with ITU-R.BT601, normal
  3. Change color convertion to ITU-R.BT601 Full Range, pixel 255 shows as 235

Expected behavior Show normally when open full range yuv with full range option. If it is my misunderstanding, could you give it an explaination?

Screenshots image image

Version (please complete the following information):

ChristianFeldmann commented 6 months ago

Hi! Thank you for the report. I am having problems to recreate the issue on my end. I was unable to download / view the png that you linked here. I don't seem to have access. Could you somehow send that to me? I just created a white (RGB 255,255,255) png and converted it to YUV using the ffmpeg command that you provided there. But I do get a YUV with limited range (the luma values are 235 as they should be for limited range). Maybe that is the issue? You can check the "ground truth" by opening the YUV file in a hex editor.

21pages commented 6 months ago

This is the source of png, https://obsproject.com/forum/resources/obs-studio-color-space-color-format-color-range-settings-guide-test-charts.442/

21pages commented 6 months ago

The max hex number in the yuv file is 235, I think I used a wrong ffmpeg command.

ChristianFeldmann commented 6 months ago

Thank you. That looks like some nice test images. So I tooke the image 640x480_color_range_test_chart.png and used the command you provided on it:

ffmpeg -i SomeOriginal.png -pix_fmt yuv420p -sws_flags spline+accurate_rnd+full_chroma_int -color_range 2 -colorspac
e 5 -color_primaries 5 -color_trc 6 -vf scale=800x600 "fullrange_800x600.yuv"

The YUV output file that I get has 235 as the highest luma value. So this is a limited range YUV file. YUView also shows this correctly. So I think you are fighting with FFmpeg rather then YUView.

ChristianFeldmann commented 6 months ago

Ah commented one second ago. Cool so no bug in YUView. That is good.