Introduction: Ambilight DFMirage [super Fast Screen Capture and Processing]

yes, all my instructables are about one little project, but as you may have seen, i've evolved really good in these kind of projects.

in this article we're goin to use a software that i've been working on for quite a while, and as the title says"Super Fast", yes as fast as 75 fps with 15% of single processor, no gpu utilization, and best of all, full screen application support.

if you don't know whats the concept of ambilight, please use this link to get amazed by the idea :)

originally provided by Philips, now we clone the idea with the help of some skills.

how do we do such a thing ?

we need a PC with windows OS to do all the processing, digital addressable leds, and a micro-controller to connect the pc with the leds.

Houri, whats different and new in this version ?

well, 1st problem that most people were facing is the full screen applications, games and exclusive screen media players, solved :)

2nd problem is a small noticeable delay, caused by the capturing of image or by the sending data mechanism, also solved.

the capturing method I've used in this project is provided by the amazing guys at

it's super fast capturing method is used for streaming screens across the internet for whatever purposes.

here we are using it to capture our own screen and do the edges processing.

also you are given the

enough with the technical talk, GIVE ME THE HOW TO :D

Step 1: How To: What to Get and Where to Get It From?

Picture of How To: What to Get and Where to Get It From?

1. Arduino uno there's plenty of options available, a clone is also a good idea [11$] from local store, don't forget the USB cable, might consider a longer than stock cable depending on the locations of your units.

2. ws2801 led strip , [43$] for the 5-meters, only used around 45 leds of total 160, used the others for other projects.

3. a power supply to power up the leds, the strip im using is 5v, with max of 9w per meter, im using 45 leds, do the math :D, but usually a pc power supply would be more than fine, and that what im using.

4. some solder and soldering equipment and skills if needed, thats if you are not using connectors like a molex connector and arduino pins connectors.

that's about it, project costs around 55$.

Step 2: Arduino Uno and WS2801 Connection

Picture of Arduino Uno and WS2801 Connection

Ws2801 led strip has 4 connectors.


the figure above shows how to connect them.

please note that you should apply your led strip on a screen that is very close to a wall.

also make sure that the first led index is at the right goin up to the top ending with the last led being at the left as shown on the previous figure.

Step 3: Software

Download Arduino IDE

Downlaod Fastled Arduino Library

Downlaod Mirror Screen Driver

Download both LedController.rar and Adalight Arduino Sketch from attachments

1. Install and run Arduino IDE

2. Include fast led io library in the Arduino IDE

3. open the Sketch code

4. Modify these defines

#define NUM_LEDS 43
#define SPEED 250000

NUM_LEDS is the total count of your leds, SPEED is the baudrate, leave it as is if you have no idea what's baudrade :D.

5. upload your sketch to your arduino uno.

6. install the Mirror Screen Driver.

7. in the "LedController\LedController\bin\Debug" you'll find "settings.ini" , edit it with any text editor and pick your settings.

8. run "Ambilight DFMirage\bin\Debug\Ambilight DFMirage.exe", make sure it runs As Admin

Step 4: End of Project

thats all to it, as you've seen the project solution is open source, it's a .net c# windows forms app made with visual studio comunity 2015 , the driver example, the gamma correction method, and the processing parts are all open source. here are all the links of codes i've used and learned allot from

thanks for all of there efforts and without them this wouldn't have been done :)

if you guys have any improvements or ideas to the project please comment.

Enjoy and have fun :)

Step 5: Updates, History Log, to Do

//project discontinued:

I've decided to turn off the project, it was a good experience i've gained in the making and supporting it, in the other hand, i've decided to give a much larger project which this project was a small part of

make sure to edit the settings.ini and disable whatever hardware you don't have and enable the ones you have.

what is exactly in the new project ?

well, it's basically all what i can in do c#, you'll get 2 main things, the led control app server, and the web app, the server acts as:

