So, i think this one adds lcms2 compile guards so should work in addition to another patch 0001-lcms2-configure-support-for-internal-ffmpeg.patch added all 3 as attaches. Usage CIN_CM_PROFILE="/usr/share/color/icc/colord/WideGamutRGB.icc" bin/cin /dev/shm/gradient\ *.jpg without cin_CM_PROFILE there should be no difference in both tracks with it srgb track should have much muted colors (or if you use sRGB profile ProPhoto one must be much brighter.) Works only with rbga8 project profile, ffmpeg input. May not work at playback, but works at rendering and stop frame in compositor. Timeline/miniatures not color manged On Sat, May 2, 2026 at 8:31 PM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
I think this one works (at rgba8 only for now)
at least it shows some difference between srb and prophoto jpegs now
and between R2020-P3 png in rgb8 (no cms) and rgba8 (cms) modes
On Sat, May 2, 2026 at 11:20 AM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
Ok, I tried to add env. variable for profile but it still does not work ?
CIN_CM_PROFILE=/usr/share/color/icc/colord/ProPhotoRGB.icc bin/cin /dev/shm/R2020-P3-color-bars.png
as in, it just show same picture!
On Sat, May 2, 2026 at 9:59 AM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
aww, forgot to check if side data exist ... It crashes if I load file _without_ such side data, so in a sense it detect such files correctly?
On Sat, May 2, 2026 at 9:48 AM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
ah, it "worked"
I just need to set "ffmpeg first" (I switched away from it for testing)
But I still can't see difference?
On Sat, May 2, 2026 at 9:30 AM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
I tried to stuff cmsDoTransform into our ffmpeg.C but it does not work :(
as in, it does not even come to this newly added block ... does not print colormodel or "cms!" line
On Fri, May 1, 2026 at 11:07 AM Andrew Randrianasulu <randrianasulu@gmail.com> wrote:
https://stackoverflow.com/questions/22561176/lcms2-convert-cmyk-to-rgb-throu...
this was answered like this
=== copy ===
hTransform = cmsCreateTransform(hInProfile, TYPE_CMYK_8, hOutProfile, TYPE_ARGB_8, // ARGB is most likely for QImage INTENT_PERCEPTUAL, 0);
uchar *in = outImage->bits(); // bits() is equivalent to scanLine(0) uchar *out = outImage->bits();
cmsDoTransform(hTransform, in, out, outImage->byteCount() / sizeof(QRgb));
===
official article show bigger switch
https://littlecms.com/blog/2020/12/09/using-lcms2-on-qt/
/** * Convert from Qt format to lcms2 format */ static cmsUInt32Number toLcmsFormat(QImage::Format fmt) { switch (fmt) { case QImage::Format_ARGB32: // (0xAARRGGBB) case QImage::Format_RGB32: // (0xffRRGGBB) return TYPE_BGRA_8;
case QImage::Format_RGB888: return TYPE_RGB_8; // 24-bit RGB format (8-8-8).
case QImage::Format_RGBX8888: case QImage::Format_RGBA8888: return TYPE_RGBA_8;
case QImage::Format_Grayscale8: return TYPE_GRAY_8;
case QImage::Format_Grayscale16: return TYPE_GRAY_16;
case QImage::Format_RGBA64: case QImage::Format_RGBX64: return TYPE_RGBA_16;
case QImage::Format_BGR888: return TYPE_BGR_8;
default: return 0;
} }
so I think we can add support for rgb8 timeline format at least, in same place where swscale call done in our ffmpeg.C
in ffmpeg we have
libavfilter/vf_iccdetect.c
#include <lcms2.h> const AVFrameSideData *sd; cmsHPROFILE profile;
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_ICC_PROFILE); profile = cmsOpenProfileFromMemTHR(s->icc.ctx, sd->data, sd->size);
cmsCloseProfile(profile);
Full documentation in pdf form
https://www.littlecms.com/LittleCMS2.18%20tutorial.pdf
TYPE_RGB_FLT/TYPE_RGBA_FLT exist in /usr/include/lcms2.h
so rgba-float should be supportable too.
I'll try to write easy detect part for configure first.