Repository navigation
FEAT: Add ImageNoiseConverter (random pixel noise) - #4432
Merged
Roman Lutz (romanlutz) merged 7 commits intoNov 24, 2026
Merged
Roman Lutz (romanlutz) merged 7 commits into
Roman Lutz (romanlutz) merged 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Three new async tests omit the mandatory _async suffix required by the repository's style guide.
1 open issue
What changed in this PR
Adds ImageNoiseConverter to PyRIT’s image-conversion pipeline for testing multimodal robustness with reproducible Gaussian pixel noise, addressing #4399.
Changes:
- Implements configurable noise with validation, seeded randomness, clipping, and alpha preservation.
- Exports the converter and adds usage documentation and a modality-table entry.
- Adds unit tests for noise behavior, reproducibility, image modes, and input/output handling.
| File | Description |
|---|---|
tests/unit/converter/test_image_noise_converter.py |
Tests validation, noise behavior, reproducibility, and image handling. |
pyrit/converter/image_noise_converter.py |
Implements the Gaussian pixel-noise converter. |
pyrit/converter/__init__.py |
Adds lazy export and type-checking import. |
doc/code/converters/3_image_converters.py |
Adds a converter explanation and usage example. |
doc/code/converters/0_converters.ipynb |
Adds the converter to the rendered modality table. |
Review effort: Balanced
…o async test names
…onverter Any image transform that changes pixel values needs an RGB color key promoted to an alpha channel before transforming, so share the promotion as a base-class helper instead of keeping it inline in ImageNoiseConverter. Converters that only move pixels do not need it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Roman Lutz (romanlutz)
approved these changes
Nov 23, 2026
# Conflicts: # doc/code/converters/0_converters.ipynb
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 24, 2026
Contributor
Author
|
Thanks for the review, for re-queuing it after the Windows runner hiccup, and for the merge, Roman Lutz (@romanlutz). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds
ImageNoiseConverter, which adds zero-mean Gaussian pixel noise to an image to check how robust a multimodal target's image understanding and image-based safety filtering are. Closes #4399.BaseImageToImageConverter;standard_deviation(0-255 scale, default25.0) must be finite and greater than 0, otherwiseValueError._convert_to_rgb_or_rgba.np.random.default_rng(get_random_seed(stream="image-noise")), followingAudioWhiteNoiseConverter, so a configured seed gives identical output and the global NumPy state is untouched.pyrit.converter, with a section in3_image_convertersafterImageRotationConverter, and the converter table in0_convertersupdated.