Platforms to show: All Mac Windows Linux Cross-Platform

Back to LCMS2ProfileMBS class.

Previous items

LCMS2ProfileMBS.WriteToneCurve(tag as Integer, o as LCMS2ToneCurveMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 12.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Writes tone curve tag.
Example
// read a profile
dim f as FolderItem = SpecialFolder.Desktop.Child("myprofile.icc")
dim p as LCMS2ProfileMBS = LCMS2ProfileMBS.OpenProfileFromFile(f)

// find gray level tone curve
dim t as LCMS2ToneCurveMBS = p.ReadToneCurve(LCMS2MBS.kcmsSigGrayTRCTag)
if t<>nil then

// let's make a new one with half of old values
dim values(1000) as single

for i as Integer = 0 to 1000
values(i) = t.EvalToneCurveFloat(i/1000.0) * 0.5
next

// build new curve with that values
dim n as LCMS2ToneCurveMBS = LCMS2ToneCurveMBS.BuildTabulatedToneCurve(nil, values)

// write back
if not p.WriteToneCurve(LCMS2MBS.kcmsSigGrayTRCTag, n) then
MsgBox "failed to write tone curve"
end if
end if

// write profile
f = SpecialFolder.Desktop.Child("test.icc")
call p.SaveProfileToFile(f)

Works with kcmsSigBlueTRCTag, kcmsSigGrayTRCTag, kcmsSigGreenTRCTag and kcmsSigRedTRCTag.

Some examples using this method:

LCMS2ProfileMBS.WriteUcrBg(o as LCMS2UcrBgMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method LCMS2 MBS Images Plugin 12.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Writes UcrBg tag.

Previous items

The items on this page are in the following plugins: MBS Images Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...