Metadata-Version: 2.1
Name: Watchmen
Version: 0.1.0
Summary: Comparing Image for Tesena
Home-page: https://github.com/procesor2017/watchmen
Author: Procesor
Author-email: jfortik@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >3.6
Description-Content-Type: text/markdown
Requires-Dist: Pillow
Requires-Dist: numpy
Requires-Dist: scikit-image
Requires-Dist: imutils
Requires-Dist: opencv-python
Requires-Dist: robotframework

# Watchmen
Custom library for comparing images with use in RobotFramework. It can be used as free functions to import into another language
RF example: `Library          path` Python example:`import watch.py`

# What you need
## Pip install
80% functional.

[Watchmen](https://pypi.org/project/Watchmen/)
1. Open CMD
2. Start `pip install Watchmen`
3. Import to robotframework `Library Watchmen`

## Manual Install
### Main
- [Python](https://www.python.org/)
- [RobotFramework](https://robotframework.org/)
- [OpenCV](https://opencv.org/)  `pip install opencv-python` or `pip3 install opencv-python`
- [Pillow](https://python-pillow.org/)    `pip install Pillow`
- [Numpy](https://numpy.org/) `pip install numpy`
- [Scikit](https://scikit-image.org/) `pip install scikit-image`
- [Imutils](https://github.com/jrosebr1/imutils) `pip install imutils`

### How to install in RF
- Download git file (Mainly ./Python/watch.py)
- You must first eneter the path to Settings => `Library          path`, where path is the path to the watch.py file
- Now, you can start using keywords listed below. Keep in mind that you need to have all necessities installed to work properly

## Description Keyword
### It is always necessary to ensure that the images are the same resolution (size) !!!!

| Keyword  | Arguments | Documentation |
|     :---:      |    :---:      |     :---      |
| Compare two image  | path1, path2  |  It compares two images from the two paths and, if there are differences, saves the image with the errors highlighted in the folde: ../Save Image </p>path1 = path to the first image to be compared<p>path2 =  path to the second image to be compared <p>Example:  Compare two image  ../image1.png  ../Image2.png |
| Compare screen  | path1 | Compares the already saved image with the screen that is on the screen. If there is a difference, it saves the highlighted image to the ../Save Image  </p>path1  = path to the image to be compared to screen </p> Example:  Compare screen  ../image1.png  |
| Compare making area  | x1, y1, x2, y2  | Creates a cut-out from the screen that is on screen and saves it in the folder: ../Create area  </p>x1 a y1 = x and y coordinates for the upper left corner of the square <p>x2 and y2 = x and y coordinates for the bottom right corner of the square<p> Example:  Compare making area  0   0   25  25  |
| Compare screen area  | x1, y1, x2, y2, path1  | Creates a cut-out from the screen that is on the screen and compares it to a previously created</p>x1 and y1 = x and y coordinates for the upper left corner of the square <p>x2 and y2 = x and y coordinates for the bottom right corner of the square <br>path1 =   Path to an already created viewport with which we want to compare the viewport created by us </p>Example:  Compare screen area  0   0   25  25  ../Crop_Image1.png `Creates Crop_Image1.png from 0, 0, 25, 25`|
| Compare screen without areas  | path1 *args  | Compares two pictures, which have parts to be ignored  </p>x1 and y1 = x and y coordinates for the upper left corner of the ignored area square <p>x2 and y2 = x and y coordinates for the lower right corner of the square of the ignored part<p>Attention! It is always necessary to enter in order x1 y1 x2 y2 x1 y1 x2 y2 etc ... </p>Compare screen without areas ../Image1.png 0 0 30 40 50 50 100 100 `Creates 2 ignored parts at 0,0, 30,40 and 50, 50, 100, 100` |
| Compare making rescreens  | *resolution  | Creates a screenshot on the screen, that corresponds to the specified resolution, so it is possible to create on one page an infinite number of screens with different resolutions. Screens are stored in the folder: ../Create rescreens </p>*resolutin = The specified resolution in width and height format, you can enter as many as needed </p>Example: compare making rescreens            800  600    1280    800     1440    900 `Creates 3 screens in 800x600 1280x800 and 1440x900` |

## How it looks screen
_Image for comparison for Compare screen, Compare screen without areas and from Compare making rescreens_

<img src="/img/rescreen_1440x900%20.png" width="400" height="300"></p>

_Image where the differences are stored + You can see two black box in left corner. These black box are ignored in compare._

<img src="/img/img1580714803.440042.png" width="400" height="300">



