Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8067529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:19:36+00:00 2026-06-05T12:19:36+00:00

i am trying to make two screenshots with 6 seconds difference, to see if

  • 0

i am trying to make two screenshots with 6 seconds difference, to see if there is some changes on the website.

But my code says me that the screenshots are always different, even if i test it without any changing on the screen.

what am i doing wrong?

Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screensize = toolkit.getScreenSize();
Rectangle rectangle = new Rectangle(0,0,screensize.width,screensize.height);

Robot robot = new Robot();
BufferedImage image1 = robot.createScreenCapture(rectangle); 
System.out.println("screenshot "+i+"");
Thread.sleep(6000);
BufferedImage image2 = robot.createScreenCapture(rectangle);
System.out.println("screenshot "+(i+10)+"");

int x1 = image1.getWidth();
    int x2 = image2.getWidth();
    if ( x1 != x2 ) {
        System.out.println( "Widths are different: " + x1 + " != " + x2 );
        return;
    }

    int y1 = image1.getHeight();
    int y2 = image2.getHeight();
    if ( y1 != y2 ) {
        System.out.println( "Heights are different: " + y1 + " != " + y2 );
        return;
    }

    for ( int x = 0; x < x1; x++ ) {
        for ( int y = 0; y < y1; y++ ){
            int p1 = image1.getRGB( x, y );
            int p2 = image2.getRGB( x, y );
            if ( p1 != p2 ) {
                System.out.println("Pixel is different at x/y " + x + "/" + y + ": " + p1 + " != " + p2 );
                return;
            }
        }
    }

    System.out.println( "Images are identical" );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:19:38+00:00Added an answer on June 5, 2026 at 12:19 pm

    I tried your code and my pixel is different because of a blinking cursor in Eclipse Console.

    Then I had a problem with an animated icon (process explorer in task bar)

    Finally it said Image identical.

    Note : Mouse isn’t part of the thing :

    Creates an image containing pixels read from the screen. This image does not include the mouse cursor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to C++ and trying to make two simple functions, but something goes
I'm trying to make JTextPane with two columns, both aligning to left like that:
I am trying to make a class that will represent two different behaivours at
I'm trying to make two forms that aren't displayed at the same time. The
I am trying to make these two libraries work together. But I am not
quick question.. I'm trying to make two variables appear in one text box but
I am trying to make a sub-table that stores a decode between two values,
I'm trying to make a function template that will accept two (or more) of
Trying to make some small changes to Apache's Velocity engine. Here's what I can
I'm trying to make two lines that follows the mouse every time the MouseMove

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.