Categories
General How-to IT News, Tech Information and Analysis Microsoft

Remove the Background of an Image using Office 2010

Few of us use images in our daily lives. It could be for creating an invitation, writing a blog post, preparing Lab records/Instruction Manuals etc. We often Google for images and use them. However, sometimes the background of the image doesn’t blend so well with our document/invite and adding them does not give a good feel. There comes a need for removing the background of the image using any of the photo editing softwares available.

Office 2010 has an excellent image editing feature, which would help us do a lot of stuffs on images, including the remove background option. In this example, we will see how to do the same.

Step 1: Insert the image into any of the office Suite products. In this example, I will use the Word 2010.

Step 2: Double-click on the image; this will give you a separate picture Editing Menu Bar (as shown below)

Step 3: Select the Remove Background Option. This will give you a work area to play with. Here you can select the ‘areas to keep’ and ‘areas to remove’. Its as simple, as selecting the option and clicking your mouse cursor on that specific area.

Step 4: When you are done with the marking the areas, Click on the Keep Changes Button to save. This will give you the image with removed background.

Now you can use this image, for any purpose. This would be a transparent image (png) and hence, can be used on any background color!

To know how to add Artistic Effects to the image, do read this article!

If you have not tried the Office 2010 Version yet, Download it and Give it a shot. I’m sure, you would love it!

Categories
Microsoft Windows Installer, Application Compatibility and Deployments

Add or Remove a driver from a Wim Image using DISM

You can offline service an image using DISM and add drivers to the mounted ones. You will need to download driver packages from OEM’s and ISV’s. These packages need to be INF-based packages (.exe or .msi driver installation is not available offline).

You can then use the DISM add-driver command to add the INF-based driver to the image. If you want to install all drivers in a directory, add the /Recurse switch. To validate that the package was installed, use the Get-Drivers command to query the image (this defaults to listing third party drivers only, which can be over-ridden by using the /All option). Use /ForceUnsigned to add unsigned drivers to X64-based images.

To do these operations, you should mount the Wim image first. If you arent aware on the steps, then do check this article!

DISM image servicing – VHD Support

  • Same servicing support as for WIM images. (Just replace the /MountDir folder with the virtual harddisk Drive Letter!)
  • Must use separate tools like diskpart to attach the VHD image for servicing
  • All updates are committed to the VHD image right after completion of the servicing operation

In this example, let me add a third party hp driver to a wim image which is already mounted. First, lets list out the drivers which are already a part of this Wim image. using the command dism /image:”<imagemountdir> /get-drivers

DISM /get-Drivers

Now I am adding a third party driver(hp) using the switch /add-driver. The command would look like, dism /image:<imagemountdir> /add-driver /driver:<pathtotheinffile>

DISM /Add-driver

When you list of the drivers which are present on the Wim Image,  you will see a new oem1.inf has been added to the image. This is the hpstape.inf driver which we just added. The tool automatically enumarates the number of the oem file and creates a published name. Thats the reason, you see a oem1.inf getting created. Now, when you add a new driver again, it would be oem2.inf.. and so on..! –

This phenomenan is very important, as hardcoding this oem file number will put the machine in a un-safe state., and un-installing them will cause a chaos!

DISM /get-drivers

If you want to remove a driver from the Wim image, you can just run the dism tool with the /remove-driver switches, dism /image:<imagemountdir> /remove-driver /driver:<publishedname>

Dism /Remove-driver

Driver Servicing Commands:

/Remove-Driver –  Removes driver packages from an offline image.
/Add-Driver – Adds driver packages to an offline image.
/Get-DriverInfo – Displays information about a specific driver in an offline image or a running operating system
/Get-Drivers  – Displays information about all drivers in  an offline image or a running operating system.

You would also be interested in reading this  –

Categories
Microsoft Windows Installer, Application Compatibility and Deployments

Enable or Disable a feature from a Wim Image using DISM

You can offline service an image using DISM and enable/disable a feature on the mounted ones. In this short article, let us see on how we can do the same.