Audio Output analyzer, led controller with lots of modes, one of them is ambilight with support for bottom leds, gamma correction, others like static color and rainbow, and a server for the web app.

the web app acts as:

remote controller for the leds, hardware monitoring, file transfer from mobile phones to pc and vice versa (works with iphones too), and a keyboard from your mobile to your PC.

now im really sorry that i had to stop supporting, but it's hard to find the time for this project, you can find the new solution named as "LedController3.0" in the downloads

v1.3: 3016-05-24 (last update)

-added event to exit the program on windows session switching(logoff)

v1.2: 2016-05-20

- added logger

- added screenshot capture[u can see in the screen shot that it doesn't have any text, thats normal]

- bug fix for resolutions that aren't 1920*1080

v1.1: 2016-05-17

- configration is now done with Configration.exe if you don't prefer handling it manually

- added a delay to slow down the thread to manage fps

- no need to compile your version after this release, only some configuration


initial release


tested on windows 10 64bit, i7 cpu, nvidia gtx770 ,16gb ram.

if you guys have tested it and found it useful and fun please post your setups and your specs, specially which os r u running on to know which functions well and which not ..


NiklasM (author)2017-05-02

Great project! I have a question regarding adjusting the colors of the leds.

Is there a way to shift to a warmer range e.g. turn up for the reds in the leds?

I have ws2801 leds set around my monitor, and when I'm displaying white on my monitor, the leds shine a bright blue.

NhatD7 (author)2017-04-08

I had to make an account to thank you for the wonderful and awesome project. It's been working great, but I noticed that only particularly bright colors work best, when gaming or watching videos bright colors are quite hard to come by so is there anything I can do to make the LEDs still light up quite a bit even to darker colors? That'd be awesome

NhatD7 made it! (author)NhatD72017-04-08

Nvm I decreased square length and they light up pretty often now.

KingN7 (author)2017-01-20

I made everything on my arduino nano and nothing. Theres something wrong with the software I guess

Da_Plague (author)2016-06-05

Looks great! I only need bottom led support and then my setup would be perfect <3

h0uri (author)Da_Plague2016-08-18

try v3.0, it has bottom leds .. :)

funnybox2006 (author)h0uri2016-10-30

Hey h0uri,

nice Project! Where can i download v3.0 ? In the current download Page in the Settings Tool there is only left,right and top LED.

h0uri (author)Da_Plague2016-06-13

Perfect dude .. also good job on making it work for multiple monitors .. :D

bot leds are coming in July, ill be making major updates then .. :D

h0uri (author)h0uri2016-08-17

i've decided to discontinue this project,please read the notes.

also i've been working on another project with the same goals,along with new features such as color control,bottom leds support,music analyzer,and control your led system fully from a mobile device locally, i'll make sure to update this thread once fully done, in a week hopefly .. :)

Da_Plague (author)h0uri2016-08-16

the update finished? Where can I find it? I’m eager to use all of my led’s!

I’m still happy with the ambilight!

hooman008 (author)2016-10-29

hello thanks for the good work , i ran into a problme and that is where is this folder exactly ?

7. in the "LedController\LedController\bin\Debug" you'll find "settings.ini" , edit it with any text editor and pick your settings.


KunalD20 (author)2016-10-20

Where are the attachments LedController.rar and Adalight Arduino Sketch?

Are they the Adalight_Fastled_ws2801.rar and Ambilight DFMirage.rar?

I'm an absolute beginner at this, so could you please provide some pointers on how to set the files up? Would mean a lot to an aspiring tinkerer. <3

KunalD20 (author)KunalD202016-10-21


Ordered this strip, powering about 2 meters of it with a separate switching 5V/20A supply. Will this work?

Also, I read on Adafruit that data moves in one direction and power can go either way, so should is it possible to skip grounding the Arduino to the main supply (I'm using a USB connection any way) and ground the strip and connect it to the supply through the other end(opposite the Arduino)?

I'm unable to ground the board using Molex connectors, they're all occupied.

wilmardo (author)2016-06-24

Is there a possibility to set the monitor which DFMirage looks at? I have my TV in a separate setup hooked to my pc and it would be awesome if DFMirage can look at the image on the TV (3th monitor) instead of my main monitor.

h0uri (author)wilmardo2016-06-24

yes it's possible if you modify the code .. but sadly now i can't do anything about it since i'm not anywhere near my desktop and i don't have multi monitor to make sure it works .. it's gonna take a while for me to do it..

wilmardo (author)h0uri2016-06-25

Thanks for the fast reply and of course the awesome project! I will look into the code then, wish me luck ;)
I fixed it for now by setting the TV as monitor one and it works fine that way.

Da_Plague (author)2016-06-03


In the Configuration what do the scan options do?

Delay 0-500
Width 0-500
Skip 0-500

h0uri (author)Da_Plague2016-06-04

delay: if you are getting too much fps, or too much cpu usage, u can add a delay to slow down the thread

width: is the length of each rect to be scanned, the more it's the more u r closer to the center the slower the algorithm gets.

i've used skip as a factor, the more you skip the faster, with less quality of color.

less skip better color with slower performance

ex on skip: on 150 or 200 i was getting 70 to 75 fps

on 100 skip ii slowed down to 60 to 70 fps .. etc.

Da_Plague (author)2016-06-03


Great job on this version of ambilight for PC, I’ve
tried the adalight but processing is slowing my games down to 30 fps which isn’t
playable, your version is acceptable for gaming (45 FPS) so I’m happy to
use your instructable.

have a problem , when a LED should be red it is blue of color, I’ve followed
your tutorial, I’m not sure what goes wrong.

setup is:

Arduino uno

75 ws2801 LED’s (China) similar like

Switching power supply 5V 10A

Windows 10 Pro

Intel Core i5-2500K

ATI/AMD Radeon R9 390

Monitors - DELL U2311H (DisplayPort)


Read Config.ini

Config Parsed

Buffer created

Total Leds 75

Gamma table created from 5

Rect {X=0,Y=0,Width=6048,Height=1080}

Init Rect

Driver Loaded

Driver Connected

Thread Started

Form lLoaded

Form Shown

Driver Disposed

closed serial port

Sent All Black

Exit Success

3-6-2016 22:09:44

Log End ..


driver res



h0uri (author)Da_Plague2016-06-03

try to switch the RGB order in the arduino sketch to something else like BGR, or GBR, etc ..

Da_Plague (author)h0uri2016-06-03

yup, that did the trick!

Thank you!

Looking forward for bottom led support

YohanB1 (author)2016-05-28


What about using WS2811/WS2812 (3 wire) compared to WS2801

h0uri (author)YohanB12016-05-28

well, not that big of a difference, i believe some tweaking on the arduino sketch code is required, and the wire connections too obliviously, the color structure is pretty much the same, but i'm not supporting it since i don't own them or have the ability to test on them, so i can't give you any assurance that it'll work.. goodluck .. :)

h0uri (author)h0uri2016-05-28

also this link will help

he used WS2812B

RobynL11 (author)2016-05-21


Here is another problem. If there are two users on one computer, DfMirage turns all the LEDs off when you switch to another user, and the new user is unable to run DFMirage. Can we have DFMirage run in the background or allow two instances of DFMirage to be run?

h0uri (author)RobynL112016-05-21

why is the other user unable to run it ? and is the first user still running the instance ?

the main problem is we can't have to programs sending data at one serial port.

RobynL11 (author)h0uri2016-05-21

The first user runs it, then when the second user logs on, the LEDs go off and when the second user runs DFMirage it does not work because the 1st instance is running, but the LEDs are not.

h0uri (author)RobynL112016-05-22

i don't think it's possible since as i've said before we only got 1 serial port and we can't connect two programs to 1 serial port, another thing that makes this complicated, we got only 1 driver which also won't accept two programs.

