Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.

I have the image below with the red lightning effect a single layer. What I'd like to do is make the red transparent, but maintain pixel brightness, so that I can then overlay it on a red canvas, or blue canvas, etc etc. How can I keep the pixel brightness in this way? Currently, with it all transparent, it looks like this:

http://renx.st0rm.net/test.php?color=FF0000


Baseline Image

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

What you should do is turn the red lightning effect into a layer mask.

  1. Create a new layer, fill it with black
  2. Add a layer mask to this new layer by either clicking the Add layer mask button on the Layers pane or using Layer > Layer Mask > Reveal All
  3. Copy your (flattened) lightning artwork to the clipboard
  4. Open up the layer mask editor by Alt + Clicking the "Layer mask thumbnail" on the Layers pane. (It's the white box next to right of the "chain").
  5. Paste in your copied lightning artwork. It will turn grayscale, and that's okay.
  6. Invert the lightning artwork with Ctrl | Cmd + I
  7. Exit the layer mask editor by clicking another layer on the Layers pane

Following those steps should give you the following result:

Photoshop screenshot

It's not perfect because your black background in the original image was not #000000. We can correct this by adjusting the levels (Ctrl | Cmd + L) of the layer mask and setting the white point to the background (the white eyedropper icon).

Doing so gives me the final image below that you can use to overlay on any color:

final image

Overlaying this on blue would look like this (ignore the text since I don't have the separated layer available):

final image on blue

JSFiddle demo (with bonus animation in Chrome)

share|improve this answer
    
Thanks for the detail :) –  Ben Feb 11 at 22:07
2  
Nice bonus animation! ;) If you added another 'to {..red..}' would it smoothly transition back to red after blue? It jumps atm and jsfiddle doesn't work well for editing on mobile. –  Dominic Feb 12 at 12:56
    
@Dom improved the animation for you; you can set animation-direction: alternate to transition it back –  JohnB Feb 12 at 21:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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