0
$\begingroup$

enter image description here

Some underlying portrait above is glazed over with a series of vertical lines that neatly follow the contours of the face. What is this effect called and how can it be replicated, step-by-step, in Adobe Photoshop or other software? plus, how can the gap between the lines be controlled?

Also is the color scheme due to chromatic aberration, or just simple RGB channel separation?

$\endgroup$
1
  • $\begingroup$ If you go into photoshop and do a horizontal linear motion blur of about 40 pixels, that does half the work of recovering the original. $\endgroup$
    – Wyck
    Apr 6, 2021 at 14:57

1 Answer 1

1
$\begingroup$

The technique is called halftone. Achieving continuity must be done through subsampling / super-sampling, but the essence of the algorithm goes like this.

Imagine walking across a horizontal line of the image accumulating energy from each input pixel as you go. Once you have accumulated some threshold amount of energy in the accumulator, emit a single pixel, and then reduce the energy stored in the accumulator by a constant amount.

In code, that would be something like:

for (int y = 0; y < height; ++y) {
    double accumulator = 0.0;
    for (int x = 0; x < width; ++x) {
        accumulator += input[x, y];
        if (accumulator >= 0.0) {
            output[x, y] = 1.0;
            accumulator -= K; // try values like 5.0 or more for K.
        }
    }
}

The larger K is, the more energy must be accumulated before outputting a pixel, and hence, the more horizontal distance there will be between the lines. If K is 1, that's actually a naïve approach to the dither algorithm.

Supersample to achieve continuity. You can also emit discrete (x,y) points instead of rendering an output pixel directly and then render a new image by rendering a vertical curve passing through the nth point generated of each scanline.

Perform the operation discretely on separate colour channels to get what you described as the "chromatic aberration" effect.

The effect degenerates the more complexity you encounter in the image on a single line. For example, after just two eyes on the same line, the lines are extremely wavy at the right of your example image. Here is the effect exaggerated even more.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.