Image diff is a powerful feature of the popular Helix Visual Merge Tool, P4Merge.

Although P4Merge is designed primarily for diff'ing and three-way merging of source code files, image diff is a unique feature that is especially useful for game developers and others working with graphics files. Using the image diff tool, you can compare two image files, either side-by-side or overlaid.

P4Merge runs on Windows, Linux, and Macintosh. You can download the latest version at Perforce.com.

You can use image diff from within P4V, the Visual Client for Helix Core, or by running P4Merge as a standalone application. You can diff JPEG, GIF, TIFF, PNG, and several other common image file types.

I’m using Windows in this demo. The image diff feature will behave almost exactly the same on the other supported platforms.

Let’s say you are on a team designing a game that features a gigantic reptilian monster. You’ve been tasked with making some very specific changes to the monster’s eyes, and you want to make sure you got them all done.

You can use the image diff tool to compare the version you’ve edited with the most recent version in the Helix Core depot.

In P4V, all you have to do is drag the thumbnail of the newly edited file in your local workspace onto the version you wish to compare it to in the depot.

P4Merge displays the images in a two-pane view. The images load at 100%, showing as much of the images as will fit in each pane, starting at the upper left corner.

For easy reference, at the top of each pane you’ll see selectable file paths.

The scale of the view for each pane appears in the bottom left of each image’s info pane. In our case, it is 100%. Each pane also has the specs for each image, including the file format, file size, pixels, resolutions, color space, and bit depth.

On the left side of the diff tool user interface, is the Viewer Control menu. All the buttons have tool tips. You’ll have no problem learning this simple interface.

The first button selects the current view, side-by-side. It displays the two thumbnails for the images you are comparing.

By default, the images are linked. You can use the slider at the bottom of the thumbnails to zoom in and out. You can also use the scroll bars in the panes of each image to change the area of the images you are looking at.

Click the chain link icon at the top to unlink the images.

While some differences are obvious in the two-pane view, others are not as easy to detect. Selecting the second button overlays the images. This stacks the images, one image on top of the other. When you do this, a new vertical “blending” slider displays next to the thumbnails.

Now you can see the differences by moving the blending slider to select the amount of each image that is displayed. To view only the original, move the slider all the way to the top. To view the edited version, move the slider to the bottom. To blend the two, move the slider toward the middle.

The button with four direction arrows fits the image to window. When there are subtle changes between images, you can select the “highlight differences” checkbox. Now you will see each identical area in gray, and differences are highlighted in yellow. The slider lets you control the comparison tolerance to reduce the amount of deviation visible and focus on major changes. To see every pixel that has changed, move the slider all the way to the right.

If you are working with big images, you may want to detach the Viewer Control panel. Double-click next to the text or select the round icon. The panel can be resized and parked anywhere you want it, even on another display. You can also dock it on the right.

The image diff tool can be combined with the thumbnail image generator and viewer, and the Helix Plugin for Graphical Tools, P4GT, to bring Helix Core version control features to your favorite designer tools. This empowers your non-code contributors work collaboratively with software developers.

You can find additional detail on image diff functionality in P4V online help and the documentation section of the Perforce website. If you have any technical questions, please contact [email protected]

Course - Using the Helix Visual Client - P4V