Skip to content

Conversation

@kwokcb
Copy link
Contributor

@kwokcb kwokcb commented Nov 13, 2025

Changes

  • Add in option JSON option to allow users to format data as they see fit.
  • Add Markdown option to allow preview in Markdown supported locations such as Github repos.
  • Cleaned up HTML output to properly wrap and format + is responsive now (will fill if w<=0 specified)
  • Fixed bad memory read (exception) if you specify the same language for 3 diffs.
  • Add in "reduced" image option. The default size can be reduced to roughty 1/10 size if use original 512. (122 to 10 MB). and with 256 width to 3MB for after conversion to PDF.
    • Uses base64 encoding into JPG and embeds into json struct which can be stored directly in Markdown or HTML. This also means less disk read / writes for diff image generation.
    • Uses OpenCV + numpy if available for fast resize. PIL and OpenImage are much slower for this encoding case.
    • JSON / Markdown storage is about 4mb from 160K when embedding encoded images but is now self-contained.
  • Also replaced diff with OpenCV + numpy instead of PIL to avoid extra data copies. If no OpenCV will still use current PIL.

Output

JSON, Markdown, HTML output

image

HTML results responsive (fills) vs packed.

  • Both scale properly on tablet and mobile now.
  • Packed is default as default width (w) is 256.
image

Embedding Example

Markdown embedding. This can be stored on any github repo without the original files.

image

PDF file with reduced images. Straight HTML->PDF save.
Test Results.pdf

- Add in option to filter out rows based on minimum RMS value.
- Add in option JSON, and Markdown options
- Cleaned up HTML output.
@jstone-lucasfilm
Copy link
Member

This looks really compelling, @kwokcb, and I'm looking forward to trying this out in the render test suite!

@jstone-lucasfilm
Copy link
Member

I like the added flexibility in the new HTML generation, though when I run the render tests through our usual PDF-generation process, the rendered images seem to be smaller on the page, with an extra white border around them:

MaterialXRenderTests_11_22_2025_GitHub.pdf

Do you think it would be possible to adjust the default HTML generation to restore the original size of the images on the page, without the additional white border?

Preserve the image size, border and spacing from original version.
…0 size if use original 512. (122 to 10 MB). and with 256 width to 3MB.

This makes easier to store comparisons images in PDF.
The idea is to use base64 encoding into JPG and embed it into the html.This also means less disk read / writes for diff image generation.
Uses OpenCV + numpy for fast resize. PIL and OpenImage are much slower for this encoding case.
JSON storage is about 4mb from 160K when embedding encoded images.
Replaced diff with OpenCV + numpy instead of PIL to avoid extra data copies.
@kwokcb
Copy link
Contributor Author

kwokcb commented Nov 25, 2025

@jstone-lucasfilm , @ld-kerley : This is about as far as I'm going to take this change for now.
The data structure built can hold whatever is desired but by adding 64 bit encoding it can be self contained and also produces much smaller output. I have switched to OpenCV since it's the fastest package I could find for this (without external dependencies).

(Jonathan, the formatting is as close to the original static tables as possible for html.).

@kwokcb
Copy link
Contributor Author

kwokcb commented Nov 25, 2025

Example run with small change to add hash compares.
hash_results.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants