Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Aug 2021
Posts: 73
|
ICCConvert - Little CMS based color management in VS
https://github.com/YomikoR/VapourSynth-ICCConvert
I ported some elementary features of Little CMS for color management in VapourSynth. Features: - Color profile conversion. - Playback like in the mpv player (BT.1886 or overridden with a custom gamma). - Extract color profile from image (when built with ImageMagick 7). - Auto detection of the display color profile loaded for the current monitor, so that the plugin can be included in a Python wrapper for other users. About auto profile detection: - Since the main purpose of the plugin is QC, it's strongly recommended to manually specify the input for actual encoding. - The detected window refers to the editor interface of VS Editor, or the console where you launch VS Preview, etc., NOT the preview windows of these editors. - Windows: foreground window. - Linux, X11: window of input focus. Recommended to build with colord support. - Linux, Wayland: not yet implemented. Let's see if there will be a colord alternative for Wayland. - MacOS: not yet implemented. Help wanted. Help wanted: - Correctness and auto profile detection in MacOS. I don't have a device. Last edited by Yomiko; 2nd September 2021 at 10:36. |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Aug 2021
Posts: 73
|
Release 3.0
- Old function names are changed to "Convert" and "Playback", respectively. - Added an "Extract" function that provides the embedded ICC profile of an input image with its default rendering intent. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Aug 2021
Posts: 73
|
Release 3.2
It has been a lot saner. Now it can read embedded ICC profiles from the frame property "ICCProfile". Check the flag "prefer_props". These profiles are hashed so that duplication of them from frames won't cause a big performance loss. This feature is only shipped with the new VS API. |
![]() |
![]() |
![]() |
#4 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,503
|
Unfortunately new imwri builds are taking a bit longer than expected due to imagemagick being horrible to compile/link with in windows. Will hopefully be fixed soon.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
![]() |
![]() |
![]() |
#5 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,645
|
Test with a TIFF image scanned in 48 bit depth and with a "wide gamut RGB" ICC profile embedded, worked. Though the "gamut_warning" seems to not work? I have a sRGB monitor and some of the color on my image is definitely out of sRGB range, but with gamut_warning=True I did not see any indication on my image.
Code:
clip = core.imwri.Read(img, embed_icc=True) clip = core.iccc.Convert(clip, gamut_warning=True) clip.set_output() |
![]() |
![]() |
![]() |
#6 | Link | |
Registered User
Join Date: Aug 2021
Posts: 73
|
Quote:
I may correctly implement the proofing function in the future. Last edited by Yomiko; 17th December 2021 at 11:26. |
|
![]() |
![]() |
![]() |
#8 | Link | |
Registered User
Join Date: Aug 2021
Posts: 73
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,645
|
Quote:
By guessing: icc path = C:\Windows\System32\spool\drivers\color input_icc = scanner's calibration icc display_icc = sRGB icc proofing_icc = WideGamutRGB icc Is this correct? |
|
![]() |
![]() |
![]() |
#10 | Link | |
Registered User
Join Date: Aug 2021
Posts: 73
|
Quote:
display_icc: the monitor icc in spool proofing_icc: for now let's suppose it's the icc of a printer Soft proofing is for simulating how the image will be printed, while the result is shown on the monitor. The printer may not reproduce all the colors of the image. This can be identified by the gamut checking. In such situation, the rendering "intent" handles how colors are printed. The default value comes from the header of input_icc. The monitor may not reproduce all the colors of the simulated printing result. This is not identified by the gamut checking. In such situation, the rendering "proofing_intent" handles how the colors are shown on the monitor. The default value comes from the header of proofing_icc. For your case it might be input_icc from image, display_icc from monitor, proofing_icc from monitor (same as display_icc). Last edited by Yomiko; 18th December 2021 at 02:26. |
|
![]() |
![]() |
![]() |
#11 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,645
|
Thanks it worked. The warned area matched what I observed from photoshop's colorpicker.
Code:
srgb_icc = r'C:\Windows\System32\spool\drivers\color\sRGB.icc' clip = core.imwri.Read(img, embed_icc=True) clip = core.iccc.Convert(clip, proofing_intent="relative", display_icc=srgb_icc, proofing_icc=srgb_icc, gamut_warning=True) clip.set_output() ![]() What if I want to check if AdobeRGB color space is able to hold all the gamut of my scan instead of sRGB? Do I just change the proofing_icc to adobergb icc? Last edited by lansing; 18th December 2021 at 03:52. |
![]() |
![]() |
![]() |
#16 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,645
|
How do I do it properly? From what I understand, imwri reads in the image data, but it needs embed_icc to turn on and the CMS filter to map the color correctly in video form. And since the Wide-Gamut-RGB color profile shared about the same gamut width as Rec2020, converting the RGB48 clip to Rec2020 would preserve all the gamut?
|
![]() |
![]() |
![]() |
Tags |
icc, lcms, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|