{"id":18937490,"url":"https://github.com/verifytests/verify.imagemagick","last_synced_at":"2026-04-15T06:02:33.357Z","repository":{"id":42575970,"uuid":"242611399","full_name":"VerifyTests/Verify.ImageMagick","owner":"VerifyTests","description":"Extends Verify to allow verification of documents via ImageMagick.NET.","archived":false,"fork":false,"pushed_at":"2025-04-14T11:25:48.000Z","size":2681,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T12:29:41.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/VerifyTests.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":"code_of_conduct.md","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},"funding":{"github":"VerifyTests"}},"created_at":"2020-02-24T00:00:36.000Z","updated_at":"2025-04-14T11:24:00.000Z","dependencies_parsed_at":"2024-01-10T03:25:03.252Z","dependency_job_id":"e70b2254-fe67-4ac2-b27e-227a5dd0ac90","html_url":"https://github.com/VerifyTests/Verify.ImageMagick","commit_stats":{"total_commits":672,"total_committers":5,"mean_commits":134.4,"dds":0.5282738095238095,"last_synced_commit":"513df5033b39a9ed8728954bfa5fe5301a0e1552"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FVerify.ImageMagick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FVerify.ImageMagick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FVerify.ImageMagick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FVerify.ImageMagick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VerifyTests","download_url":"https://codeload.github.com/VerifyTests/Verify.ImageMagick/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129272,"owners_count":21217319,"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-08T12:11:23.640Z","updated_at":"2026-04-15T06:02:33.352Z","avatar_url":"https://github.com/VerifyTests.png","language":"C#","funding_links":["https://github.com/sponsors/VerifyTests"],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"/src/icon.png\" height=\"30px\"\u003e Verify.ImageMagick\n\n[![Discussions](https://img.shields.io/badge/Verify-Discussions-yellow?svg=true\u0026label=)](https://github.com/orgs/VerifyTests/discussions)\n[![Build status](https://img.shields.io/appveyor/build/SimonCropp/Verify-ImageMagick)](https://ci.appveyor.com/project/SimonCropp/Verify-ImageMagick)\n[![NuGet Status](https://img.shields.io/nuget/v/Verify.ImageMagick.svg)](https://www.nuget.org/packages/Verify.ImageMagick/)\n\nExtends [Verify](https://github.com/VerifyTests/Verify) to allow verification of documents via [Magick.NET](https://github.com/dlemstra/Magick.NET).\u003c!-- singleLineInclude: intro. path: /docs/intro.include.md --\u003e\n\n**See [Milestones](../../milestones?state=closed) for release notes.**\n\nConverts documents pdfs to png for verification.\n\nContains [comparers](https://github.com/VerifyTests/Verify/blob/master/docs/comparer.md) for png, jpg, bmp, and tiff.\n\n\n## Sponsors\n\n\n### Entity Framework Extensions\u003c!-- include: sponsors. path: /docs/sponsors.include.md --\u003e\n\n[Entity Framework Extensions](https://entityframework-extensions.net/?utm_source=simoncropp\u0026utm_medium=Verify.ImageMagick) is a major sponsor and is proud to contribute to the development this project.\n\n[![Entity Framework Extensions](https://raw.githubusercontent.com/VerifyTests/Verify.ImageMagick/refs/heads/main/docs/zzz.png)](https://entityframework-extensions.net/?utm_source=simoncropp\u0026utm_medium=Verify.ImageMagick)\n\n### Developed using JetBrains IDEs\n\n[![JetBrains logo.](https://raw.githubusercontent.com/VerifyTests/Verify.ImageMagick/main/docs/jetbrains.png)](https://jb.gg/OpenSourceSupport)\u003c!-- endInclude --\u003e\n\n\n## NuGet\n\n * https://nuget.org/packages/Verify.ImageMagick\n\n\n## Usage\n\n\u003c!-- snippet: enable --\u003e\n\u003ca id='snippet-enable'\u003e\u003c/a\u003e\n```cs\n[ModuleInitializer]\npublic static void Init()\n{\n    VerifyImageMagick.Initialize();\n    VerifyImageMagick.RegisterComparers(threshold: 0.5);\n}\n```\n\u003csup\u003e\u003ca href='/src/Tests/ModuleInitializer.cs#L3-L12' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-enable' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n`Initialize` registers the pdf to png converter and all comparers.\n\n\n### PDF converter\n\nTo register only the pdf to png converter:\n\n```\nVerifyImageMagick.RegisterPdfToPngConverter();\n```\n\n\n#### Verify a file\n\n\u003c!-- snippet: VerifyPdf --\u003e\n\u003ca id='snippet-VerifyPdf'\u003e\u003c/a\u003e\n```cs\n[Test]\npublic Task VerifyPdf() =\u003e\n    VerifyFile(\"sample.pdf\");\n```\n\u003csup\u003e\u003ca href='/src/Tests/Samples.cs#L32-L38' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-VerifyPdf' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n#### Verify a Stream\n\n\u003c!-- snippet: VerifyPdfStream --\u003e\n\u003ca id='snippet-VerifyPdfStream'\u003e\u003c/a\u003e\n```cs\n[Test]\npublic Task VerifyPdfStream()\n{\n    var stream = new MemoryStream(File.ReadAllBytes(\"sample.pdf\"));\n    return Verify(stream, \"pdf\");\n}\n```\n\u003csup\u003e\u003ca href='/src/Tests/Samples.cs#L40-L49' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-VerifyPdfStream' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n#### Result\n\n[Samples.VerifyPdf#00.verified.png](/src/Tests/Samples.VerifyPdf#00.verified.png):\n\n\u003cimg src=\"/src/Tests/Samples.VerifyPdf%2300.verified.png\" width=\"200px\"\u003e\n\n\n### Image Comparers\n\nThe following will use ImageMagick to compare the images instead of the default binary comparison.\n\n\u003c!-- snippet: CompareImage --\u003e\n\u003ca id='snippet-CompareImage'\u003e\u003c/a\u003e\n```cs\n[Test]\npublic Task CompareImage() =\u003e\n    VerifyFile(\"sample.jpg\");\n```\n\u003csup\u003e\u003ca href='/src/Tests/Samples.cs#L6-L12' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-CompareImage' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n### Register all comparers\n\nAll comparers can be registered:\n\n```\nVerifyImageMagick.RegisterComparers();\n```\n\n\n### Override transparent background\n\nFor images with a transparent background, that background can be overridden:\n\n\u003c!-- snippet: BackgroundColor --\u003e\n\u003ca id='snippet-BackgroundColor'\u003e\u003c/a\u003e\n```cs\n[Test]\npublic Task BackgroundColor() =\u003e\n    VerifyFile(\"transparent.png\")\n        .ImageMagickBackground(MagickColors.Blue);\n```\n\u003csup\u003e\u003ca href='/src/Tests/Samples.cs#L14-L21' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-BackgroundColor' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n\n### Open password-protected PDFs\n\nFor password-protected PDF, the password can be provided to allow verification:\n\n\u003c!-- snippet: PdfPassword --\u003e\n\u003ca id='snippet-PdfPassword'\u003e\u003c/a\u003e\n```cs\n[Test]\npublic Task PdfPassword() =\u003e\n    VerifyFile(\"password.pdf\")\n        .ImageMagickPdfPassword(\"password\");\n```\n\u003csup\u003e\u003ca href='/src/Tests/Samples.cs#L23-L30' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-PdfPassword' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n## Icon\n\n[Swirl](https://thenounproject.com/term/wizard/2744075/) designed by [Philipp Petzka](https://thenounproject.com/masteroficon) from [The Noun Project](https://thenounproject.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverifytests%2Fverify.imagemagick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverifytests%2Fverify.imagemagick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverifytests%2Fverify.imagemagick/lists"}