maybe using the windows task schedule to manage the situation, but i have no experience there ..

RobynL11 (author)h0uri2016-05-23

What about allowing the 1st instance to continue to run in the background? That would solve the problem.

h0uri (author)RobynL112016-05-23

i've looked a bit for on how to do such a thing, no luck finding a working method at all.

RobynL11 (author)h0uri2016-05-24

what about have an option to automatically exit DFMirage when logged off?

h0uri (author)RobynL112016-05-24

thats a good idea, i will make sure to ubdate it by the end of the day ..

RobynL11 (author)h0uri2016-05-28

v1.3 crashes everytime if win7 comes out of standby after logging in...

h0uri (author)RobynL112016-05-28

well, the only thing added to 1.3 is the exit on switching.. by crash do you mean crash with error or exception thrown ? or just normal close ?

h0uri (author)RobynL112016-05-24

added .. :)

DavidA398 (author)2016-05-24

I am in aww of this project. Just one question, is there a possibility of adding passive hmdi to be able to add a gaming console? im sorry if this is a noob question.

h0uri (author)DavidA3982016-05-25

this project runs on windows os, if and only if you have some magical way of streaming your console screen to windows and view it at the same time you are gaming, then yes this might work for you.

the better solution for would be "Hyperion", it's a software that runs on raspberry pi modules, and it works as a pass through device, you don't need windows os for the processing since it's being processed on the pi.

DavidA398 (author)h0uri2016-05-25

Thank looking at those projects now. I appreciate the quick response and all your hard work.

h0uri (author)DavidA3982016-05-28

You are very much welcome, but i gotta note that gaming with ambilight isn't really that good, actually it's kind of not noticeable and sometimes looks very ugly, i do allot of gaming on pc and i always turn it off or put it on a static color such as white ..

RobynL11 (author)2016-05-20

Thanks Houri for you effort.

Here is log.txt:

Read Config.ini

Config Parsed

Buffer created

Total Leds 50

Gamma table created from 2.8

Rect {X=0,Y=0,Width=2560,Height=1600}

Init Rect

Driver Loaded

Driver Connected

Thread Started

Form lLoaded

Form Shown

Driver Disposed

closed serial port

Sent All Black

Exit Success

20-May-16 7:57:12 PM

Log End ..


driver res {X=0,Y=0,Width=2560,Height=1600}

h0uri (author)RobynL112016-05-20

seems like it should work fine ..but i've added another function to to save a screenshot of the img, plz re download once again and post the img captured

RobynL11 (author)h0uri2016-05-20

Yeap, it works perfect now. Thank you...

h0uri (author)h0uri2016-05-20

nvm about the screenshot, i've used DSR by nvidia to change my res from 1080 to your res and fixed the code, now it should work ..

RobynL11 (author)2016-05-20

ok, everything works fine on 1920x1080. In 2560x1600. only LED 5 to 14 and 26 to 50 lights up.

RobynL11 (author)2016-05-19

I made this but I only get lights on both left and right side. Nothing from the top. Any ideas? I have 14 LEDs on each side and 22 on the TOP. If I for example set L=5, R=5, T=10 the TOP does light up. Where is the hiccup?

h0uri (author)RobynL112016-05-19

#define NUM_LEDS 50

have you done that on the arduino sketch ?

RobynL11 (author)h0uri2016-05-19

Yes that is done. My screen resolution is 2560x1600. Both the Left and Right 14+14 lights up correctly following the left/right screen edges but nothing from the top. The wiring is fine or else the left bank LEDs will not work.

h0uri (author)RobynL112016-05-20

i've released 1.2, it contains a logger to make sure of almost everything .. post both log files after run and exit.

h0uri (author)RobynL112016-05-20

test on 1920x1080.

About This Instructable




Bio: Computer Engineering @ASU in JO.
More by h0uri:Remote Hardware MonitorAmbilight DFMirage [super fast screen capture and processing]Audio Spectrum Software [C#]
Add instructable to: