PixelGrabber là một thư viện Java cho phép lấy ra các điểm ảnh (pixels) trên hình và từ đó có thể dùng để so sánh để phát hiện ra sự thay đổi, khác biệt giữa hai bức ảnh. Có thể ứng dụng vào Automation để nhận biết những sự thay đổi layout.

Kết quả:

Input layout: 01.png & 02.png
Output: Passed. They are the same!

Input layout: 01_changed.png vs 02_changed.png
Output: Failed. There are some difference between 2 images!

Nếu file không tồn tại sẽ hiển thị thông báo: File(s) could not found!

The PixelGrabber class implements an ImageConsumer which can be attached to an Image or ImageProducer object to retrieve a subset of the pixels in that image.

Nhận diện hình ảnh là một chủ đề hay và đáng tìm hiểu để ứng dụng vào kiểm thử tự động.

5 Comments

Leave a Comment

Your email address will not be published.