{"id":19773929,"url":"https://github.com/badoo/vrt-runner","last_synced_at":"2025-06-12T14:04:44.924Z","repository":{"id":38022855,"uuid":"264212498","full_name":"badoo/vrt-runner","owner":"badoo","description":"VRT runner and result generator for images","archived":false,"fork":false,"pushed_at":"2023-03-08T20:10:07.000Z","size":2412,"stargazers_count":0,"open_issues_count":5,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T18:38:00.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/badoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-15T14:18:23.000Z","updated_at":"2021-02-11T10:23:58.000Z","dependencies_parsed_at":"2024-11-12T05:11:34.983Z","dependency_job_id":"fa709ff4-baf4-4cf8-97b5-aff8427ca675","html_url":"https://github.com/badoo/vrt-runner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/badoo/vrt-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoo%2Fvrt-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoo%2Fvrt-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoo%2Fvrt-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoo%2Fvrt-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badoo","download_url":"https://codeload.github.com/badoo/vrt-runner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badoo%2Fvrt-runner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259479471,"owners_count":22864355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T05:11:32.539Z","updated_at":"2025-06-12T14:04:44.887Z","avatar_url":"https://github.com/badoo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [@magiclab/vrt-runner](https://www.npmjs.com/package/@magiclab/vrt-runner)\n\nVRT runner and result generator for images\n\n![VRT Example](https://raw.githubusercontent.com/badoo/vrt-runner/master/example.png \"VRT Example\")\n\n## CLI\n\n`npx @magiclab/vrt-runner --cwd path_to_diff_images --output result_output`\n\nIt expects the files to have a simple folder syntax\n\n```bash\npath_to_diff_images\n├── baseline\n│   ├── 1.png\n│   └── 2.png\n└── test\n    ├── 1.png\n    └── 2.png\n```\n\n### Change options via CLI, e.g. comparison diff threshold\n\n```bash\n    npx @magiclab/vrt-runner --cwd path_to_diff_images --output result_output --matchingThreshold 0.25\n```\n\n| Variable Name           | Description                                                                                                                                                                                                    |\n| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `--ignoreChange`        | If `true`, error will not be thrown when image change detected. Default `true`                                                                                                                                 |\n| `--matchingThreshold`   | Matching threshold, ranges from 0 to 1. Smaller values make the comparison more sensitive. `0.05` by default. `0` by default for reg-cli.                                                                      |\n| `--thresholdRate`       | Rate threshold for detecting change. When the difference ratio of the image is larger than the set rate detects the change. Applied after matchingThreshold.                                                   |\n| `--thresholdPixel`      | Pixel threshold for detecting change. When the difference pixel of the image is larger than the set pixel detects the change. This value takes precedence over thresholdRate. Applied after matchingThreshold. |\n| `--concurrency`         | How many processes launches in parallel. If omitted 4                                                                                                                                                          |\n| `--enableAntialias`     | Enable antialias. If omitted `true`                                                                                                                                                                            |\n| `--additionalDetection` | Enable additional difference detection(highly experimental). Select \"none\" or \"client\" (default: `none`).                                                                                                      |\n\n## Node\n\nYou can also use it as a node module\n\n```js\nimport runVrt from '@magiclab/vrt-runner';\n\nrunVrt({\n    cwd,\n    output,\n    teamcity, // boolean flag to know if we should log teamcity friendly output\n    options, // optional: parameters for reg-cli\n});\n```\n\n## Hooks\n\nCurrently we support `onVrtComplete` hook, which allows you to get results of comparison and timing of comparison.\n\nOne of the ways to use this data is the following:\n\n```js\n\n(async function() {\n    try {\n        // define action\n        const onVrtCompleteAction: onVrtCompleteType = (result, cmpTime) =\u003e {\n            const info = showResults({\n                failedItems: result.failedItems.length + result.deletedItems.length,\n                passed: result.passedItems.length + result.newItems.length,\n                diffTime: cmpTime / 1000,\n            });\n\n            return info;\n        };\n\n        // save data after runVrt\n        const info = await runVrt({\n            cwd,\n            output,\n            teamcity, // boolean flag to know if we should log teamcity friendly output\n            onVrtComplete: onVrtCompleteAction\n        });\n\n        // work with data\n        console.log(info);\n    }\n    process.exit(0);\n})();\n```\n\n## How to change options for `reg-cli` instance\n\nYou might want to change the different comparison options in instances of `vrt-runner`. You can do it via `options`, which are are aligned with [pixelmatch API](https://github.com/mapbox/pixelmatch)\n\n### Change comparison diff threshold in Node\n\n```js\n    const options = {\n        matchingThreshold: 0.2\n    };\n\n    const vrtIntance01 = runVrt({\n        cwd,\n        output,\n        teamcity, // boolean flag to know if we should log teamcity friendly output\n        options,\n    });\n\n    const optionsSecondType = {\n        matchingThreshold: 0.2\n    };\n\n    const vrtIntance03 = runVrt({\n        cwd,\n        output,\n        teamcity, // boolean flag to know if we should log teamcity friendly output\n        optionsSecondType,\n    });\n\n    const vrtIntance03 = runVrt({\n        cwd,\n        output,\n        teamcity, // boolean flag to know if we should log teamcity friendly output\n    });\n})();\n```\n\n\n## Assets\n\nCSS files for the report page are generated. If you need to make changes to it, update `src/report-assets/css/vrt.scss` and run the following command:\n\n```bash\n    yarn styles\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadoo%2Fvrt-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadoo%2Fvrt-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadoo%2Fvrt-runner/lists"}