I assume your bootloader is unlocked now since it was required to root.
Use fastboot to boot into custom recovery and use it's backup feature to backup the rom. By booting only it doesn't install the recovery, you can boot back into recovery later to restore the image.
If you haven't, though I assume you did in order to root, you need to install adb/fastboot driver for your device (while it's connected in fastboot mode/bootloader menu).
http://developer.android.com/sdk/win-usb.html
Then you need to set up adb/fastboot. Search internet or use this
http://forum.xda-developers.com/showthread.php?t=2317790
You can download the TWRP image (which is a custom recovery) for the Nexus 4 from here:
http://techerrata.com/browse/twrp2/mako
Then while your phone is in fastboot mode, run Minimal ADB/fastboot I posted above or wherever your fastboot.exe is located, in the command line just type this: fastboot boot twrp.img
After backing up your device, boot into the phone and copy the TWRP folder in your phone to your computer, which contains the backup, installing factory image on Nexus device will wipe all your files (there is a way to keep your data if you know how).
sent via tapatalk