开发者

How to convert photos to Polaroid-like programmatically?

How to c开发者_运维知识库onvert modern day photos to the look and feel of those Polaroid photos ? References and/or sample codes are welcome. Thanks!


Convert the images to HSV (cv::cvtColor) then look at adjusting the hue/saturation values

see http://en.wikipedia.org/wiki/HSL_and_HSV for a rather too technical article


Here is a video showing how to do it in GIMP: http://www.youtube.com/watch?v=1LAUm-SrWJA and here is the tutorial: http://howto.nicubunu.ro/gimp_polaroid_photo/

You can look at various steps (each one of them would be some basic image processing operation) and glue together to make your own code. I think each GIMP operation is in turn available as a script-fu script/code.


I would suggest using blend modes along with the HSV conversion.

This website below has been of tremendous help to me while processing images to give them an 'old' look.

http://www.simplefilter.de/en/basics/mixmods.html

Do note that you need to mix and match different blend modes with color tints and blur algorithms to achieve the various Polaroid effects.


A good starting point would be look at ImagemMagick. It already does have cmdline options to change the hue and saturation of a photo. Find a parameter set that gives you the result that you want and look at the source code to see what it is doing behind the scenes..


Programmatically, you'd want to use an image processing library such as OpenCV.
A large part of the effect (besides adding the white frame) is a change in the image color balance and histogram. This is due to the degradation of the chemical elements in the Polaroid film.
The types of operations you would need to apply to the image:

  • Changing color spaces such as HSV;
  • Desaturation;
  • Blending with color filters (this is the suggested way here);
  • Changing the brightness and contrast of the image channels for the chosen color space.

Obviously, most tutorials about how to do this in Photoshop (or other photo editing apps), can be converted into programs using OpenCV.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