summaryrefslogtreecommitdiffstats
path: root/debian/lcms/lcms-1.19.dfsg2/python/testbed/clamp.py
blob: 2115b097b37e5822cab512fc0c2c014c7b21ce2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#
# Sample: Gamut clamping
#

from lcms import *



Lab = cmsCIELab(80, -200, 50)
print "Original", Lab

#
# Desaturates color to bring it into gamut.
# The gamut boundaries are specified as:
#   -120 <= a <= 120
#   -130 <= b <= 130

cmsClampLab(Lab, 120, -120, 130, -130)

print "Constrained", Lab