<div dir="ltr"><div class="gmail_default" style="font-size:small">This looks really interesting but I will have to read up on what it does before I can even begin to test it.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 12, 2023 at 9:57 AM Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com">randrianasulu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">using code example from<br>
<br>
<a href="https://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff/f7bab37c8e66f3c77a5fbb5b5b72c10b0fb4ca5a..6f79f0971e8ccf6c7a2b8eb1dbc5b64fdd77ca0f:/libavcodec/pngenc.c" rel="noreferrer" target="_blank">https://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff/f7bab37c8e66f3c77a5fbb5b5b72c10b0fb4ca5a..6f79f0971e8ccf6c7a2b8eb1dbc5b64fdd77ca0f:/libavcodec/pngenc.c</a><br>
<br>
and test files from<br>
<br>
<a href="https://littlecms.com/img/blog/check_lut.jpg" rel="noreferrer" target="_blank">https://littlecms.com/img/blog/check_lut.jpg</a><br>
<br>
<a href="https://littlecms.com/img/blog/check_full.jpg" rel="noreferrer" target="_blank">https://littlecms.com/img/blog/check_full.jpg</a><br>
<br>
I think I was able to make png ffmpeg encoder to add built-in profile,<br>
based on (randomly-choose) colorimetry.<br>
<br>
patch itself needed to be applied with usual patch from directory just<br>
above main cinelerra-5.1 level, and not "git am"<br>
<br>
tar.gz not included due to 7Mb size!<br>
<br>
Fake colorimetry I used:<br>
<br>
========<br>
<br>
# this codec creates a set of image files in a directory<br>
# use an image2 file name like /dir/p%05d.png<br>
flags2=0x80000000<br>
colorspace=smpte2085<br>
color_primaries=bt2020<br>
color_trc=bt2020_12bit<br>
color_range=jpeg<br>
<br>
<br>
====<br>
<br>
resulted in this exiftool output:<br>
<br>
exiftool /dev/shm/4.png<br>
ExifTool Version Number : 11.11<br>
File Name : 4.png<br>
Directory : /dev/shm<br>
File Size : 29 kB<br>
File Modification Date/Time : 2023:11:12 19:28:40+03:00<br>
File Access Date/Time : 2023:11:12 19:28:40+03:00<br>
File Inode Change Date/Time : 2023:11:12 19:28:40+03:00<br>
File Permissions : rw-r--r--<br>
File Type : PNG<br>
File Type Extension : png<br>
MIME Type : image/png<br>
Image Width : 400<br>
Image Height : 300<br>
Bit Depth : 8<br>
Color Type : RGB<br>
Compression : Deflate/Inflate<br>
Filter : Adaptive<br>
Interlace : Noninterlaced<br>
Pixels Per Unit X : 1<br>
Pixels Per Unit Y : 1<br>
Pixel Units : Unknown<br>
Profile Name : icc<br>
Profile CMM Type : Little CMS<br>
Profile Version : 4.3.0<br>
Profile Class : Display Device Profile<br>
Color Space Data : RGB<br>
Profile Connection Space : XYZ<br>
Profile Date Time : 2023:11:12 16:28:40<br>
Profile File Signature : acsp<br>
Primary Platform : Apple Computer Inc.<br>
CMM Flags : Not Embedded, Independent<br>
Device Manufacturer :<br>
Device Model :<br>
Device Attributes : Reflective, Glossy, Positive, Color<br>
Rendering Intent : Perceptual<br>
Connection Space Illuminant : 0.9642 1 0.82491<br>
Profile Creator : Little CMS<br>
Profile ID : 0<br>
Profile Description : RGB built-in<br>
Profile Copyright : No copyright, use freely<br>
Media White Point : 0.9642 1 0.82491<br>
Chromatic Adaptation : 1.04788 0.02292 -0.05022 0.02959<br>
0.99048 -0.01707 -0.00925 0.01508 0.75168<br>
Red Matrix Column : 0.67348 0.27904 -0.00194<br>
Blue Matrix Column : 0.12505 0.04561 0.79684<br>
Green Matrix Column : 0.16566 0.67534 0.02998<br>
Red Tone Reproduction Curve : (Binary data 32 bytes, use -b option<br>
to extract)<br>
Green Tone Reproduction Curve : (Binary data 32 bytes, use -b option<br>
to extract)<br>
Blue Tone Reproduction Curve : (Binary data 32 bytes, use -b option<br>
to extract)<br>
Chromaticity Channels : 3<br>
Chromaticity Colorant : Unknown (0)<br>
Chromaticity Channel 1 : 0.70799 0.29201<br>
Chromaticity Channel 2 : 0.17 0.797<br>
Chromaticity Channel 3 : 0.131 0.04601<br>
Image Size : 400x300<br>
Megapixels : 0.120<br>
<br>
<br>
Note, of course this is WRONG kind of wrong, randomly setting<br>
colorimetry tags on encode, but at least it hopefully show that<br>
ffmpeg's machinery (6.1) works at least that far.<br>
<br>
sadly, no of those two test images show correct text, so I guess<br>
display icc profile support quite missing step for us ...!<br>
<br>
but one micro/nanostep at a time?<br>
</blockquote></div>