Sin city effect closed

As in the title, I am searching for an algorithm to produce the effect used in Sin City film, which is selecting a color from an image and desaturating the rest of it.

Sin city effect closed

2 Answers
  1. In theory, it should be simple enough:

    • Convert each pixel to HSL.
    • If the hue is within a given range, then increase the saturation by a certain amount.
    • Otherwise, set the saturation to 0.
    • Convert the HSL value back to RGB and go on to the next pixel.

    You would need to experiment to figure out how big a hue range you needed, and how much to increase the saturation.

    This probably wouldn't give you perfect results. Even if the input scene already had the guy in green and everything else in decidedly not-green colors (which you couldn't count on unless you had purposely staged it that way), you would probably get some less-than-ideal results around the boundaries between "green guy" and "background". Given the sort of budgets movies have to work with, I suspect they did a lot of manual touch-up where needed. But you can get close and try to tweak from there.

    Joe White2012-04-14 11:41:59
  2. Convert image to HSV space and set saturation to zero for all hues except the one you want to keep.

    2012-04-14 11:44:12
Related Articles
  • So I have this code that produces fireworks using what appears to be a particle effect, but I don't understand what is going on in the code. Could som ...
  • I am aware about the risks on race conditions and that values written or read might be corrupted. I am in a situation where I have races on boolean an ...
  • I want to get latitude and longitude of a city by providing the api with the city name. It should work for most cities regardless how the user inputs ...
  • I've been asked to calculate the value for sin(x) using C++ without using any math libraries. How would I go about taking an entry by them (say 2 radi ...
  • Can someone explain how sin(e)&cos(ine) can be used to get the end projection coordinates(x,y) of a rotating object? Ive tried in some many differ ...
  • I made a graph of axes (x and y) using SWT in Eclipse and now i want to draw a f(x) = a1*sin(n1 *x) and f(x) = a2*cos(n2*x) functions. How should i st ...
You Might Also Like