[cairo] How to brighten image, maintaining contrast?
stuaxo2 at yahoo.com
Thu Jun 13 10:26:51 PDT 2013
I've been trying out some of the lighten some images, is there a way to brighten an image, but maintain contrast .. so far I've played LIGHTEN, HARD_LIGHT and SOFT_LIGHT - but images end up looking washed out.. any idea of a better approach ?
Code is pretty simple at the moment;
LIGHTEN_ALPHA = 0.25
LIGHTEN_OPERATOR = cairo.constants.OPERATOR_LIGHTEN
width = source_surface.get_width()
height = source_surface.get_height()
lightened = cairo.ImageSurface( cairo.constants.FORMAT_ARGB32, width, height )
with cairo.Context( lightened ) as cr:
cr.set_operator( LIGHTEN_OPERATOR )
cr.set_source_rgba(1, 1, 1, LIGHTEN_ALPHA)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo