Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G grading-harness
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Gitlab will receive a security patch at 4:30 pm today, downtime should be less than 5 minutes.

  • cse340cse340
  • grading-harness
  • Merge requests
  • !2

Add diff tool to screenshots.py

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Henry Heino requested to merge screenshots-diff-tool into master Jan 03, 2022
  • Overview 1
  • Commits 4
  • Pipelines 0
  • Changes 1

Adds a diff tool to the student and grader views for the HTML generated by screenshots.py.

How Tolerance Works

Suppose p1 and p2 represent the actual and expected values of some pixel (respectively).

Then, defining Δr = p1.r - p2.r, Δg = p1.g - p2.g, Δb = p1.g - p2.g, Δa = p1.a - p2.a, if Δr² + Δg² + Δb² + Δa² ≥ tolerance, then the two pixels are considered different.

Adjusting Tolerance

Tolerance can be adjusted through the HTML page's URL. For example, if viewing file:///tmp/mozilla_selenite0/Screenshots-3-2.html, navigate to file:///tmp/mozilla_selenite0/Screenshots-3-2.html?tolerance=256 for a version with tolerance=256.

Screenshots

Fullscreen window: three columns for each test, logs number of different pixels Small window: Columns are thinner

To-do

☑ Test locally

☑ Test with Ed

Example Diffs (somewhat buggy solution)

  • Example diffs with a solution that incorrectly calculates the bounding box of a circle. (default tolerance = 64)
Edited Jan 04, 2022 by Henry Heino
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: screenshots-diff-tool