🖋️
QualityMate
  • QualityMate
  • Getting Started
    • Introduction
    • Why QualityMate
    • Architecture
    • Supported Web Browsers
    • Glossary
  • Components
    • UI Player
      • Basic Concepts
      • UiPlayer
      • MSTest Integration
      • Samples
        • QualityMate Sample Desktop
        • QualityMate Sample Web
        • QualityMate MSTest Integration Sample Desktop
        • QualityMate MSTest Integration Sample Web
        • QualityMate Integration with Test Frameworks
        • Web Authentication Sample
      • QualityMate Project Template
    • UI Recorder
      • Basic Concepts
      • Setting Up the Recorder
      • Validating an Element
      • Generating QualityMate Solution
  • Tools
    • File Comparators
    • Image Processor
    • Project Merger
    • Test Case Generator
      • Filters
      • Rename Recorded Controls
  • Basic Concepts
    • Page Object
      • Work Guide
    • Controls
      • Control Types
        • Generic Types
        • Desktop types
        • Web Types
        • WebMap types
          • Kendo PowerBuilder
          • Kendo WinForms
          • Kendo Silverlight
      • Interactions
        • SendKeys
        • Validate
    • Selectors
      • Selectors in Code
      • Default Selector
      • Shared Selector
      • Selectors Category
        • CSS Selector
        • XPath Selector
        • Image Selector
        • Frame Selector
      • Identifying Selector
        • Identify for Windows Desktop
        • Identify for Web
  • How to Guides
    • Setting Up the Configuration
      • Parameters
      • Context
      • Loading External Data
    • Awaiting for the Application
      • Busy Loaders
      • Retries
    • Defining Controls
      • Extending Controls
      • Control Slice
      • Control Collection
    • Logging on Tests
      • QualityMate Reports
      • Logging
  • Help
    • Best Practices
      • Environment
      • Tests
      • Page Objects
      • Validations
      • Interactions
      • Image Comparisons
    • Known Issues
    • Continuous Integration
      • Agents Session
    • Upgrading QualityMate
      • From version 7 to version 8
      • Previous Versions
      • How to switch from TestFeature to UiTest
    • VS Test
      • Command Line
      • Generate Reports
  • API
    • Control Interfaces
      • IButton
      • ICheckBox
      • IComboBox
      • IControl
      • IControlSlice
      • IDateTimePicker
      • IElement
      • IGrid
      • IGroupBox
      • ILabel
      • IListBox
      • IMenu
      • INumericUpDown
      • IPageObject
      • IProgressBar
      • IRadioButton
      • IRadioButtonGroup
      • ISplitButton
      • IStatusStrip
      • ITab
      • ITextBox
      • IToggleButton
      • IToolBar
      • ITreeView
    • Behavior
      • ICheckableControl
      • IList
      • ITextControl
    • Enums
      • ClickType
      • KeyModifiers
      • MouseButton
  • Changelog
    • Changelog
      • Version 8
      • Version 7
      • Version 6
      • Version 5
      • Version 4
      • Version 3
Powered by GitBook
On this page
  • AreEqual
  • Contains
  • Recommended Image Format

Was this helpful?

  1. Tools

Image Processor

PreviousFile ComparatorsNextProject Merger

Last updated 2 years ago

Was this helpful?

The ImageProcessor is a tool used to compare two images. The main methods are as follows:

Check our article related with our suggestions related with the Image Processor.

AreEqual

Compare if two images are the same. Example:

ImageProcessor.AreEqual("image1.png", "image2.png");

Contains

Search if the entire image contains the image fragment.

ImageProcessor.Contains("EntireImage.png", "ImageFragment.png");

The algorithm tolerates a certain level of difference between the images. The threshold parameter handles the tolerance level. The default value can be reduced to make it more permissive or increased to make it more strict.

Recommended Image Format

Which is the best image format to use with the Image Processor? We recommend it to use in this order:

  1. Bitmap (.bmp): This is the most reliable format because the image is not compressed. If the file size of the images does not matter, we highly recommend doing the comparison with Bitmap images. Also, with Bitmap images, you can convert to any other image format if need it.

  2. Tag Image File Format (.tiff): This allows raw, lossy, and lossless compression, and the quality of the image has a priority against the file size. Usually used for scanning/printing documents. If you don't want to use Bitmap, the TIFF images are your way to go.

  3. Portable Network Graphics (.png): Offers the same compression capabilities as .tiff, excluding raw, has better compatibility, and focuses on the file size.

  4. Joint Photographic Experts Group (.jpeg/.jpg): This format allows lossy compression to reduce the file size considerably. Avoid this format for text comparisons. Only use this if one of the above is not available, or you already had the baseline images with this format.

The Graphics Interchange Format (.gif) image format is not currently supported to compare images.

Save Image

Remember that you need to specify the ImageFormat when saving a Bitmap, here is an example using UiPlayer:

Bitmap myFile = MyPageObject.MyControl.GetScreenshot();
myFile.Save("MyFile.tiff", ImageFormat.Tiff);

When you only specify the name without ImageFormat, the Bitmap will be saved as a PNG image regardless of the extension.

best practices