Monday, November 12, 2012

#456 - TECHNOLOGY | Photoshop action for revealing demons in the dark (or not)

This is a draft of an upcoming post on processing photos and videos showing demonic possession. Check back often for updates.

A Photoshop action is currently in development that automates the procedure for revealing a possessing demon in a video or photo of the subject sitting in near total darkness; it is intended to expedite the application of a procedure comprised of a significant number of steps, and is particularly useful for processing videos of demonic possession, as it can be quickly and easily applied to still frames, which often number in the hundreds or thousands:

A snippet of the Reveal Demon-in-the-Dark Photoshop Action
Source image quality requirements for the Photoshop Action
The settings for the filters and adjustment layers are set to work with a photo (or video) made with an first-generation iSight camera, and with the subject sitting in front of the camera at a distance where only the head and neck are shown (never less). If you try to use the action with an image that is higher or lower in resolution, one with a smaller colorspace, or one where the subject is not sitting at the specified distance from the camera, then the resulting image from the action will be completely distorted.

Lighting guidelines for isolating the human and demon separately
The lighting on the subject and in the room can be set to exclude the demon, showing on the human, and to exclude the human, and show only the demon. While both can be seen at the same time under certain circumstances, such as when the demon is particularly bright, allowing the light emitted from it to penetrate past the relatively much stronger light reflecting off the human, and/or if the radiation emanating from the demon is strong enough to superimpose its face on the digital image even over that of the human (although, the latter requires the camera and/or the human to be in motion, at just the right speed and the right distance, which are different depending on the variety of demon).

This section only addresses the staging addressed first, on which the subject is seated as described in the previous section, and the goal is to isolate the demon from the human in the video or photo:

  • Showing only the human. In a completely dark room, use the Increase Display Brightness button (F2) to set the brightness of the display to full; then, in the Desktop & Screen Saver Panel of System Preferences, set the desktop color to White (Solid Colors).
  • Showing only the demon. Dim the display one step at a time using the Reduce Display Brightness button (F1), stopping right at the point where the human can no longer be seen. Although the human eye cannot contrast between the darkness of the room and the light emanated from the demon, the image sensor can, assigning just a barely different shade of black to the pixels that comprise the demon than to the ones comprising the surrounding darkness. Although the incremental difference between the brightness of each shade of black makes the video window appear completely dark, showing neither the human nor the demon, as long as their is a difference—no matter how small—then the demon can be differentiated from the dark in Photoshop.
The difference between the dark room and the dark demon to a digital camera
At the light level prescribed for showing only a possessing demon (above), the demon is actually brighter than the human because the molecules of a human reflect light, and the room is dark, providing virtually no light to reflect; however, the molecules of a demon are different. They emit light at the same frequency as the light they reflect (meaning that the light you see is not just light reflected off the demon, but is also light that is emanated from the demon at the same frequency that it reflects).
NOTE | Although a demon's molecules amplify light—that is, both reflect light from other sources and emanate its own light—a demon only appears brighter when the light reflected from non-demon molecules (humans, etc.) is less than the light emanated from the demon's. That's because a demon's molecules give off more light than it requires from another source 
less light from another source is   of light is needed to cause the demon's molecules to give off light of their own, which  thabut i a brighter demon than human, because the The caveat is that the light must be low enough to conceal the human, but bright enough to reach the demon so that it can amplify what it receives; if the light is too bright, the demon's 


Although the brightness is not enough to create the contrast the human eye needs to perceive the demon on screen, it is for the image sensor of the iSight camera, which will give all pixels comprising the demon a slightly different shade of black. In Photoshop, you increase the contrast between the different shades of black large to make a distinction between them that the human eye can see.

