Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An action for creating scanlines

ACTIONS / BATCH PROCESSING

An action for creating scanlines

by  blueark  Posted    (Edited  )
A few people have been asking about creating a scanline effect recently, and I thought it might be an idea to show how you can create an action to automate the whole process. Like most actions, it takes a little time to set up, but once it's done, you can apply the effect to any image with one click.

What this action will do
This action will create a horizontal scanline effect (ie. a horizontal line followed by a transparent line, repeated all the way down your image). The 'lines' will be drawn in the current foreground color on a new layer. Hopefully, you'll be able to adapt it to your own needs, and I'll give a few ideas at the end.

Before you begin...
If you don't know how to create an action, read Spyderix's introduction: faq229-2791
Next, you'll need to set Photoshop's ruler units to pixels. File > Preferences > Units & Rulers... You can change it back afterwards, but it's essential to set this while you're creating the action.
Create a new document. The size doesn't really matter, but it shouldn't be too big or too small. 200 pixels square is fine.
Reset the foreground color to black. When you apply the action, you can change the foreground color to whatever you like, but for now, you just need to see what you're doing.

Let's get started
Create a new action and give it a meaningful name, like 'Create Horizontal Scanline'. Press Record.

In 8 easy steps...

1) Create a new layer (Layer > New > Layer...) and give it a name (say, Scanline)

2) Select all (Select > All) and fill the layer with the foreground color ( Edit > Fill..., choose Foreground Color and click OK)

3) Create a new (temporary) file (File > New). Make it's dimensions 1 pixel x 2 pixels. Reset the forground & background colors to black & white (shortcut: press D)

4) Zoom in close, and make one of the pixels black. You can do this by using the rectangular marquee tool to select one of the pixels and then filling it with the foreground color, or use a small pencil to color it in. Either way, just make sure you have one black pixel, and one white/transparent pixel.

5) Select > All and the choose Edit > Define Pattern. You can close this temporary file now without saving.

6) Go back to the original file and select the layer with the solid color fill.

7) Click the 'Add Layer Mask' button on the bottom of the layers pallette.

8) Edit > Fill... and choose pattern.

Now you can stop recording. Before testing it out, quit Photoshop, then open it again to ensure that your action is saved. Open any image you might have, view it at 100% and play the action. Try running it after changing the foreground color to something other than black, or try altering the layer blending mode to get different effects. One question that pops up regularly is a gradient scanline. Just run the action, select the layer mask and draw a black-to-transparent gradient. Couldn't be easier!

Variations
Here's a few other actions you could try:

1) In step 3 above, make the file 2 pixels wide x 1 pixel high and you'll create a vertical scanline instead.

2) Need thicker scanlines? No problem. Just create a larger file in step 3, and color in a few more pixels.

3) After step 8, change the blending mode to 'Overlay' for a really nice effect.

That's it really! Hope you find this useful, and of course, any comments are welcome!

Thanks to SPYDERIX for giving some constructive critisism and a few good pointers in the right direction.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top