Skip to content

example linear scale

Kirk Martinez edited this page Sep 19, 2019 · 3 revisions

brighten or manual colour balance

this will scale red by a factor of 1.1 green 1.2 and blue 1.3. The output file will be the same format as the input - so it works across the full range of formats

def brighten(filein, fileout):
     im = pyvips.Image.new_from_file(filein, access="sequential")
     im *= [1.1, 1.2, 1.3]
     # if it is a jpg force a high quality
     im.write_to_file(fileout , Q=97)
Clone this wiki locally