Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any library implementing the color effect like lomography?

I am now looking for a lib that can change the color effect. Though the popular image processing lib such as opencv can do sufficient color transformation, the details of the transformation matrix of a certain style remain unavailable to me.

So is there any book or lib that introduces how to apply a certain effect such as ones in lomography?

like image 821
Xiaolong Avatar asked Jul 09 '11 06:07

Xiaolong


1 Answers

From the comments it seems you would like to replicate "step by step" the Photoshop tutorial pointed by @0x69.

With Mathematica 8, I did the following:

Step1. I copied the picture from the tutorial

enter image description here

Step2. Define the point-based function that will change the red channel and apply it

redfun[x_, s_] := 1/(1 + E^(-((x - 0.5)/s)));
Plot[{t, redfun[t, .1]}, {t, 0, 1}, AspectRatio -> 1]
img2 = ImageApply[{redfun[#[[1]], .1], #[[2]], #[[3]]} &, img]

enter image description here

Step3. I don't know the algorithm used for color balancing by Photoshop, so let's skip those and create directly a vignette. The color balancing would change things quite a bit.

Step4. Vignette creation:

vignette = ColorNegate@ImageAdjust[
               DistanceTransform[Image[1 - BoxMatrix[1, Reverse@ImageDimensions@img2]]],
               {0, 0, 2}, {Automatic, Automatic}]

enter image description here

You can just multiply the two images, or use fancier overlaying modes (see the documentation of ImageCompose):

ImageMultiply[img2, vignette]

enter image description here

It would be quick and easy to tweak things around and change the final result.

like image 110
Matthias Odisio Avatar answered Mar 23 '23 21:03

Matthias Odisio