How Photoshop widens the gap between a dark room and a dark demon
This is done by increase that difference by substituting a different color to all shades of black lighter than the darkness of the room (he brightness can be  is will be increased until the demon can be seen; the room will stay black, and for every shade of black, another color will be substituted (such as red or green), and the contrast between the shades will be increased so that a distinction between the shades can be made (the room will stay black, and the next highest shade of black will be increased in brightness.

It is the relatively monotone coloring of the demon and the separation of color channels in a digital image that enables Photoshop to isolate only the parts of an image that comprise the demon:

The demonic cloak usually projects red color, but is sometimes green, as shown in the color channel separation image, above; regardless of its color, the image of the demon can be enhanced by applying the requisite adjustments to only the channel in which it is visible
When applying the tone and contrast adjustments to all channels (red, green and blue), the processed image would look like this:
Without first isolating the demon by color, adjustments made to the image will mix the face of the human with that of the demon
It is the contrast in brightness between the polarized light from the cloak of the demon and the reflected light from the surface of the human's face enables Photoshop to exclude the human by narrowing the tonal range of colors in the image to that of the demon:
When adjustments are made to the color channel that contains the parts of the image that comprise only the demon, the underlying human face is revealed
Without the distinction made polarized light and reflected light, and absent the capabilities of Photoshop, the image of the demon is concealed, as it is in the original image:
The original image, without any adjustments applied
In addition to increasing the visibility of the demon while excluding that of the human via adjustments to the tone and contrast of the color channel in which the image of the demon is naturally isolated, the action performs—or will perform—the following steps, in general:

  • smooths the texture of the demon's skin (blending and blurring the visible areas of the demon's skin until they overlap the dark spaces between)
  • adds realistic texture to the skin (superimposing the original texture of the skin over the smoothed areas, minus the dark spaces between):
  • sharpens the edges of the face and facial features:
[pending]

Although incomplete, the Photoshop action (.atn) file currently in development can be downloaded from DropBox[Download Demonic Actions.atn]

The Reveal Demon-in-the-Dark (green channel) action was applied to this video:

These are the (messy) notes I'm working from right now, as I complete and refine the action:

Adjusting Brightness and Contrast
  1. Duplicate the original layer.
  2. Adjust levels to 0, .47, 31.
  3. Create a Channel Mixer adjustment layer.
  4. Set the blending mode of the adjustment layer to Color Dodge.
  5. Select the duplicate of the original layer, and then apply Auto Contrast.
  6. Fade it by 50 %.
  7. Select the adjustment layer, and then merge down.
Reduce Noise layer
  1. Duplicate the merged layer.
  2. Apply the Median filter (1) to the duplicate layer.
  3. Apply the Dust & Scratches filter (1 and 1) to the duplicate layer.
  4. Set the blending mode of the duplicate layer to Luminosity.
  5. Merge the layers (Merge Down).
  6. Duplicate the new merged layer twice.
  7. Apply a posterize adjustment layer (30).
  8. Select the topmost merged (or posterize-adjusted) layer.
  9. Apply a posterize adjustment layer (32).
  10. Select the topmost merged (or posterize-adjusted) layer (again).
  11. Apply a threshold adjustment layer (2).
  12. Merge the adjustment layers with the new merged layer.
  13. Apply the Gaussian Blur filter (3.0)
  14. Set the blending mode to Exclusion.
Reduce Noise channel mask
  1. Merge Visible, and then duplicate the merged layer.
  2. Copy the original merged layer, and then save it to an alpha channel.
  3. Load the alpha channel as a selection, and then select a duplicate of the original layer.
  4. Select the white color range, while subtracting black (Select | Color Range).
  5. Invert the selection, and then clear it; deselect it.
  6. Duplicate merged layer.
  7. Apply a Gaussian Blur (3) to the duplicate merged layer.
  8. Duplicate the blurred duplicate merged layer, and then invert it, and then set the blending mode to Difference.
  9. Set the blending mode of the original blurred duplicate merged layer to Luminosity.
  10. Merge these three layers, and then copy it to a new alpha channel. This layer will be used to sharpen/smooth edges. (When automating the use of an alpha channel, delete the channel after each use.)
Sharpen Edges layer (using a channel mask)
  1. Create two transparent layers.
  2. Create a channel mask using the Reduce Noise layer,
  3. Load the channel mask as a selection, and fill the top transparent layer with white; invert the selection and then fill the layer with black.
  4. Select the bottom transparent layer, and then fill it with black; then, invert the selection, and fill it with white.
  5. Set the blending mode of the top transparent layer to Exclusion.
Sharpen Edges channel mask
  1. Stack the Reduce Noise layer over the Sharpen Edges to simultaneously smooth texture and sharpen edges using the Median filter.
  2. Set the blending mode of the Reduce Noise layer to Exclusion.
  3. Merge the two layers.
  4. Copy the merged layer to an alpha channel, and then load the channel as a selection.
  5. Select the duplicate of the original (or is it the original) layer, and then apply the median filter...
To run this action for each frame in your video file, create this Photoshop script (using ExtendScript Toolkit), but substitute the name of my action and action set with that of yours (in bold):

var docRef = app.activeDocument;
function recurseLayers(currLayers)

{

     for(var i = 0; i < currLayers.layers.length; i++)

     {

          docRef.activeLayer = currLayers.layers[i];

          if(isLayerSet(currLayers.layers[i]))

               {
                   recurseLayers(currLayers.layers[i]);                   
               }
         app.doAction ("[action]", "[action set]")
     }

}

function isLayerSet(layer)

{

     try{

          if(layer.layers.length > 0)

               return true;}

     catch(err)

          {return false;}

}

recurseLayers(docRef)