To do these operations, you should mount the Wim image first. If you arent aware on the steps, then do check this article!

DISM image servicing – VHD Support

  • Same servicing support as for WIM images. (Just replace the /MountDir folder with the virtual harddisk Drive Letter!)
  • Must use separate tools like diskpart to attach the VHD image for servicing
  • All updates are committed to the VHD image right after completion of the servicing operation

First list all the features available on the mounted Wim Image. To get this information use the command, dism /Image:<MountedDir> /get-features

Dism /get-features

Now for the demo purpose, let me enable the “ServerMigration” Feature. To do the same, you will need to use the command line dism /image<mountedDir> /enable-feature /featureName:<featurename>

Dism /enable-feature /featurename

Now when you list the features again, you will see that, this feature is enabled!

Here are the other Package and Feature Servicing Commands

/Add-Package – Adds packages to the image.
/Remove-Package – Removes packages from the image.
/Enable-Feature – Enables a specific feature in the image.
/Disable-Feature – Disables a specific feature in the image.
/Get-Packages – Displays information about all packages in the image.
/Get-PackageInfo – Displays information about a specific package.
/Get-Features – Displays information about all features in a package.
/Get-FeatureInfo – Displays information about a specific feature.
/Cleanup-Image – Performs cleanup and recovery operations on the image.

You would also be interested in reading this  –

Categories
Microsoft Windows Installer, Application Compatibility and Deployments

Unmount and Clean up a Wim Image using DISM

DISM provides you an option to load Wim images onto your local drive and the service it offline. You can either add/remove a driver, enable/disable features, perform other customizations..without even installing them on a physical box. Now when you have mounted a Wim image, its really necessary to check if the image is mounted correctly. you can do that by running the command,  dism /get-MountedWiminfo.

Check the Status. If the Status is OK, then everything is good. If the Status is anything else., for eg: Needs Remount, Status Un-available, Invalid.. etc.. Its an indication that, you gotta’ remount (repair) the image. In this article, you will know how to Unmount, clean and remount a Wim image using the DISM tool.

Get-MountedWinInfo

The screenshot above shows the mounted image status as “Invalid”.  This means that the mount point is corrupted and there may be resources associated with the mounted image that has been abandoned.  The cleanup command does not unmount a mounted image, nor does it delete images that can be recovered using the remount command.  You can use the cleanup command to delete these abandoned resources.  You can cleanup using the command syntax: dism /cleanup-wim

If the mounted image status shows as “Need-Remount”, you can run the remount command to recover the orphaned mount path.

Re-Mounting a Wim Image

When you have an issue with the mounted images as seen above, you will need have a need to re-mount the images which are mounted. This command will recover an orphaned Wim mount directory. You can re-mount using the command syntax.  dism /remount-wim /MountDir:<mountDir>

Un-Mounting a Wim Image

Once you are done with Servicing the Wim Image, you can unmount the image from your machine. Most of the IT Pros have asked this, what if they have forgot to save the changes, before they unmount. Thats how the DISM team has added this switch either to commit or discard the changes.  dism /unmount-Wim  /MountDir:<mountDir> /commit

Changes to WIM files are not “committed” until you do so specifically. You have three choices:

  1. Unmount the image using the /Commit option (to save changes)
  2. Use the /Commit option without unmounting (this keeps the image open so you can make more changes).
  3. Unmount the image and use the /Discard option. In this case the image in the WIM file will be unchanged. This is used primarily as a manual “undo” of your changes.

Unmount-Wim

Cleaning up all Mounted Wim Images

This operation will search for all the stale or corrupted files in your machine and clean it up! – dism /cleanup-wim

The /Cleanup-Wim command is only used if there is any issue with the mount points, that means when any of the mounted images are shown as in the “Invalid” state.  You can run the cleanup command to delete these abandoned resources at the corrupted mount points.  There is no need to run the cleanup command every time when you are done with servicing the mounted images, but only when you run the /get-mountedwiminfo command and found that there are some mounted images showing the “Invalid” status. (as shown in the first screenshot in this article)

Cleanup-Wim

Since cleanup command only needs to be run when the /get-mountedwiminfo shows any mounted images in “Invalid” state, and the cleanup command does not unmount a mounted image, nor does it delete images that can be recovered using the remount command, running the /get-mountedwiminfo command after running the /cleanup-wim command usually still shows the mounted images with status no longer in the “Invalid” state instead of no mounted images as shown in the snapshot above.  Note that is very rare that a mounted images will be in the “Invalid” state, since it is rare that a mount point will become corrupted unless something weird has happened to the host system!

No Mounted Images

Special thanks to Anne Wong the Product Manager of DISM Tool, for correcting few information in this article! Really appreciate her efforts in looking through the each and every word!

You would also be interested in reading this  –

Categories
Microsoft Windows Installer, Application Compatibility and Deployments

DISM – Deployment Image Servicing and Management Guide

Deployment has a new tool in Windows 7: DISM (Deployment Image Servicing and Management). DISM is a command line tool which can be used to service a Windows® image or to prepare a Windows Preinstallation Environment (Windows PE) image. It replaces Package Manager (pkgmgr.exe), PEimg, and Intlcfg that were included in Windows Vista®.

Hence, Now one tool does it all ! ! !

DISM can be used to service Windows Vista® with Service Pack 1 (SP1) and Windows Server® 2008 and provides the same functionality that Package Manager provided. DISM provides additional functionality when used with Windows® 7 and Windows Server® 2008 R2.

In addition to replacing three previously released tools, DISM also supports more features and functionality than the other tools (most notably Package Manager) supported in Windows Vista, including logging, inventory commands with parse-able output, detailed help, offline INF driver package installation, direct application of MS update packages, and integration of international settings.

DISM tool is also part of the Windows Automation Installation Kit(AIK) 2.0, which you can freely download and use!

DISM can be used to..,
1. Add, remove, and enumerate packages.
2. Add, remove, and enumerate drivers.
3. Enable or disable Windows features.
4. Apply changes based on the offline servicing section of an unattend.xml answer file.
5. Configure international settings.
6. Upgrade a Windows image to a different edition.
7. Prepare a Windows PE image.
8. Take advantage of better logging.
9. Service down-level operating systems like Windows Vista with SP1 and Windows Server 2008 (
Supports only Vista SP1 and later images)
10. Service all platforms (32-bit, 64-bit and Itanium).
11. Service a 32-bit image from a 64-bit host and service a 64-bit image from a 32-bit host.
12. Make use of old Package Manager scripts.

Running DISM Tool

Run a Command Window with Elevated ContextDISM is a command line utility. To launch this program, run a Command Window in an elevated context (Run As Administrator) and type dism /? This will give you the help file (without image context – The commands which you can perform without loading or mounting an image)

Windows 7: DISM (Deployment Image Servicing and Management)

Now you type, dism online /? This will give you the help file (with image context – The commands which you can perform an Wim image or a VHD is mounted) – As you see in this below snapshot, you can do a lot of options like, Setting the edition of the image, UI Lang packs, Time Zones, Apps, Drivers etc..

DISM Help file - With Image context

How does DISM Work?

How Deployment Image Servicing & Management (DISM) Works

DISM Providers These providers varies on different Operating Systems.  Windows 7 and Server 2008 R2 has DISM providers. Windows Vista SP1 and Windows Server 2008 RTM does not contain any DISM providers.  When servicing these downlevel OS images, DISM loads and invokes the Vista PkgMgr from inside the image to execute the operations.  Windows 7 and Windows PE 3.0 may contain DISM service providers that are specific to the OS image, e.g. Transmog provider operates against full OS image and can only be found in a Windows 7 image, and PE provider operates against WinPE image, so can only be found in a Windows PE 3.0 image. You can find a list of providers in the folder C:\Windows\System32\DISM in Windows 7 and Server 2008 R2.

Dism Providers - Windows 7

I would recommend you read the other DISM articles too!